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

Remove role GCIs from biochebi output #287

Open
balhoff opened this issue Oct 21, 2019 · 5 comments
Open

Remove role GCIs from biochebi output #287

balhoff opened this issue Oct 21, 2019 · 5 comments
Assignees

Comments

@balhoff
Copy link
Member

balhoff commented Oct 21, 2019

See geneontology/go-ontology#17911 (comment)

@balhoff balhoff self-assigned this Oct 21, 2019
@balhoff
Copy link
Member Author

balhoff commented Oct 24, 2019

How this works:

  • the command runner loads an OWL ontology embedded as a resource inside owltools, and passes it to BioChebiGenerator:
    @CLIMethod("--create-biochebi")
    public void createBioChebi(Opts opts) throws Exception {
    final String chebiPURL = "http://purl.obolibrary.org/obo/chebi.owl";
    String chebiFile = null;
    String output = null;
    String ignoredSubset = "no_conj_equiv";
    while (opts.hasOpts()) {
    if (opts.nextEq("-o|--output")) {
    output = opts.nextOpt();
    }
    else if (opts.nextEq("-c|--chebi-file")) {
    chebiFile = opts.nextOpt();
    }
    else if (opts.nextEq("-i|--ignored-subset")) {
    ignoredSubset = opts.nextOpt();
    }
    else {
    break;
    }
    }
    if (chebiFile != null) {
    File inputFile = new File(chebiFile);
    OWLOntology chebiOWL = pw.parse(IRI.create(inputFile).toString());
    // sanity check:
    // check that the purl is the expected one
    boolean hasOntologyId = false;
    OWLOntologyID ontologyID = chebiOWL.getOntologyID();
    if (ontologyID != null) {
    Optional<IRI> ontologyIRI = ontologyID.getOntologyIRI();
    if (ontologyIRI.isPresent()) {
    hasOntologyId = chebiPURL.equals(ontologyIRI.get().toString());
    }
    }
    if (hasOntologyId == false) {
    throw new RuntimeException("The loaded ontology file ("+chebiFile+") does not have the expected ChEBI purl: "+chebiPURL);
    }
    }
    if (g == null) {
    // load default template
    InputStream stream = loadResource("bio-chebi-input.owl");
    if (stream == null) {
    throw new RuntimeException("Could not load default bio chebi input file: 'bio-chebi-input.owl'");
    }
    g = new OWLGraphWrapper(pw.getManager().loadOntologyFromOntologyDocument(stream));
    }
    BioChebiGenerator.createBioChebi(g, ignoredSubset);
    if (output != null) {
    OWLOntology ontology = g.getSourceOntology();
    File outFile = new File(output);
    ontology.getOWLOntologyManager().saveOntology(ontology, IRI.create(outFile));
    }
    }
  • the embedded ontology imports both ChEBI and also an ontology http://purl.obolibrary.org/obo/go/extensions/substance_by_role.owl, which is actually served from the GO release imports folder and magically found by a line in the GO build catalog file: https://github.com/geneontology/go-ontology/blob/2fe891866790048684448260baca4fbe2d53e057/src/ontology/catalog-v001.xml#L9
  • substance_by_role.owl defines GOCHE terms which have logical definitions making a chemical entity for each role
  • BioChebiGenerator does the rest of the work creating GCIs for conjugate acid/base

Not sure how substance_by_role.owl was originally created.

@balhoff
Copy link
Member Author

balhoff commented Oct 24, 2019

@cmungall is the solution for the immediate problem to simply completely remove the import of substance_by_role.owl?

@balhoff
Copy link
Member Author

balhoff commented Oct 24, 2019

This will leave all these substance terms without labels. Perhaps instead we need a version of this file with logical definitions removed?

@vanaukenk
Copy link

From 2019-10-28 ontology editors call:

@balhoff will create a branch with the substance_by_role.owl removed to see what effects this might have on inferences.

@balhoff
Copy link
Member Author

balhoff commented May 19, 2020

Not sure how substance_by_role.owl was originally created.

Update: substance_by_role.owl is made by the GO ontology makefile:

https://github.com/geneontology/go-ontology/blob/7cabd1f10d2599d5ad8ae2833bc3fad0837e07c6/src/ontology/Makefile#L471-L487

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

No branches or pull requests

2 participants