def simulate(args):
if args.fasta:<EOL><INDENT>name = None<EOL>seq = "<STR_LIT>"<EOL>reads = dict()<EOL>with open(args.fasta) as in_handle:<EOL><INDENT>for line in in_handle:<EOL><INDENT>if line.startswith("<STR_LIT:>>"):<EOL><INDENT>if name:<EOL><INDENT>reads.update(_generate_reads(seq, name))<EOL><DEDENT>seq = "<STR_LIT>"<EOL>name = line[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>seq += line.strip()<EOL><DEDENT><DEDENT><DEDENT>reads.update(_generate_reads(seq, name))<EOL><DEDENT>_write_reads(reads, args.out)<EOL>
Main function that manage simulatin of small RNAs