Description Usage Arguments Details Value See Also Examples
View source: R/sequenceDerivedFeatures.R
A function to extract sequence features from the input GRanges
object and the BSgenome
object.
1 | sequenceDerivedFeatures(x, sequence, encoding = c("onehot", "iRNA"))
|
x |
A GRanges object for the genomic ranges to be annotated, the |
sequence |
A BSgenome or XStringSet object for the genome sequence. |
encoding |
Can be one of the following:
|
The function first extract sequence within the genomic ranges defined by x
.
Then, the sequences are processed according to the selected encoding method.
A data.frame
object whose number of rows is the length of x
, and the number of columns is 4 times the width of x
.
The column types in the data.frame
are all numeric.
The genomeDerivedFeatures for extraction of genome-derived features.
The topologyOnTranscripts for calculation of the meta-tx topologies on transcripts of genes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(BSgenome.Hsapiens.UCSC.hg19)
## Define the Granges to be annotated:
set.seed(01)
X <- GRanges(rep(c("chr1", "chr2"), c(15, 15)),
IRanges(c(sample(11874:12127, 15), sample(38814:41527,15)), width=5),
strand=Rle(c("+", "-"), c(15, 15)))
## Extract onehot encoded sequence features
seq_onehot <- sequenceDerivedFeatures(X, Hsapiens, encoding = "onehot")
str(seq_onehot)
## Extract iRNA encoded sequence features
seq_iRNA <- sequenceDerivedFeatures(X, Hsapiens, encoding = "iRNA")
str(seq_iRNA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.