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)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(compEpiTools)
Loading required package: topGO
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: graph
Loading required package: Biobase
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: SparseM
Attaching package: 'SparseM'
The following object is masked from 'package:base':
backsolve
groupGOTerms: GOBPTerm, GOMFTerm, GOCCTerm environments built.
Attaching package: 'topGO'
The following object is masked from 'package:IRanges':
members
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/compEpiTools/plotStallingIndex.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotStallingIndex
> ### Title: Stalling Index plots
> ### Aliases: plotStallingIndex
>
> ### ** Examples
>
> require(TxDb.Mmusculus.UCSC.mm9.knownGene)
Loading required package: TxDb.Mmusculus.UCSC.mm9.knownGene
Loading required package: GenomicFeatures
Attaching package: 'GenomicFeatures'
The following object is masked from 'package:topGO':
genes
> require(org.Mm.eg.db)
Loading required package: 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)
'select()' returned 1:1 mapping between keys and columns
> egs <- unique(egs$nearest_gene_id)
> SI_matrix <- stallingIndex(BAMlist=list(Pol2bam), peakGRlist=list(Pol2GR),
+ genesList=list(egs), transcriptDB=txdb, countMode='gene')
factor-Rle of length 5 with 1 run
Lengths: 5
Values : +
Levels(3): + - *
logical-Rle of length 5 with 1 run
Lengths: 5
Values : TRUE
> plotStallingIndex(SI_matrix)
> restoreSeqlevels(txdb)
TxDb object:
# Db type: TxDb
# Supporting package: GenomicFeatures
# Data source: UCSC
# Genome: mm9
# Organism: Mus musculus
# Taxonomy ID: 10090
# UCSC Table: knownGene
# Resource URL: http://genome.ucsc.edu/
# Type of Gene ID: Entrez Gene ID
# Full dataset: yes
# miRBase build ID: NA
# transcript_nrow: 55419
# exon_nrow: 246570
# cds_nrow: 213117
# Db created by: GenomicFeatures package from Bioconductor
# Creation time: 2015-10-07 18:13:02 +0000 (Wed, 07 Oct 2015)
# GenomicFeatures version at creation time: 1.21.30
# RSQLite version at creation time: 1.0.0
# DBSCHEMAVERSION: 1.1
>
>
>
>
>
> dev.off()
null device
1
>