View source: R/string2region.R
string2region | R Documentation |
This function subsets a DNAStringSet
or an
AAStringSet
by a mask
and region
given one or both
options as IRanges
.
string2region(seq, mask = NULL, region = NULL, add = TRUE)
seq |
|
mask |
|
region |
|
add |
indicate if mask and region should be added to |
A list
object with the following components:
DNAStringSet
or AAStringSet
regionUsed
Kristian K Ullrich
dnastring2dist
## load example sequence data
data("hiv", package="MSA2dist")
## create mask
mask1 <- IRanges::IRanges(start=c(11,41,71), end=c(20,50,80))
## use mask
hiv.region <- hiv |> cds2aa() |> string2region(mask=mask1)
#(hiv.region |> slot("metadata"))$regionUsed
hiv.region |> regionused()
## use region
region1 <- IRanges::IRanges(start=c(1,75), end=c(45,85))
hiv.region <- hiv |> cds2aa() |> string2region(region=region1)
#(hiv.region |> slot("metadata"))$regionUsed
hiv.region |> regionused()
## use mask and region
hiv.region <- hiv |> cds2aa() |> string2region(mask=mask1, region=region1)
#(hiv.region |> slot("metadata"))$regionUsed
hiv.region |> regionused()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.