Permalink
Browse files

Merge pull request #82 from monarch-initiative/58-docker-biolink-update

58 docker biolink update
  • Loading branch information...
2 parents 13770bf + 2f228dd commit 5f033e0c9782e21aae00a2e310822fd83d9a5b88 @cmungall cmungall committed on GitHub Apr 13, 2017
View
@@ -27,14 +27,20 @@ ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
# Define working directory.
WORKDIR /data
ADD owlsim-services/target/owlsim-services-3.0-SNAPSHOT.jar /data/
-ADD configuration-samples/configuration-all.yaml /data/configuration.yaml
+#ADD configuration-samples/configuration-all.yaml /data/configuration.yaml
+ADD scripts/golr-exporter.py /data/golr-exporter.py
+ADD scripts/configuration-generator.py /data/configuration-generator.py
-RUN if [ $species = "human" ]; \
+RUN apt-get -y update && apt-get install python-pip -y
+RUN pip install pyyaml
+
+RUN if [ $species = "all" ]; \
then \
- wget https://data.monarchinitiative.org/owl/all-hp.owl -O /data/all.owl; \
+ cd /data && python golr-exporter.py; \
else \
- wget http://ci.monarchinitiative.org/view/dev/job/create-owlsim-files-on-dev/lastSuccessfulBuild/artifact/server/all.owl -O /data/all.owl; \
+ cd /data && python golr-exporter.py -t $species; \
fi
+RUN cd /data && python configuration-generator.py
CMD java -jar /data/owlsim-services-3.0-SNAPSHOT.jar server /data/configuration.yaml
View
@@ -76,6 +76,7 @@ To restrict to specific species:
```
docker build --build-arg species=all -t owlsim-all . # default if no args is provided or not matching any species
-docker build --build-arg species=human -t owlsim-human
-
+docker build --build-arg species=Hs -t owlsim-human .
+docker build --build-arg species=Hs,Mm -t owlsim-multi .
+# supported species: Hs,Mm,Dr,Dm,Ce
```
@@ -363,8 +363,8 @@ private void setPropertyValues(OWLOntology ont, OWLNamedIndividual i) {
addPropertyValue(pvm, pid, getShortForm(((OWLNamedIndividual) obj).getIRI()));
}
-
- } else if (false) {
+ // TODO check this...
+ } else if (false) {
String pid = getShortForm(((OWLDataProperty) p).getIRI());
OWLLiteral obj = ((OWLDataPropertyAssertionAxiom) paa).getObject();
if (obj instanceof OWLLiteral) {
@@ -33,7 +33,7 @@ public KnowledgeBaseModule(Collection<String> ontologyUris, Collection<String> o
logger.info("Loading curies:");
curies.entrySet().forEach(logger::info);
logger.info("Loading labels:");
- //labels.entrySet().forEach(logger::info);
+ labelTsvs.forEach(logger::info);
//The OwlKnowledgeBase.Loader uses the ELKReasonerFactory and Concurrency.CONCURRENT as defaults.
this.bmKnowledgeBase = OwlKnowledgeBase.loader()
@@ -0,0 +1,41 @@
+#!/usr/bin/python
+
+# grab the curie mapping
+# scan the current directory for the tsvs
+# output an owlsim config file
+
+import yaml
+import urllib2
+import fnmatch
+import os
+
+def main():
+
+ # Getting tsv file path
+ tsvs = []
+ for root, _, filenames in os.walk('.'):
+ for filename in fnmatch.filter(filenames, '*.tsv'):
+ tsvs.append(os.path.abspath(os.path.join(root, filename))) # Check that: it looks insane to get the absolute path...
+
+ dataTsvs = [filename for filename in tsvs if not filename.endswith('label.tsv')]
+ labelTsvs = [filename for filename in tsvs if filename.endswith('label.tsv')]
+
+ # Note: the yaml dump is buggy with the empty string key, so I'm just appending the raw string and add indentation manually
+ curies = urllib2.urlopen("https://raw.githubusercontent.com/monarch-initiative/dipper/master/dipper/curie_map.yaml").read()
+
+ data = dict(
+ ontologyUris = ['http://purl.obolibrary.org/obo/upheno/monarch.owl'],
+ ontologyDataUris = [],
+ dataTsvs = dataTsvs,
+ labelTsvs = labelTsvs
+ )
+
+ print("Generating owlsim configuration")
+ with open('configuration.yaml', 'w') as outfile:
+ yaml.dump(data, outfile, default_flow_style=False)
+ outfile.write("curies:\n")
+ outfile.write(' '.join(curies.splitlines(True)))
+
+
+if __name__ == "__main__":
+ main()
View
@@ -43,7 +43,8 @@ def transformAssociation(input, output):
def main():
- biolink = "http://localhost:5000/api" #mart/labels/gene/phenotype/NCBITaxon%3A7955
+ #biolink = "http://localhost:5000/api" #mart/labels/gene/phenotype/NCBITaxon%3A7955
+ biolink = "https://api.monarchinitiative.org/api"
taxon_map = {
'Hs': 9606,

0 comments on commit 5f033e0

Please sign in to comment.