Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KGX dropping terms from OBO ontologies (json -> tsv) with no 'name' attribute #352

Open
realmarcin opened this issue Oct 27, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@realmarcin
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Based on KG-Microbe builds there are terms from OBO ontologies (eg ChEBI and GO) which get dropped from the transform step because KGX is rejecting terms with no 'name' attribute.

The message is:
"Skipping line as it does not have a name field: CHEBI 21588 biolink:ChemicalSubstance chebi.json http://purl.obolibrary.org/obo/CHEBI_21588"

Looking at the CHEBI page for this chemical, it does display a name so perhaps there is an issue with parsing obo json?
https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:21588

ChEBI Name N-acetyl-β-D-glucosaminyl-1,3-β-D-galactosyl-1,4-N-acetyl-D-glucosaminyl group

Describe the solution you'd like
Ideally OBO ontologies would have a name for each term, but it looks like this is not a requirement/not enforced at OBOFoundry (or there is a KGX obo json parsing issue?). In the interim, and to be more flexible for inputs, can KGX not require a 'name' attribute, ie maybe just a warning?

@realmarcin realmarcin added the enhancement New feature or request label Oct 27, 2021
@cmungall
Copy link
Contributor

what is the source json file and where did you get it?

is this parsing chebi.json, or an ontology that uses chebi in axiomatization?

@realmarcin
Copy link
Collaborator Author

Good questions, thanks!

So it looks like we are downloading chebi.owl:
http://purl.obolibrary.org/obo/chebi.owl

And then converting to json using ROBOT:
https://github.com/Knowledge-Graph-Hub/kg-microbe/blob/5886197d5fa00ab4c2e6af09dd9f5a3bc453743f/kg_microbe/transform_utils/traits/traits.py#L85

Calling method here:
https://github.com/Knowledge-Graph-Hub/kg-microbe/blob/5886197d5fa00ab4c2e6af09dd9f5a3bc453743f/kg_microbe/utils/robot_utils.py#L27

And here is the line for the downstream transform code starting from 'obojson':
transform(inputs=[data_file], input_format='obojson', output= os.path.join(self.output_dir, name), output_format='tsv')

https://github.com/Knowledge-Graph-Hub/kg-microbe/blob/5886197d5fa00ab4c2e6af09dd9[…]3743f/kg_microbe/transform_utils/ontology/ontology_transform.py

From this import:
from kgx.cli.cli_utils import transform

@sierra-moxon
Copy link
Member

@realmarcin - Is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants