|
| 1 | +<p align="center"> |
| 2 | + <a href="https://github.com/cnag-biomedical-informatics/pheno-ranker"><img src="https://raw.githubusercontent.com/cnag-biomedical-informatics/pheno-ranker/main/docs/img/PR-logo.png" width="400" alt="Pheno-Ranker"></a> |
| 3 | +</p> |
| 4 | +<p align="center"> |
| 5 | + <em>Pheno-Ranker: a toolkit for comparison of phenotypic data stored in GA4GH standards and beyond</em> |
| 6 | +</p> |
| 7 | + |
| 8 | +[](https://github.com/cnag-biomedical-informatics/pheno-ranker/actions/workflows/build-and-test.yml) |
| 9 | +[](https://coveralls.io/github/CNAG-Biomedical-Informatics/pheno-ranker?branch=main) |
| 10 | +[](https://github.com/cnag-biomedical-informatics/pheno-ranker/actions/workflows/cpan-publish.yml) |
| 11 | +[](https://cpants.cpanauthors.org/dist/Pheno-Ranker) |
| 12 | + |
| 13 | +[](https://github.com/cnag-biomedical-informatics/pheno-ranker/actions/workflows/docker-build-multi-arch.yml) |
| 14 | +[](https://hub.docker.com/r/manuelrueda/pheno-ranker/) |
| 15 | +[](https://hub.docker.com/r/manuelrueda/pheno-ranker/) |
| 16 | +[](https://github.com/cnag-biomedical-informatics/pheno-ranker/actions/workflows/documentation.yml) |
| 17 | +[](https://opensource.org/licenses/Artistic-2.0) |
| 18 | +[](https://colab.research.google.com/drive/1n3Etu4fnwuDWNveSMb1SzuN50O2a05Rg) |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +**📘 Documentation:** <a href="https://cnag-biomedical-informatics.github.io/pheno-ranker" target="_blank">https://cnag-biomedical-informatics.github.io/pheno-ranker</a> |
| 23 | + |
| 24 | +**📖 Usage:** <a href="https://cnag-biomedical-informatics.github.io/pheno-ranker/usage/" target="_blank">https://cnag-biomedical-informatics.github.io/pheno-ranker/usage/</a> |
| 25 | + |
| 26 | +**📓 Google Colab tutorial:** <a href="https://colab.research.google.com/drive/1n3Etu4fnwuDWNveSMb1SzuN50O2a05Rg" target="_blank">https://colab.research.google.com/drive/1n3Etu4fnwuDWNveSMb1SzuN50O2a05Rg</a> |
| 27 | + |
| 28 | +**📦 CPAN Distribution:** <a href="https://metacpan.org/pod/Pheno::Ranker" target="_blank">https://metacpan.org/pod/Pheno::Ranker</a> |
| 29 | + |
| 30 | +**🐳 Docker Hub Image:** <a href="https://hub.docker.com/r/manuelrueda/pheno-ranker/tags" target="_blank">https://hub.docker.com/r/manuelrueda/pheno-ranker/tags</a> |
| 31 | + |
| 32 | +**🌐 Web App UI:** <a href="https://pheno-ranker.cnag.eu" target="_blank">https://pheno-ranker.cnag.eu</a> |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +# Pheno-Ranker |
| 37 | + |
| 38 | +`Pheno-Ranker` is a lightweight toolkit for semantic similarity analysis of phenotypic, clinical, and other categorical data serialized as `JSON`, `YAML`, or preprocessed `CSV`. |
| 39 | + |
| 40 | +It supports GA4GH-oriented formats such as Beacon Friendly Format (`BFF`) and Phenotype Exchange Format (`PXF`), but it can also rank and compare generic JSON records beyond the biomedical domain. |
| 41 | + |
| 42 | +## What It Does |
| 43 | + |
| 44 | +`Pheno-Ranker` turns hierarchical records into comparable binary vectors and computes pairwise similarity or distance metrics. |
| 45 | + |
| 46 | +Main workflows: |
| 47 | + |
| 48 | +- **Cohort mode**: compare every individual or record against every other record in one or more cohorts. |
| 49 | +- **Patient mode**: rank records in a reference cohort against a target patient or object. |
| 50 | +- **Generic JSON mode**: compare arbitrary categorical JSON data using a configuration file. |
| 51 | +- **Precomputed mode**: reuse exported reference-cohort vectors for faster repeated patient matching. |
| 52 | + |
| 53 | +## Quick Start |
| 54 | + |
| 55 | +Basic cohort comparison: |
| 56 | + |
| 57 | +```bash |
| 58 | +pheno-ranker -r individuals.json |
| 59 | +``` |
| 60 | + |
| 61 | +Patient matching: |
| 62 | + |
| 63 | +```bash |
| 64 | +pheno-ranker -r individuals.json -t patient.json --max-out 10 |
| 65 | +``` |
| 66 | + |
| 67 | +Generic JSON with a custom configuration: |
| 68 | + |
| 69 | +```bash |
| 70 | +pheno-ranker -r movies.json --config movies_config.yaml --include-terms genre year |
| 71 | +``` |
| 72 | + |
| 73 | +Sparse Matrix Market output for large cohorts: |
| 74 | + |
| 75 | +```bash |
| 76 | +pheno-ranker -r individuals.json --matrix-format mtx -o matrix.mtx |
| 77 | +``` |
| 78 | + |
| 79 | +Cytoscape-compatible graph export with edge filtering: |
| 80 | + |
| 81 | +```bash |
| 82 | +pheno-ranker -r individuals.json --cytoscape-json graph.json --graph-max-weight 10 |
| 83 | +``` |
| 84 | + |
| 85 | +## Selected Features |
| 86 | + |
| 87 | +- Native support for `BFF` and `PXF` JSON/YAML inputs. |
| 88 | +- Generic JSON support through YAML/JSON configuration files. |
| 89 | +- Cohort and patient-ranking modes. |
| 90 | +- Hamming distance and Jaccard similarity. |
| 91 | +- Optional weighted comparisons. |
| 92 | +- Export of intermediate hashes and coverage statistics. |
| 93 | +- Sparse Matrix Market (`mtx`) output for large matrix workflows. |
| 94 | +- Direct Cytoscape-compatible graph export with edge thresholds. |
| 95 | +- QR-code utilities for compact encoded vector exchange. |
| 96 | +- Companion utilities for CSV import and BFF/PXF simulation. |
| 97 | + |
| 98 | +## Output Formats |
| 99 | + |
| 100 | +Common outputs include: |
| 101 | + |
| 102 | +- `matrix.txt`: dense pairwise comparison matrix. |
| 103 | +- `matrix.mtx`: sparse Matrix Market output when `--matrix-format mtx` is used. |
| 104 | +- `rank.txt`: patient-mode ranking output. |
| 105 | +- `graph.json`: Cytoscape-compatible graph output. |
| 106 | +- `graph_stats.txt`: graph summary statistics. |
| 107 | +- `export.*.json`: intermediate files for inspection or precomputed workflows. |
| 108 | + |
| 109 | +## Installation |
| 110 | + |
| 111 | +For CPAN installation: |
| 112 | + |
| 113 | +```bash |
| 114 | +cpanm Pheno::Ranker |
| 115 | +pheno-ranker --help |
| 116 | +``` |
| 117 | + |
| 118 | +For repository-based development: |
| 119 | + |
| 120 | +```bash |
| 121 | +git clone https://github.com/cnag-biomedical-informatics/pheno-ranker.git |
| 122 | +cd pheno-ranker |
| 123 | +cpanm --notest --installdeps . |
| 124 | +bin/pheno-ranker --help |
| 125 | +``` |
| 126 | + |
| 127 | +Docker images are also available from Docker Hub: |
| 128 | + |
| 129 | +```bash |
| 130 | +docker pull manuelrueda/pheno-ranker:latest |
| 131 | +``` |
| 132 | + |
| 133 | +Detailed installation instructions are available in the documentation: |
| 134 | + |
| 135 | +- <https://cnag-biomedical-informatics.github.io/pheno-ranker/download-and-installation/> |
| 136 | +- Non-containerized install: <https://github.com/CNAG-Biomedical-Informatics/pheno-ranker/blob/main/non-containerized/README.md> |
| 137 | +- Docker install: <https://github.com/CNAG-Biomedical-Informatics/pheno-ranker/blob/main/docker/README.md> |
| 138 | + |
| 139 | +## Documentation |
| 140 | + |
| 141 | +Long-form documentation, tutorials, and use cases live in the documentation site: |
| 142 | + |
| 143 | +- [Usage](https://cnag-biomedical-informatics.github.io/pheno-ranker/usage/) |
| 144 | +- [Cohort mode](https://cnag-biomedical-informatics.github.io/pheno-ranker/cohort/) |
| 145 | +- [Patient mode](https://cnag-biomedical-informatics.github.io/pheno-ranker/patient/) |
| 146 | +- [Generic JSON tutorial](https://cnag-biomedical-informatics.github.io/pheno-ranker/generic-json/) |
| 147 | +- [CSV import](https://cnag-biomedical-informatics.github.io/pheno-ranker/csv-import/) |
| 148 | + |
| 149 | +The built-in CLI help remains available: |
| 150 | + |
| 151 | +```bash |
| 152 | +pheno-ranker --help |
| 153 | +``` |
| 154 | + |
| 155 | +`--man` is deprecated and now points to the online usage documentation. |
| 156 | + |
| 157 | +## Citation |
| 158 | + |
| 159 | +If you use `Pheno-Ranker` in published work, please cite: |
| 160 | + |
| 161 | +Leist, I.C. et al. (2024). *Pheno-Ranker: a toolkit for comparison of phenotypic data stored in GA4GH standards and beyond*. BMC Bioinformatics. <https://doi.org/10.1186/s12859-024-05993-2> |
| 162 | + |
| 163 | +## Author |
| 164 | + |
| 165 | +Manuel Rueda, PhD. CNAG: <https://www.cnag.eu> |
0 commit comments