Python newby here.
I am developing a simple sequence search program for DNA sequences. The main idea is to get from the NCBI database the different sequences from an specific genome and start-end points. So far, I am able to do a simple search for one genome and one specific position: `
import urllib
genome="NC_009089.1"
start="359055"
end= "359070"
link = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=%s&rettype=fasta&seq_start=%s&seq_stop=%s" % (genome, start, end)
f = urllib.urlopen(link)
myfile = f.read()
print(myfile).splitlines()[1]
`
And this is the output I'm getting (the sequence in that position):
AGTAAAACGGTTTCCT
Now,I would like to find several sequences from different genomes and with different start-end points at the same time, returning all the sequences that were found. I´ve tried to import the data as a csv with the genomes in the first column, starts in the second and ends in the thirds, and then do a for loop with the open file, but since I´m not familiar with changing variables in URLs, I don´t know how to proceed.
Sorry if this is a naive question. Any help would be appreciated.