[Biopython-dev] [Biopython (old issues only) - Bug #2818] (Resolved) Add start and end properties to SeqFeature object
redmine at redmine.open-bio.org
redmine at redmine.open-bio.org
Thu Dec 1 12:16:38 UTC 2016
Issue #2818 has been updated by Peter Cock.
Status changed from New to Resolved
% Done changed from 0 to 100
Resolved with changes to Biopython since, including the new CompoundLocation object for joins, and making the position objects more integer like.
----------------------------------------
Bug #2818: Add start and end properties to SeqFeature object
https://redmine.open-bio.org/issues/2818#change-15388
* Author: Peter Cock
* Status: Resolved
* Priority: Normal
* Assignee: Biopython Dev Mailing List
* Category: Main Distribution
* Target version: Not Applicable
* URL:
----------------------------------------
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
qualifiers:
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]
Seq('ATGGTCACTTTTGAGACAGTTATGGAAATTAAAATCCTGCACAAGCAGGGAATG...TGA', IUPACAmbiguousDNA())
Patch to follow.
---Files--------------------------------
sf_start_end.patch (519 Bytes)
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython-dev/attachments/20161201/739e5ff6/attachment.html>
More information about the Biopython-dev
mailing list