Basic functions for genomic sequence manipulation
Example use-cases
Create a sequence
import seq_toolkit
sequence = seq_toolkit.Seq()
sequence.simulate(n_bases=250, return_seq=True)
'GTTCAACTTTAACCAGCGGTTATGCTCTTCCATGTGAGTCGTAGTCGGGTTCGCACGAAAGAATTATTTATTGCTGCGATACGCAATGCATCTGGTTGTGGAGTTTCACCAGGCAGGCAATTAGTCCTATGCGGAACCTGCTGCTATAAAACGCATAAATTAACTGGCACACCAGGGAGGTAAGGGATGAGAGGCCTACAAGATTCCCATGTGCATATGGAGGGCGTACTGGATTCACGCGTTCGGAGGC'
Simulate a gene
import seq_toolkit
gene = seq_toolkit.Gene()
gene.create(n_exons=8, return_gene=False)
gene.plot()
- For more on ene simulation, see the following: example notebook
Manipulate a sequence
import seq_toolkit
seq = 'CGGGTTCGCACGAAAGAATTATTTATTGCTGCGATACGCAATGCATCTGGTTGTGGAGTTTCACCAGGCAGGCAATTAGTCCTATGCGGAACCTGCTGCTATAAAACGCAT'
sequence = seq_toolkit.SequenceManipulator(seq)
sequence.reverse_complement()
'ATGCGTTTTATAGCAGCAGGTTCCGCATAGGACTAATTGCCTGCCTGGTGAAACTCCACAACCAGATGCATTGCGTATCGCAGCAATAAATAATTCTTTCGTGCGAACCCG'
Installation
pip install seq-toolkit
To install the development version:
git clone https://github.com/mvinyard/seq-toolkit.git
cd ./seq-toolkit/; pip install -e .
Notes
For questions, please send an email to mvinyard@broadinstitute.org or open an issue.