Creating a loop within Entrez to add data to a data base
0
1
Entering edit mode
4.6 years ago

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 • 624 views
ADD COMMENT
1
Entering edit mode

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.
ADD REPLY

Login before adding your answer.

Traffic: 2620 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