count_reads.py
def count_tab(infile, count_unit='reads', derep_field=None):
    ''' when wc -l won't do because the reads are dereplicated '''
    if count_unit == 'reads' and derep_field:
        count = sum( int(parse_usearch_header(line)[derep_field]) for line in infile)
    else:
        count = sum( 1 for line in infile)
    # TODO add in ID dereplication ? 
    return count, count_unit
 when wc -l won't do because the reads are dereplicated 
when wc -l won't do because the reads are dereplicated
when wc - l won ' t do because the reads are dereplicated
def count_tab(infile, count_unit='reads', derep_field=None):
    if count_unit == 'reads' and derep_field:
        count = sum( int(parse_usearch_header(line)[derep_field]) for line in infile)
    else:
        count = sum( 1 for line in infile)
    return count, count_unit
def count_tab ( infile , count_unit = 'reads' , derep_field = None ) : if count_unit == 'reads' and derep_field : count = sum ( int ( parse_usearch_header ( line ) [ derep_field ] ) for line in infile ) else : count = sum ( 1 for line in infile ) return count , count_unit
when wc -l won't do because the reads are dereplicated
when wc - l won ' t do because the reads are dereplicated
''' when wc -l won't do because the reads are dereplicated ''' # TODO add in ID dereplication ? 
infile
count_unit
derep_field