[Biopython-dev] [Biopython - Bug #2818] Add start and end properties to SeqFeature object

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Fri Sep 16 16:45:50 UTC 2011

Issue #2818 has been updated by Peter Cock.

See also this proposal:
Bug #2818: Add start and end properties to SeqFeature object

Author: Peter Cock
Status: New
Priority: Normal
Assignee: Biopython Dev Mailing List
Category: Main Distribution
Target version: Not Applicable

An enhancment proposed on the mailing list would add start and end properties to the SeqFeature returning plain integers (non-fuzzy approximations to the start and end locations) suitable for slicing most parent sequences.  Dealing with a join location would still be tricky.

Example usage:

>>> from Bio import SeqIO
>>> record = SeqIO.read(open("NC_005816.gb"),"gb")
>>> feature = record.features[2]
>>> print feature
type: gene
location: [86:1109]
ref: None:None
strand: 1
	Key: db_xref, Value: ['GeneID:2767718']
	Key: locus_tag, Value: ['YP_pPCP01']

>>> record[feature.start:feature.end]
SeqRecord(seq=Seq('ATGGTCACTTTTGAGACAGTTATGGAAATTAAAATCCTGCACAAGCAGGGAATG...TGA', IUPACAmbiguousDNA()), id='NC_005816.1', name='NC_005816', description='Yersinia pestis biovar Microtus str. 91001 plasmid pPCP1, complete sequence.', dbxrefs=[])
>>> record.seq[feature.start:feature.end]

Patch to follow.

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org

More information about the Biopython-dev mailing list