def parse_rna(rna, s2bins, min_rna):
rna_cov = {}<EOL>for seq in parse_fasta(rna):<EOL><INDENT>length = len(seq[<NUM_LIT:1>])<EOL>if length < min_rna:<EOL><INDENT>continue<EOL><DEDENT>s = seq[<NUM_LIT:0>].split('<STR_LIT:>>')[<NUM_LIT:1>].split()[<NUM_LIT:0>]<EOL>if s not in s2bins:<EOL><INDENT>continue<EOL><DEDENT>if s not in rna_cov:<EOL><INDENT>rna_cov[s] = [<NUM_LIT:0>, <NUM_LIT:0>, []]<EOL><DEDENT>position = [int(i) for i in seq[<NUM_LIT:0>].rsplit('<STR_LIT>', <NUM_LIT:1>)[<NUM_LIT:1>].split()[<NUM_LIT:0>].split('<STR_LIT:->')]<EOL>rna_cov[s][<NUM_LIT:2>].append(position)<EOL>rna_cov[s][<NUM_LIT:1>] += length<EOL><DEDENT>return rna_cov<EOL>
parse [16,23]SfromHMM.py output
- rna_cov[scaffold] = [0, 0, []] # [bases, length, ranges]