Plot precision of TSS detection from multiple samples (bed files) with respect to a given reference annotation.

Plot precision of TSS detection from multiple samples present within a CapSet object, with respect to a given reference annotation.

plotTSSprecision(reference, detectedTSS, distanceCutoff = 500,
  outFile = NULL, ...)

# S4 method for GRanges,character
plotTSSprecision(reference, detectedTSS,
  distanceCutoff = 500, outFile = NULL, sampleNames)

# S4 method for GRanges,CapSet
plotTSSprecision(reference, detectedTSS,
  distanceCutoff = 500, outFile = NULL, ...)

Arguments

reference

Reference Transcrips/Genes as a GRanges object

detectedTSS

Either a CapSet object with TSS information (after running detectTSS or a character vector with paths to the BED files containing detcted TSSs

distanceCutoff

integer. Maximum distance (in base pairs) from reference TSS to plot

outFile

character. Output file name (filename extention would be used to determine type) If outfile not specified, the plot would be returned on the screen

...

Additional arguments

sampleNames

character. Labels for input samples (in the same order as the input bed files)

Value

A ggplot object, or a file. Plot showing perent of TSS detected per sample with respect to their cumulative distance to TSS of the provided reference

Examples

# load a txdb object library("TxDb.Dmelanogaster.UCSC.dm6.ensGene") seqlevelsStyle(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "ENSEMBL" transcripts <- transcripts(TxDb.Dmelanogaster.UCSC.dm6.ensGene) # Plotting the precision using a pre computed set of TSS (.bed files) : tssfile <- system.file("extdata", "testTSS_merged.bed", package = "icetea") plotTSSprecision(reference = transcripts, detectedTSS = tssfile, sampleNames = "testTSS", distanceCutoff = 500, outFile = "TSS_detection_precision.png")
#> There are 13 regions with distance > 500 bp to the closest TSS. They are all being reduced to 500 bp for the calculation. Samplewise numbers are : 13
#> Saving 10.1 x 5.6 in image
## Plotting the precision using a CapSet object : library("TxDb.Dmelanogaster.UCSC.dm6.ensGene") seqlevelsStyle(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "ENSEMBL" # only use chrX to make the analysis faster seqlevels(TxDb.Dmelanogaster.UCSC.dm6.ensGene) <- "X" transcripts <- transcripts(TxDb.Dmelanogaster.UCSC.dm6.ensGene) # load a previously saved CapSet object cs <- exampleCSobject()
#> Checking de-multiplexed R1 reads
#> Checking de-multiplexed R2 reads
#> Checking mapped file
#> Checking de-duplicated file
# plot plotTSSprecision(reference = transcripts, detectedTSS = cs, outFile = "TSS_detection_precision.png")
#> There are 0 regions with distance > 500 bp to the closest TSS. They are all being reduced to 500 bp for the calculation. Samplewise numbers are :
#> Saving 10.1 x 5.6 in image