View source: R/addpop2string.R
addpop2string | R Documentation |
This function adds population information to a
DNAStringSet
or an AAStringSet
and puts them into the
metadata
information.
__Note__: All unassigned sequences will be put into pop "unassigned"!
Do not use "unassigned" as a population name!
__Note__: Names in a population in the poplist must match sequence names!
__Note__: Duplicated assignments are allowed!
addpop2string(seq, poplist)
seq |
|
poplist |
named |
An object of class DNAStringSet
or AAStringSet
Kristian K Ullrich
addmask2string
,
addregion2string
,
addpos2string
## load example sequence data
data(iupac, package="MSA2dist")
iupac.aa <- iupac |> cds2aa(shorten = TRUE)
## create poplist
poplist <- list(FRA = grep("Mmd.FRA", names(iupac)),
GER = grep("Mmd.GER", names(iupac)),
IRA = grep("Mmd.IRA", names(iupac)),
AFG = grep("Mmm.AFG", names(iupac)))
iupac.aa <- iupac.aa |> addpop2string(poplist)
#(iupac.aa |> slot("metadata"))$pop.integer
iupac.aa |> popinteger()
#(iupac.aa |> slot("metadata"))$pop.names
iupac.aa |> popnames()
## mxixing index and names
poplist <- list(FRA = names(iupac)[grep("Mmd.FRA", names(iupac))],
GER = grep("Mmd.GER", names(iupac)),
IRA = names(iupac)[grep("Mmd.IRA", names(iupac))],
AFG = grep("Mmm.AFG", names(iupac)))
iupac.aa <- iupac.aa |> addpop2string(poplist)
iupac.aa |> popinteger()
iupac.aa |> popnames()
## leaving out some sequences which will be assigned as "unassigned"
poplist <- list(FRA = names(iupac)[grep("Mmd.FRA", names(iupac))],
GER = grep("Mmd.GER", names(iupac)),
IRA = names(iupac)[grep("Mmd.IRA", names(iupac))])
iupac.aa <- iupac.aa |> addpop2string(poplist)
iupac.aa |> popinteger()
iupac.aa |> popnames()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.