Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DZDConnectPipeline
dataloading_ontologies
Commits
7c26b01a
Commit
7c26b01a
authored
May 13, 2021
by
Martin Preusse
Browse files
parameterized obo ontologies
parent
8a1a6202
Pipeline
#916
passed with stage
in 1 minute and 7 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
docker-compose.yml
View file @
7c26b01a
...
...
@@ -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}
...
...
main.py
View file @
7c26b01a
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
=
o
ntology
_abbreviation
go_parser
.
ontology_name
=
o
bo
_abbreviation
parserset
.
add
(
go_parser
)
for
taxid
in
[
'9606'
,
'10090'
]:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment