require(TxDb.Mmusculus.UCSC.mm9.knownGene)
require(org.Mm.eg.db)
txdb <- TxDb.Mmusculus.UCSC.mm9.knownGene
isActiveSeq(txdb) <- c(rep(FALSE,18), TRUE, rep(FALSE, length(isActiveSeq(txdb))-19))
# pointing to Pol2 BAM file
# BAM file from the GEO GSM1234478 sample, limited to chr19:3200000-4000000
Pol2bam <- system.file("extdata", "Pol2.bam", package="compEpiTools")
# loading Pol2 peaks as a GRanges object
# built based on the BED file from the GEO GSM1234478 sample
# limited to chr19:3200000-4000000
Pol2GR <- system.file("extdata", "Pol2GR.Rda", package="compEpiTools")
load(Pol2GR)
egs <- distanceFromTSS(Pol2GR, txdb=txdb)
egs <- unique(egs$nearest_gene_id)
SI_matrix <- stallingIndex(BAMlist=list(Pol2bam), peakGRlist=list(Pol2GR),
genesList=list(egs), transcriptDB=txdb, countMode='gene')
plotStallingIndex(SI_matrix)
restoreSeqlevels(txdb)
Run the code above in your browser using DataLab