BioPython's SeqRecord class, but expanded with additional methods: degenerate seqs, codon positions based on reading frames, etc.
Project description
seqrecord-expanded
BioPython’s SeqRecord class, but expanded with additional methods: degenerate seqs, codon positions based on reading frames, etc.
Usage
By default it assumes a DNA sequence with ambiguous characters.
>>> from seqrecord_expanded import SeqRecordExpanded
>>> seq_record = SeqRecordExpanded('ATGCTARCRATARAAC',
... voucher_code='CP100-09',
... taxonomy={'genus': 'Melitaea',
... 'species': 'phoebe',
... },
... gene_code='EF1a',
... reading_frame=2,
... table=1, # translation table
... )
>>> # Degenerate sequence
>>> seq_record.degenerate('S')
... PLRDOI
>>>
>>> # get first codon positions
>>> seq_record.first_codon_position()
... TTCTA
>>>
>>> # get first and second positions
>>> seq_record.first_and_second_positions()
... TGTACRTAAA
>>>
>>> # translate
>>> seq_record.translate()
... OKPDOR
Installation
pip install seqrecord-expanded
Requirements
BioPython:
pip install -r requirements.txt
Compatibility
Licence
BSD.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.