Hello, i'd like to slice multiple genbank files using biopython at different location:
slice genome 1 at location 1. I have already coded this :
>>> ident = 'AE009948','AE009947'
>>> coor = '1256617:1311411','1973169:2005648'
>>> for i in ident:
from Bio import Entrez, SeqIO
Entrez.email = "[email protected]"
handle = Entrez.efetch(db="nucleotide", id=i, rettype="gb")
record = SeqIO.read(handle, "gb")
>>> for j in coor:
sub_record = record[j]
Problem is : i get this error : ValueError: Invalid index
or TypeError: 'SeqRecord' object is not callable if i try with : sub_record = record(j)
Can someone help me?
Thanks by advance
slice genome 1 at location 1. I have already coded this :
>>> ident = 'AE009948','AE009947'
>>> coor = '1256617:1311411','1973169:2005648'
>>> for i in ident:
from Bio import Entrez, SeqIO
Entrez.email = "[email protected]"
handle = Entrez.efetch(db="nucleotide", id=i, rettype="gb")
record = SeqIO.read(handle, "gb")
>>> for j in coor:
sub_record = record[j]
Problem is : i get this error : ValueError: Invalid index
or TypeError: 'SeqRecord' object is not callable if i try with : sub_record = record(j)
Can someone help me?
Thanks by advance
Comment