https://github.com/monarch-initiative/phenotype2phenopacket
Phenotype2Phenopacket is a command-line tool that converts a phenotype annotation into GA4GH Phenopackets, facilitating standardised phenotypic data representation.
https://github.com/monarch-initiative/phenotype2phenopacket
monarchinitiative phenopackets phenotypes
Last synced: 7 months ago
JSON representation
Phenotype2Phenopacket is a command-line tool that converts a phenotype annotation into GA4GH Phenopackets, facilitating standardised phenotypic data representation.
- Host: GitHub
- URL: https://github.com/monarch-initiative/phenotype2phenopacket
- Owner: monarch-initiative
- Created: 2023-04-19T11:21:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-30T13:51:48.000Z (11 months ago)
- Last Synced: 2025-06-30T14:45:12.271Z (11 months ago)
- Topics: monarchinitiative, phenopackets, phenotypes
- Language: Python
- Homepage:
- Size: 4.31 MB
- Stars: 2
- Watchers: 6
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Phenotype2Phenopacket
_Phenotype2Phenopacket_ is a command-line interface (CLI) application for the construction of phenopackets
from a phenotype annotation file.
## Installation
Phenotype2Phenopacket can be installed from PyPi.
```shell
pip install phenotype2phenopacket
```
## Usages
To convert all OMIM diseases in a phenotype annotation file to disease phenopackets, where all phenotypes are retained:
```shell
p2p convert --phenotype-annotation /path/to/phenotype.hpoa --output-dir /path/to/output-dir
```
To convert all OMIM diseases in a phenotype annotation file to lightweight disease phenopackets (without phenotypic features):
```shell
p2p convert --phenotype-annotation /path/to/phenotype.hpoa --output-dir /path/to/output-dir --skip-phenotypic-features
```
To create synthetic patient disease phenopackets, where the dataset is more variable and frequencies are taken
into account and constrained noise is applied :
```shell
p2p create --phenotype-annotation /path/to/phenotype.hpoa --output-dir /path/to/output-dir
```
You can also limit the number of disease phenopackets converted/created:
```shell
p2p convert --phenotype-annotation /path/to/phenotype.hpoa --output-dir /path/to/output-dir --num-diseases 100
```
Or limit for a specific OMIM disease:
```shell
p2p create --phenotype-annotation /path/to/phenotype.hpoa --output-dir /path/to/output-dir --omim-id OMIM:619340
```
Or limit for a list of OMIM IDs specified in a text file, with each ID separated by a new line:
```shell
p2p create --phenotype-annotation /path/to/phenotype.hpoa --output-dir /path/to/output-dir --omim-id-list /path/to/list.txt
```
To add known gene-to-phenotype relationships to phenopackets:
```shell
p2p add-genes --phenopacket-dir /path/to/synthetic-phenopackets --genes-to-disease /path/to/genes_to_disease.txt --hgnc-data /path/to/hgnc_complete_set.txt --output-dir /path/to/output-dir
```
> **_NOTE:_** To add known gene-to-phenotype the genes_to_disease.txt is expected. It can be downloaded [here](https://hpo.jax.org/data/annotations).