def crossmap(fas, reads, options, no_shrink, keepDB, threads, cluster, nodes):
if cluster is True:<EOL><INDENT>threads = '<STR_LIT>'<EOL><DEDENT>btc = []<EOL>for fa in fas:<EOL><INDENT>btd = bowtiedb(fa, keepDB)<EOL>F, R, U = reads<EOL>if F is not False:<EOL><INDENT>if U is False:<EOL><INDENT>u = False<EOL><DEDENT>for i, f in enumerate(F):<EOL><INDENT>r = R[i]<EOL>if U is not False:<EOL><INDENT>u = U[i]<EOL><DEDENT>sam = '<STR_LIT>' % (os.getcwd(),fa.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>], f.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>].rsplit('<STR_LIT:.>', <NUM_LIT:3>)[<NUM_LIT:0>])<EOL>btc.append(bowtie(sam, btd, f, r, u, options, no_shrink, threads))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>f = False<EOL>r = False<EOL>for u in U:<EOL><INDENT>sam = '<STR_LIT>' % (os.getcwd(),fa.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>], u.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>].rsplit('<STR_LIT:.>', <NUM_LIT:3>)[<NUM_LIT:0>])<EOL>btc.append(bowtie(sam, btd, f, r, u, options, no_shrink, threads))<EOL><DEDENT><DEDENT><DEDENT>if cluster is False:<EOL><INDENT>for i in btc:<EOL><INDENT>p = subprocess.Popen(i, shell = True)<EOL>p.communicate()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ID = '<STR_LIT>'.join(random.choice([str(i) for i in range(<NUM_LIT:0>, <NUM_LIT:9>)]) for _ in range(<NUM_LIT:5>))<EOL>for node, commands in enumerate(chunks(btc, nodes), <NUM_LIT:1>):<EOL><INDENT>bs = open('<STR_LIT>' % (os.getcwd(), ID, node), '<STR_LIT:w>')<EOL>print('<STR_LIT:\n>'.join(commands), file=bs)<EOL>bs.close()<EOL>p = subprocess.Popen('<STR_LIT>'% (bs.name),shell = True)<EOL>p.communicate()<EOL><DEDENT><DEDENT>
map all read sets against all fasta files