Skip to content

Instantly share code, notes, and snippets.

View ramongallego's full-sized avatar

ramongallego

View GitHub Profile
@ramongallego
ramongallego / Format_NCBI_4_Kraken2.sh
Created April 9, 2024 15:42
kraken2 db from NCBI db
# First download to your computer the right database from NCBI. You can either go to https://ftp.ncbi.nlm.nih.gov/blast/db/
# and download the right db, or if it is a multi-file one run
# perl <path/to/ncbi/bin>/update_blastdb.pl --decompress <name_of_db>
# I would recommend having one db per folder, as it might rewrite the taxdb.btd/bti files
######
#
## Once you have the downloaded db, the next thing is to extract the FASTA from the dbs
# I am sure once there is a downloaded db, there is an easy way of generating the krakendb, but here we are
@ramongallego
ramongallego / Query_gb_and_trim.r
Last active January 17, 2020 21:14
An R script to query genbank using org name and locus.
library(tidyverse)
library(insect)
library(rentrez)
set_entrez_key (YOUR_KEY_HERE)
library(here)
worlds.taxonomy <- read_rds(here("data", "all.taxonomy.rds"))
# make your own taxonomy db using the command
# worlds.taxonomy <- taxonomy(), then save it for later use
library(tidyverse)
library(gganimate)
library(ggmap)
library(viridis)
library(lubridate)
# We need three things: The data to plot, the map and the location of the samples
# For me, the data looked like a long table with five columns: Site, Date, Species, prevalence and abundance