Created
January 14, 2019 09:37
-
-
Save DomBennett/c80b3021396c5bb1880605f23ba36fac to your computer and use it in GitHub Desktop.
Getting extra sequence information for a phylotaR sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(phylotaR) | |
data("yeasts") | |
# not all info is stored on the seq object | |
str(yeasts@sqs@sqs[[1]]) | |
# but the accession can be used to download extra info | |
accssn <- yeasts@sqs@sqs[[1]]@id | |
library(rentrez) | |
smmry_obj <- entrez_summary(db = 'nucleotide', id = accssn) | |
str(smmry_obj) | |
# e.g. getting country | |
subtypes <- strsplit(smmry_obj[['subtype']], split = '\\|')[[1]] | |
subnames <- strsplit(smmry_obj[['subname']], split = '\\|')[[1]] | |
(subnames[subtypes == 'country']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment