Skip to content

Instantly share code, notes, and snippets.

@chasemc
Created June 18, 2019 17:16
Show Gist options
  • Save chasemc/9e142870ff96b7978351c500c3d5db75 to your computer and use it in GitHub Desktop.
Save chasemc/9e142870ff96b7978351c500c3d5db75 to your computer and use it in GitHub Desktop.
Get genbank from strain database ID using R
gene <- "16S ribosomal RNA[product]"
a <- "ATCC 10762=ATCC 23884=CBS 434.51=DSM 40127=IFO 12594=IFO 12843=IMET 43577=ISP 5127=JCM 4008=JCM 4624=Lederle A-377=LL A-377=NCIB 8234=NRRL 2209=RIA 1129=Waksman 3550A=WC 3550"
a <- strsplit(a, "=")[[1]]
b <- glue::glue("{a}[All Fields]", sep=" ")
b <- paste0(b, collapse = " OR ")
d <- glue::glue(b, " AND {gene}")
e <- rentrez::entrez_search(db="nuccore", term=d, retmax=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment