monarch-initiative / genophenocorr

Genotype Phenotype Correlation
https://monarch-initiative.github.io/genophenocorr/stable
MIT License
4 stars 1 forks source link

Python implementation of phenopackets #2

Closed pnrobinson closed 10 months ago

pnrobinson commented 1 year ago

See https://pypi.org/project/phenopackets

Use this tool to extract list of HPO terms from phenopacket

lnrekerle commented 1 year ago

I was able to get a phenopacket for nemaline myopathy in Python, but the retinol blastoma is having errors. @pnrobinson @ielis

pnrobinson commented 1 year ago

Can you post the code and the errors?

lnrekerle commented 1 year ago

The code is pushed, here is the error I get when I try to parse the retinol blastoma json:

ParseError: Failed to parse interpretations field: Failed to parse diagnosis field: Failed to parse genomicInterpretations field: Failed to parse variationDescriptor field: Failed to parse extensions field: Failed to parse value field: repeated field value must be in [] which is 40.0%.......

pnrobinson commented 1 year ago

The error seems to be coming from this:

'extensions': [{'name': 'mosaicism', 'value': '40.0%'}]

@ielis @iimpulse any idea what this might be?

ielis commented 1 year ago

I suspect this may be due to lag between the latest Python phenopacket-schema code and Java code. The retinoblastoma message was generated using phenopacket-schema v2.0.2. However, we only have v2.0.0 for Python.

For the most part, the difference between v2.0.2 and v2.0.0 are Java-specific; we added module-info.java to v2.0.2, to make the library modular in the Java 9+ world. However, there is one commit that also affects .proto file, and, therefore, can lead to message incompatibility: the commit f7195093 from May 11, 2022 where Jules fixed an incorrect use of protobuf's Any field. This may lead to error when parsing a message created by Java v2.0.2 using Python v2.0.0.

This can likely be fixed by deploying v2.0.2 to PyPi.

lnrekerle commented 1 year ago

This issue has been resolved, so I believe this task is done. I have been able to get many different phenopackets in python with no error.

@pnrobinson