4 May 2012 00:46
[Biopython] How to use SeqRecord to get the subseq location information
Liu, XiaoChuan <xiaochuan.liu <at> mssm.edu>
2012-05-03 22:46:58 GMT
2012-05-03 22:46:58 GMT
Dear all,
I face a problem: How to use SeqRecord to get the subseq location information?
My code is like this:
>>> from Bio.Seq import Seq
>>> simple_seq = Seq("gugggaagagggguggggcccgggacuguacccaugugaggacuauucuugaguccugcucuuguucugagcaccaccccucucucaga")
>>> from Bio.SeqRecord import SeqRecord
>>> from Bio.SeqFeature import SeqFeature, FeatureLocation
>>> example_feature = SeqFeature(FeatureLocation(25382494, 25382583), type="mRNA", strand=-1)
>>> simple_seq_r = SeqRecord(simple_seq, id="17_329.4",features=[example_feature])
>>> simple_seq_r
SeqRecord(seq=Seq('gugggaagagggguggggcccgggacuguacccaugugaggacuauucuugagu...aga',
Alphabet()), id='17_329.4', name='<unknown name>', description='<unknown description>', dbxrefs=[])
>>> simple_seq_r.features
[SeqFeature(FeatureLocation(ExactPosition(25382494),ExactPosition(25382583)), type='mRNA', strand=-1)]
>>> simple_seq_r.features[0]
SeqFeature(FeatureLocation(ExactPosition(25382494),ExactPosition(25382583)), type='mRNA', strand=-1)
>>> subseq=simple_seq_r[3:10]
(Continue reading)
RSS Feed