plot PCA or heatmap for multiple bamfiles. The correlation is calculated by the counts in promoter regions.

plotCorrelation(
  objs,
  txs,
  seqlev = intersect(seqlevels(objs[[1]]), seqlevels(txs)),
  upstream = 2000,
  downstream = 500,
  type = c("heatmap", "PCA"),
  ...
)

Arguments

objs

an object of GAlignmentsList

txs

GRanges of transcripts

seqlev

A vector of characters indicates the sequence levels.

upstream

numeric(1) or integer(1). Start position of promoter. Default is 2000

downstream

numeric(1) or integer(1). End position of promoter. Default is 500

type

Figure type, heatmap or PCA plot.

...

parameters could be passed to downstream functions such as plot for pca or heatmap for heatmap.

Value

A invisible object of GRanges with counts

Details

The correlation will be calculated by the correlation of insertion sites within promoter regions. Even the sequencing is paired-end, please treat it as single ends.

Author

Jianhong Ou

Examples

#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#> #> Attaching package: 'matrixStats'
#> The following objects are masked from 'package:Biobase': #> #> anyMissing, rowMedians
#> #> Attaching package: 'MatrixGenerics'
#> The following objects are masked from 'package:matrixStats': #> #> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, #> colCounts, colCummaxs, colCummins, colCumprods, colCumsums, #> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, #> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, #> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, #> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, #> colWeightedMeans, colWeightedMedians, colWeightedSds, #> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, #> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, #> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, #> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, #> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, #> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, #> rowWeightedMads, rowWeightedMeans, rowWeightedMedians, #> rowWeightedSds, rowWeightedVars
#> The following object is masked from 'package:Biobase': #> #> rowMedians
#> Loading required package: Rsamtools
path <- system.file("extdata", package="ATACseqQC", mustWork=TRUE) bamfiles <- dir(path, "*.bam$", full.name=TRUE) gals <- lapply(bamfiles, function(bamfile){ readBamFile(bamFile=bamfile, tag=character(0), which=GRanges("chr1", IRanges(1, 1e6)), asMates=FALSE) }) library(TxDb.Hsapiens.UCSC.hg19.knownGene) txs <- transcripts(TxDb.Hsapiens.UCSC.hg19.knownGene) plotCorrelation(GAlignmentsList(gals), txs, seqlev="chr1")