How detect complement reverse sequence in a EMBL/Genbank file with biopython?
1
0
Entering edit mode
9.7 years ago
uguy • 0

Hi,

I'm trying to parse GenBank file and extract the genes sequences, but I didn't find how to detect the complement sequences. I tried regex by searching "complenent" in "feature.location" but that didn't work.

If you are some ideas you're welcome :)

genome • 2.4k views
ADD COMMENT
2
Entering edit mode
9.7 years ago
Peter 6.0k

Each feature object has a .strand (actually an alias for the feature's location's strand, .location.strand), e.g.

from Bio import SeqIO
for record in SeqIO.parse(filename, "embl"):
    print(record.id)
    for feature in record.features:
        print(feature.strand)
        print(feature.extract(record.seq))

The last line of the example shows how to get the sequence associated with the feature.

See also the SeqFeature built in documentation, also available at http://biopython.org/DIST/docs/api/Bio.SeqFeature-module.html

As explained there and in the Biopython Tutorial http://biopython.org/DIST/docs/tutorial/Tutorial.html the .strand will be -1 for features on the complement strand.

ADD COMMENT
0
Entering edit mode

Thanks a lot, that's what I need, and this tutorial is very hepfull too.

ADD REPLY

Login before adding your answer.

Traffic: 1988 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6