pombase / canto

The PomBase community curation tool
https://curation.pombase.org
Other
19 stars 7 forks source link

Add OWLTools to Canto Docker image #1648

Closed jseager7 closed 6 years ago

jseager7 commented 6 years ago

(Required for #1636)

The current Docker image can't process annotation extensions since it doesn't have OWLTools installed. Java and OWTools will have to be added to the image, and presumably OWLTools will have to be added to the path so that canto_load.pl can access it.

kimrutherford commented 6 years ago

Hi @jseager7.

I've added a new Docker image that extends pombase/canto-base and added Java and OWLTools.

I've changed the canto_start_docker and canto_docker scripts to use the new image. The owltools command should be in the path when running commands in the container.

So you should be able to run:

  script/canto_docker canto_load.pl --process-extension-config --ontology ...

Let me know how you get on.

jseager7 commented 6 years ago

@kimrutherford I've tested this now, but I can't get it working. The first error was to do with insufficient memory, which I fixed by allocating 2048 MB in the Vagrantfile (I'll push this later).

After that, the ontologies seemed to load with no errors (though there was a warning about a duplicate term in PHIPO, see the end of this comment for details). However, I now get a 500 internal server error after selecting a phenotype term and arriving on the annotation extension page. The Chrome console has this:

angular.js:12265 GET http://localhost:5000//ws/lookup/ontology/PHIPO:0000015?subset_ids=1 500 (Internal Server Error)
angular.js:12265 GET http://localhost:5000//ws/lookup/ontology/PHIPO:0000015?children=1&def=1&subset_ids=1&synonyms=exact 500 (Internal Server Error)
angular.js:12265 GET http://localhost:5000//ws/lookup/ontology/PHIPO:0000015?def=1 500 (Internal Server Error)
angular.js:12265 GET http://localhost:5000//ws/lookup/ontology/PHIPO:0000015?subset_ids=1 500 (Internal Server Error)

And the Canto console has this:

internal error: Caught exception in Canto::Controller::Service->lookup "internal error: looked up PHIPO:0000015 and got more than one result at lib/Canto/Track/OntologyLookup.pm line 503." at lib/Canto/Controller/Root.pm line 53.

Configuration details

Just in case there are any errors in my configuration, I'm copying it out here:

Canto deploy

I've added the following to canto_deploy.yaml, following instructions in the documentation. I assumed the file path should be relative to the Docker container, which is why I'm looking for the import_export directory from the root:

extension_conf_files:
  - /import_export/phipo_extensions.tsv

Extension config TSV

domain ID subset relation extension relation range ID Canto display text Help text cardinality role
PHIPO:0000001 is_a infects_tissue BTO:0000000 host tissue infected (help text) * user

Note that PHIPO:0000001 corresponds to 'pathogen host interaction phenotype' and BTO:0000000 corresponds to 'tissues, cell types and enzyme sources'.

Ontology loading script

Here's the script to load the ontologies (note that some of the ontologies are stored locally, since I was getting intermittent 404 errors on the BRENDA tissue ontology):

./canto/script/canto_docker ./script/canto_load.pl \
--process-extension-config \
--ontology https://raw.githubusercontent.com/pombase/fypo/master/peco.obo \
--ontology https://raw.githubusercontent.com/PHI-base/phipo/b0fdc09ba80b266feb4682f203d396990614df0c/phipo.obo \
--ontology /import_export/BrendaTissue.obo \
--ontology /import_export/phipo_extension_relations.obo

I'm not sure if it's correct to load all of the ontologies with the --process-extension-config flag enabled – I thought that only loading the extension relations ontology would need this flag, but then I remembered the ontology loading process always overwrites the previously loaded ontologies, so surely it's correct to load them all at once?

Extension relation ontology

I tried to keep this as minimal as possible for testing purposes, but I wrote it manually, so it's possible there are some errors in the syntax or logic:

format-version: 1.2
ontology: phipo_extensions
default-namespace: phipo_extensions

[Typedef]
id: infects_tissue
name: infects_tissue
def: "(Detailed definition here)"

Duplicate PHIPO term

Canto warns about this when loading PHIPO. I should open an issue about this on PHI-base/phipo later. Not sure if this is a human error, or if it's related to the ODK.

more than one Term with the name "abnormal sexual spore size" in namespace "pathogen_phenotype" -
existing:
[Term]
id: PHIPO:0000081
name: abnormal sexual spore size
namespace: pathogen_phenotype
relationship: is_a PHIPO:0000127

and:
[Term]
id: PHIPO:0000071
name: abnormal sexual spore size
namespace: pathogen_phenotype
relationship: is_a PHIPO:0000130
kimrutherford commented 6 years ago

looked up PHIPO:0000015 and got more than one result

Could it be that the Canto instance still has the terms from before you changed the namespace of PHIPO? The canto_load.pl script only removes the terms from the namespaces you're about to load.

So it could be that all the terms from disease_formation_phenotype and from pathogen_host_interaction_phenotype are in the database.

The simplest fix is to re-initialise your Canto instance. If that's a pain let me know and we can hack a fix.

I tried to keep this as minimal as possible for testing purposes, but I wrote it manually, so it's possible there are some errors in the syntax or logic:

Looks good to me!

If you ever need to do a quick check to see if a term is in the database you can do this:

sqlite3 local/track.sqlite3 "select * from cvterm where name = 'infects_tissue'"

Canto warns about this when loading PHIPO. I should open an issue about this on PHI-base/phipo later. Not sure if this is a human error, or if it's related to the ODK.

I think it needs fixing in phipo.owl - there are two owl:Class entries with the label "abnormal sexual spore size".

jseager7 commented 6 years ago

The simplest fix is to re-initialise your Canto instance.

This worked, thanks. I've tested making a pathogen-host interaction phenotype annotation on a metagenotype, and the annotation extension seems to work as expected. Here's what the finished annotation looks like:

tissue_extension

@kimrutherford please let me know if there's anything else you'd like me to test, otherwise feel free to close this issue.


I think it needs fixing in phipo.owl - there are two owl:Class entries with the label "abnormal sexual spore size".

I've opened an issue covering this here: https://github.com/PHI-base/phipo/issues/28

kimrutherford commented 6 years ago

Here's what the finished annotation looks like:

Excellent!