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
UNLOCK
MGnify
Commits
773f6a44
Commit
773f6a44
authored
Jun 07, 2021
by
Koehorst, Jasper
Browse files
parallel added
parent
d362d5b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
run.py
View file @
773f6a44
from
joblib
import
Parallel
,
delayed
import
multiprocessing
import
os
import
sys
import
shlex
...
...
@@ -62,12 +64,22 @@ def eggnog(identifier):
print
(
command
)
os
.
system
(
command
)
def
conversion_stage
(
identifier
):
conversion
(
identifier
)
interproscan
(
identifier
)
eggnog
(
identifier
)
if
__name__
==
"__main__"
:
identifiers
=
set
()
for
line
in
open
(
"identifiers.tsv"
):
if
"MGYG"
not
in
line
:
continue
identifier
=
line
.
strip
().
split
(
"
\t
"
)[
1
]
accession
=
line
.
strip
().
split
(
"
\t
"
)[
2
]
if
(
identifier
.
startswith
(
"MGYG"
)):
retrieval
(
identifier
,
accession
)
conversion
(
identifier
)
interproscan
(
identifier
)
eggnog
(
identifier
)
identifiers
.
add
(
identifier
)
# Number of cores
num_cores
=
3
# multiprocessing.cpu_count()
results
=
Parallel
(
n_jobs
=
num_cores
)(
delayed
(
conversion_stage
)(
identifier
)
for
identifier
in
identifiers
)
Write
Preview
Markdown
is supported
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