Commit 7c26b01a authored by Martin Preusse's avatar Martin Preusse
Browse files

parameterized obo ontologies

parent 8a1a6202
Pipeline #916 passed with stage
in 1 minute and 7 seconds
......@@ -9,6 +9,7 @@ services:
- REMOTE_URL=${REMOTE_URL}
- REMOTE_USER=${REMOTE_USER}
- REMOTE_PASSWORD=${REMOTE_PASSWORD}
- OBO_ONTOLOGIES=${OBO_ONTOLOGIES}
volumes:
- type: bind
source: ${DOWNLOAD_PATH}
......
import json
import logging
import os
import py2neo
from time import sleep
import logging
from py2neo.wiring import WireError
import json
from datetime import datetime
from multiprocessing import Pool
from graphpipeline.parser import ParserSet
import py2neo
from biomedgraph.datasources import OboFoundry, GeneOntology
from biomedgraph.parser import OboFoundryParser, GeneOntologyAssociationParser
from graphpipeline.parser import ParserSet
from py2neo.wiring import WireError
logging.basicConfig(level=logging.INFO)
logging.getLogger('biomedgraph').setLevel(level=logging.DEBUG)
......@@ -20,18 +18,19 @@ log.setLevel(level=logging.DEBUG)
ROOT_DIR = os.getenv('ROOT_DIR', '/download')
RUN_MODE = os.getenv('RUN_MODE', 'test')
OBO_ONTOLOGIES = os.getenv('OBO_ONTOLOGIES')
# TODO replace with ENV vars and change pipeline file
REMOTE_URL = "ftp://u261019-sub1.your-storagebox.de/download"
REMOTE_USER = "u261019-sub1"
REMOTE_PASSWORD = "YMnBAIPBer09jJJN"
log.info([REMOTE_URL, REMOTE_USER, REMOTE_PASSWORD])
log.info(OBO_ONTOLOGIES)
NEO4J_CONFIG_STRING = os.getenv("NEO4J")
log.info(NEO4J_CONFIG_STRING)
NEO4J_CONFIG_DICT = json.loads(NEO4J_CONFIG_STRING)
log.info(f'dict {NEO4J_CONFIG_DICT}')
if __name__ == '__main__':
......@@ -63,11 +62,12 @@ if __name__ == '__main__':
geneontology_local = geneontology.latest_local_instance(taxids=['9606', '10090'])
parserset = ParserSet()
for ontology_abbreviation in ['go', 'doid', 'mp', 'pato']:
log.info("Add Ontology Parsers")
for obo_abbreviation in OBO_ONTOLOGIES.split(','):
log.info(f"Add {obo_abbreviation}")
go_parser = OboFoundryParser()
go_parser.datasource_instances.append(obofoundry_local)
go_parser.ontology_name = ontology_abbreviation
go_parser.ontology_name = obo_abbreviation
parserset.add(go_parser)
for taxid in ['9606', '10090']:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment