question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combine acc2gb.py and fetchseq.py, putting db and rettype as arguments

See original GitHub issue

The scripts acc2gb.py and fetchseq.py do essentially the same thing: they use the Entrez system to download data from NCBI.

We can combine them into a single, multi-purpose script by removing some of the hard-coded parameters and making them command line arguments. We’ll keep the acc2gb.py script and delete fetchseq.py since it has fewer calls and @aays knows what they are.

These are the changes that need to be made:

  • Remove hardcoded db parameter on line 22 and make it a command line argument
  • Remove hardcoded rettype parameter on line 33 and make it a command line argument
  • Add parameter retmode="text" on line 33, same as in fetchseq.py.
  • Include in the documentation what ‘db’ and ‘rettype’ mean and which arguments would be used in which situations. For now, these are the two we’ve been using:
  • Case 1: rettype = gbwithparts, db = nuccore - downloads genbank file with metadata and fasta DNA sequence (i.e. for downloading bacterial genomes with metadata)
  • Case 2: rettype = fasta, db = protein - downloads fasta file with protein sequence (i.e. for downloading antiCRISPR protein sequences for BLAST)
  • Delete fetchseq.py.

Submit a PR to the master branch when complete! If you have any questions at all, ping me or @aays and we’ll get back to you ASAP.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
morrmecommented, Apr 18, 2017

@mbonsma @aays ready for review 😃

1reaction
mbonsmacommented, Apr 18, 2017

@morrme true, good point. We can leave that one out then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found