count_reads.py
def parseAnnotation(record, fields=None, delimiter=default_delimiter):
    """
    Extracts annotations from a FASTA/FASTQ sequence description

    Arguments:
      record : Description string to extract annotations from
      fields : List of fields to subset the return dictionary to;
               if None return all fields
      delimiter : a tuple of delimiters for (fields, values, value lists)

    Returns:
      OrderedDict : An OrderedDict of field/value pairs
    """
    annotation = record.split(delimiter[0])
    field_dict = OrderedDict([('ID', annotation.pop(0))])
    for ann in annotation:
        vals = ann.split(delimiter[1])
        field_dict[vals[0].upper()] = vals[1]

    # Subset return dictionary to requested fields
    if fields is not None:
        if not isinstance(fields, list):  fields = [fields]
        for f in set(field_dict).difference(fields):  del field_dict[f]

    return field_dict

    Extracts annotations from a FASTA/FASTQ sequence description

    Arguments:
      record : Description string to extract annotations from
      fields : List of fields to subset the return dictionary to;
               if None return all fields
      delimiter : a tuple of delimiters for (fields, values, value lists)

    Returns:
      OrderedDict : An OrderedDict of field/value pairs
    
Extracts annotations from a FASTA/FASTQ sequence description
Extracts annotations from a FASTA / FASTQ sequence description
def parseAnnotation(record, fields=None, delimiter=default_delimiter):
    annotation = record.split(delimiter[0])
    field_dict = OrderedDict([('ID', annotation.pop(0))])
    for ann in annotation:
        vals = ann.split(delimiter[1])
        field_dict[vals[0].upper()] = vals[1]
    if fields is not None:
        if not isinstance(fields, list):  fields = [fields]
        for f in set(field_dict).difference(fields):  del field_dict[f]
    return field_dict
def parseAnnotation ( record , fields = None , delimiter = default_delimiter ) : annotation = record . split ( delimiter [ 0 ] ) field_dict = OrderedDict ( [ ( 'ID' , annotation . pop ( 0 ) ) ] ) for ann in annotation : vals = ann . split ( delimiter [ 1 ] ) field_dict [ vals [ 0 ] . upper ( ) ] = vals [ 1 ] if fields is not None : if not isinstance ( fields , list ) : fields = [ fields ] for f in set ( field_dict ) . difference ( fields ) : del field_dict [ f ] return field_dict
Extracts annotations from a FASTA/FASTQ sequence description
Extracts annotations from a FASTA / FASTQ sequence description
"""
    Extracts annotations from a FASTA/FASTQ sequence description

    Arguments:
      record : Description string to extract annotations from
      fields : List of fields to subset the return dictionary to;
               if None return all fields
      delimiter : a tuple of delimiters for (fields, values, value lists)

    Returns:
      OrderedDict : An OrderedDict of field/value pairs
    """ # Subset return dictionary to requested fields
OrderedDict : An OrderedDict of field/value pairs
OrderedDict : An OrderedDict of field / value pairs
record
fields
delimiter
record 
Description string to extract annotations from
Description string to extract annotations from
fields 
List of fields to subset the return dictionary to;
if None return all fields
List of fields to subset the return dictionary to ; if None return all fields
delimiter 
a tuple of delimiters for (fields, values, value lists)
a tuple of delimiters for ( fields values value lists )