Description Usage Arguments Value Examples
View source: R/sampleSequence.R
A function used to extract the regions of a query sequence mapped to user defined sub-regions of the genome.
1 2 3 4 5 6 7 8 |
motif |
a character string indicating the query sequence or motifs; Rules in |
region |
the |
sequence |
the |
N |
number of ranges sampled, by default, it returns all the ranges without sampling. |
fixed |
FALSE to support the vague mapping rule of the chagracter string, default is FALSE. |
replace |
whether sample with replacement or not, default is FALSE. |
a GRanges
object contains the (sampled) mapped regions of the query sequence on the defined subset of the genome.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Retrieve the sequence "CG" on a defined exonic region
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(BSgenome.Hsapiens.UCSC.hg19)
exons_gr <- GRanges(c("chr1","chr2","chr2"),
IRanges(start=c(11874,38814,45440),
end=c(12227,41627,46588)),
strand=c("+","-","-"))
CpG_regions <- sampleSequence("GG", exons_gr, Hsapiens)
## Not run:
## Sample 100000 ranges of RRACH motif on all exonic regions of hg19:
exons_hg19 <- exons(TxDb.Hsapiens.UCSC.hg19.knownGene)
Motif_exons_hg19 <- sampleSequence("RRACH", exons_hg19, Hsapiens, N = 100000)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.