def get_dup_labels_perc(fasta_labels):
 fasta_labels_count = float(len(fasta_labels))
 fasta_labels_derep = float(len(set(fasta_labels)))
 perc_dup = ('%1.3f' % ((fasta_labels_count - fasta_labels_derep) / fasta_labels_count))
 label_counts = defaultdict(int)
 for curr_label in fasta_labels:
  label_counts[curr_label] += 1
 labels_from_dups = []
 for label in label_counts:
  if (label_counts[label] > 1):
   labels_from_dups.append(label)
 return (perc_dup, labels_from_dups)

def get_dup_labels_perc ( fasta_labels ) : fasta_labels_count = float ( len ( fasta_labels ) ) fasta_labels_derep = float ( len ( set ( fasta_labels ) ) ) perc_dup = ( '%1.3f' % ( ( fasta_labels_count - fasta_labels_derep ) / fasta_labels_count ) ) label_counts = defaultdict ( int ) for curr_label in fasta_labels : label_counts [ curr_label ] += 1 labels_from_dups = [ ] for label in label_counts : if ( label_counts [ label ] > 1 ) : labels_from_dups . append ( label ) return ( perc_dup , labels_from_dups )
calculates percentage of sequences with duplicate labels fasta_labels: list of fasta labels .