Description Usage Arguments Value Author(s) See Also Examples
View source: R/addpop2string.R
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!
1 | addpop2string(seq, poplist)
|
seq |
|
poplist |
named |
An object of class DNAStringSet
or AAStringSet
Kristian K Ullrich
addmask2string
,
addregion2string
,
addpos2string
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data(iupac, package="distSTRING")
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@metadata$pop.integer
iupac.aa@metadata$pop.names
## 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@metadata$pop.integer
iupac.aa@metadata$pop.names
## 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@metadata$pop.integer
iupac.aa@metadata$pop.names
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.