View source: R/calculateShift.R
calculateShift | R Documentation |
The first step of calculating positional shift over transcriptome regions.
calculateShift(regions, disp, direction = "right", strand = "+")
regions |
A feature set, which should be a GRangesList object. |
disp |
A data frame object. It should have three columns, which are |
direction |
Either to be character "left" or "right", which means the direction to which the starting position is shifting. The former means moving to the direction of 5' while the latter means moving to 3'. |
strand |
Either to be "+" or "-". |
A GRanges
object.
extractRegions
# 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 = "+"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.