View source: R/extractRegions.R
extractRegions | R Documentation |
This function receives three arguments: the scope region set, the target region set and the type of strand. It returns a subset of target region set, which is the intersection of the target region set and the scope region set.
extractRegions(regions_A, R, strand = "+")
regions_A |
The scope region set. A |
R |
The target region set. A |
strand |
The strand type of the transcripts. It has options "+" and "-". |
A GRangesList
object.
calculateShift
# Take five transcripts.
# Extract the last 200 nt regions from their CDS part.
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
trans.id.pstv <- c("170", "782", "974", "1364", "1387")
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
# download the CDS part of all transcriptome
cds.tx0 <- cdsBy(txdb, use.names = FALSE)
# pick the CDS part of these five transcripts
cds.p <- cds.tx0[trans.id.pstv]
width <- 200
disp.p.l <- data.frame(
start = as.numeric(max(end(cds.p))),
distance = width - 1,
names = trans.id.pstv
)
R.p.l <- calculateShift(regions = cds.p, disp = disp.p.l, direction = "left", strand = "+")
R.cds.last200 <- extractRegions(regions_A = cds.p, R = R.p.l, strand = "+")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.