Skip to content

Instantly share code, notes, and snippets.

View jmberros's full-sized avatar
🎯
Focusing

Juan Manuel Berros jmberros

🎯
Focusing
  • Buenos Aires, Argentina
View GitHub Profile
@jmberros
jmberros / country_from_nuccore_accessions.py
Last active August 25, 2023 06:13
Get the country field for the given nuccore accession numbers.
from Bio import Entrez
# Read the accessions from a file
accessions_file = 'accessions.txt'
with open(accessions_file) as f:
ids = f.read().split('\n')
# Fetch the entries from Entrez
Entrez.email = 'name@example.org' # Insert your email here
handle = Entrez.efetch('nuccore', id=ids, retmode='xml')
@jmberros
jmberros / read_args_from_command_line.py
Last active November 23, 2016 02:07
Read arguments from command line
from sys import argv
def main(arg1, arg2):
# Your logic here
pass
if __name__ == '__main__':
main(argv[1], argv[2])
@jmberros
jmberros / tax_ids_to_name_and_lineage.py
Last active November 23, 2016 01:42
Get Taxa scientific name and lineage from Entrez
from Bio import Entrez
taxids_filename = '/tmp/taxids.list' # Replace with the path to your Tax IDs file!
with open(taxids_filename) as f:
tax_ids = f.read().split('\n')
Entrez.email = 'user@example.org' # Put your email here
handle = Entrez.efetch('taxonomy', id=tax_ids, rettype='xml')
response = Entrez.read(handle)
<iframe src='/widget/#{current_client.slug}' style='height: #{height}px; width: 300px;' scrolling='no'></iframe>" %>