def run_main(chunk_json, fasta_output, chunk_key): chunks = load_pipeline_chunks_from_json(chunk_json) # Allow looseness if not chunk_key.startswith("$chunk."): chunk_key = "$chunk." + chunk_key log.warn("Prepending chunk key with '$chunk.' to '{c}'".format(c=chunk_key)) fastx_files = get_datum_from_chunks_by_chunk_key(chunks, chunk_key) _ = gather_fasta(fastx_files, fasta_output) return 0
def run_main(chunk_json, fasta_output, chunk_key): chunks = load_pipeline_chunks_from_json(chunk_json) # Allow looseness if not chunk_key.startswith('$chunk.'): chunk_key = '$chunk.' + chunk_key log.warn( "Prepending chunk key with '$chunk.' to '{c}'".format(c=chunk_key)) fastx_files = get_datum_from_chunks_by_chunk_key(chunks, chunk_key) _ = gather_fasta(fastx_files, fasta_output) return 0
def run_main(chunk_json, fofn_output, chunk_key): with cd(os.path.dirname(fofn_output)): chunks = load_pipeline_chunks_from_json(chunk_json) # Allow looseness if not chunk_key.startswith('$chunk.'): chunk_key = '$chunk.' + chunk_key log.warn("Prepending chunk key with '$chunk.' to '{c}'".format(c=chunk_key)) fofn_files = get_datum_from_chunks_by_chunk_key(chunks, chunk_key) print("fofn_files:%s %s" %(repr(fofn_files), repr(fofn_output))) # Combine all into one. with open(fofn_output, 'w') as ofs: for fn in fofn_files: with open(fn) as ifs: ofs.write(ifs.read())