bx.motif.io.transfac module
Classes for reading and writing motif data.
- class bx.motif.io.transfac.TransfacReader(input)
Bases:
object
Reads motifs in TRANSFAC format.
- as_dict(key='id')
Return a dictionary containing all remaining motifs, using key as the dictionary key.
- next_motif()
- parse_actions = {'AC': ('store_single', 'accession'), 'AT': ('store_single_key_value', 'attributes'), 'BA': ('store_block', 'basis'), 'BF': ('store_single_list', 'binding_factors'), 'BS': ('store_single_list', 'sites'), 'CC': ('store_block', 'comment'), 'DE': ('store_block', 'description'), 'DT': ('store_single_list', 'dates'), 'ID': ('store_single', 'id'), 'NA': ('store_single', 'name'), 'P0': ('store_matrix', 'matrix'), 'TY': ('store_single', 'type')}
- parse_record(lines)
Parse a TRANSFAC record out of lines and return a motif.
- class bx.motif.io.transfac.TransfacWriter(output)
Bases:
object
Writes motifs in TRANSFAC format.
- actions = {'AC': ('store_single', 'accession'), 'AT': ('store_single_key_value', 'attributes'), 'BA': ('store_block', 'basis'), 'BF': ('store_single_list', 'binding_factors'), 'BS': ('store_single_list', 'sites'), 'CC': ('store_block', 'comment'), 'DE': ('store_block', 'description'), 'DT': ('store_single_list', 'dates'), 'ID': ('store_single', 'id'), 'NA': ('store_single', 'name'), 'P0': ('store_matrix', 'matrix'), 'TY': ('store_single', 'type')}
- write(motif)