Commit 773f6a44 authored by Koehorst, Jasper's avatar Koehorst, Jasper
Browse files

parallel added

parent d362d5b3
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)
Markdown is supported
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