This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Creating a loop within Entrez to add data to a data base

Hey all, I have I am pretty new to python and bioinformatics in general and I had a quick question. So basically I want to run a DB fetch with Entrez.efetch and put it into a designated table in a data base I created with SQLite3. I was wondering if there was any possible way to run a for loop within the Entrez.efetch so I can pull the example genbank file/sequence file and put it into my database. Any tips would be helpful, thanks!

bio.entrez python sqlite3

What exactly is it you want to loop? Different queries?

I don't think there's any reason you shouldn't be able to do something like:

for query in list_of_queries:
    # do entrez.efetch(query, stuff)
    # do SQL stuff
    sleep(3)    #    You'll probably need to include a loop delay of a second or so to avoid service polling limits.

0 answers

No answers yet.

Log in to answer this question.