Python newby here.
I was wondering if there is a way of getting the sequence of a genome from NCBI giving a point of start and end. For instance, I'm working with this genome ID (NC_011375.1) and I would like to obtain the sequence that is between 259882 and 259896 bases. So far, I have this:
from Bio import Entrez from Bio import SeqIO Entrez.email = "firstname.lastname@example.org" handle = Entrez.efetch(db="nuccore", id="NC_011375.1", rettype="gb", retmode="text") whole_sequence = SeqIO.read(handle, "genbank") print whole_sequence[259882:259896]
And this is the output I get:
ID: NC_011375.1 Name: NC_011375 Description: Streptococcus pyogenes NZ131, complete genome. Number of features: 0 UnknownSeq(14, alphabet = IUPACAmbiguousDNA(), character = 'N')
As you can see, it´s not working. Since I don´t know how to proceed, any help would be appreciated.
Thank you in advance.