def check_fasta_seqs_lens(input_fasta_fp):
 seq_lens = defaultdict(int)
 input_fasta_f = open(input_fasta_fp, 'U')
 for (label, seq) in parse_fasta(input_fasta_f):
  seq_lens[len(seq)] += 1
 input_fasta_f.close()
 formatted_seq_lens = []
 for curr_key in seq_lens:
  formatted_seq_lens.append((seq_lens[curr_key], curr_key))
 formatted_seq_lens.sort(reverse=True)
 return formatted_seq_lens

def check_fasta_seqs_lens ( input_fasta_fp ) : seq_lens = defaultdict ( int ) input_fasta_f = open ( input_fasta_fp , 'U' ) for ( label , seq ) in parse_fasta ( input_fasta_f ) : seq_lens [ len ( seq ) ] += 1 input_fasta_f . close ( ) formatted_seq_lens = [ ] for curr_key in seq_lens : formatted_seq_lens . append ( ( seq_lens [ curr_key ] , curr_key ) ) formatted_seq_lens . sort ( reverse = True ) return formatted_seq_lens
creates bins of sequence lens useful for checking for valid aligned sequences .