Skip to content

Instantly share code, notes, and snippets.

library("reutils")
# NB: to grab FASTA of accession number x, do this:
#
# f <- content(efetch(x, db="nuccore", rettype="fasta", retmode="text"))
#
# Result is a string, with \n separators.
grab.results <- function (term) {
# Search for the given term on nuccore. This gives us a list of
@anusha026
anusha026 / fasta.R
Last active November 20, 2015 04:28
Download FASTA sequences from GenBank
# Download FASTA sequences from GenBank
# Copyright (C) 2015 Anusha Beer <anbeer29@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@anusha026
anusha026 / ExcelConvert.py
Created November 20, 2015 04:27
Convert CSV into Excel with highlighting
# Convert CSV into Excel with highlighting
# Copyright (C) 2015 Anusha Beer <anbeer29@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@anusha026
anusha026 / scrapegenbank.R
Created October 30, 2015 23:19
R script to fetch Genbank accession numbers of sequences of interest for specific species
# Genbank scraping functions
# Copyright (C) 2015 Anusha Beer <anbeer29@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR