| Title: | TSS sequencing data analysis |
|---|---|
| Description: | TSSr package provides a comprehensive workflow on TSS data starts from identification of accurate TSS locations, clustering TSSs within small genomic regions corresponding to core promoters, and transcriptional activity quantifications, as well as specialized downstream analyses including core promoter shape, cluster annotation, gene differential expression, core promoter shift. TSSr can take multiple formats of files as input, such as Binary Sequence Alignment Map (BAM) files (single-ended or paired-ended), Browser Extension Data (bed) files, BigWig files, ctss files or tss tables. TSSr also generates various types of TSS or core promoter track files which can be visualized in the UCSC Genome Browser or Integrative Genomics Viewer (IGV). TSSr also exports downstream analyses result tables and plots. Multiple cores are supported on Linux or Mac platforms. |
| Authors: | Zhaolian Lu [aut, com] (ORCID: <https://orcid.org/0000-0001-5002-7007>), Keenan Berry [aut, com], Zhenbin Hu [aut, ctb], Yu Zhan [aut, ctb], Tae-Hyuk (Ted) Ahn [aut, cph], Zhenguo Lin [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-8400-9138>), National Science Foundation [fnd] (NSF 1951332) |
| Maintainer: | Zhenguo Lin <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.21 |
| Built: | 2026-09-24 00:03:02 UTC |
| Source: | https://github.com/bioc/TSSr |
Annotates clusters with gene or transcript names from GFF annotation file.
annotateCluster(object,clusters = "consensusClusters",filterCluster = TRUE , filterClusterThreshold = 0.02, annotationType = "genes",upstream=1000 , upstreamOverlap = 500,downstream = 0) ## S4 method for signature 'TSSr' annotateCluster( object, clusters = "consensusClusters", filterCluster = TRUE, filterClusterThreshold = 0.02, annotationType = "genes", upstream = 1000, upstreamOverlap = 500, downstream = 0 )annotateCluster(object,clusters = "consensusClusters",filterCluster = TRUE , filterClusterThreshold = 0.02, annotationType = "genes",upstream=1000 , upstreamOverlap = 500,downstream = 0) ## S4 method for signature 'TSSr' annotateCluster( object, clusters = "consensusClusters", filterCluster = TRUE, filterClusterThreshold = 0.02, annotationType = "genes", upstream = 1000, upstreamOverlap = 500, downstream = 0 )
object |
A TSSr object containing the selected cluster tables and
either a populated |
clusters |
Clusters to be annotated: "consensusClusters" or "tagClusters". Default is "consensusClusters". |
filterCluster |
Logical indicating whether clusters downstream of a highly expressed cluster are filtered. Setting filterCluster as "TRUE" would reduce weak clusters brought from recapping, transcriptional or sequencing noise. Default is TRUE. |
filterClusterThreshold |
Ignore downstream clusters if signal < filterClusterThreshold*the strongest clusters within the same gene promoter region. Default value = 0.02. |
annotationType |
Specify annotation feature to be associated with: "genes" or "transcripts". Default is "genes". |
upstream |
Upstream distance to the start position of annotation feature. Default value = 1000. |
upstreamOverlap |
Upstream distance to the start position of annotation feature if overlapped with the upstream neighboring feature. Default value = 500. |
downstream |
Downstream distance to the start position of annotation feature. Default value = 0. Note: if annotationType == "transctipt" or the gene annotations start from transcription start sites (TSSs), the recommended value = 500. |
A modified TSSr object with updated assignedClusters,
unassignedClusters, and optionally filteredClusters slots.
The input object is not modified; assign the returned object to retain
the changes.
data(exampleTSSr) exampleTSSr <- annotateCluster( exampleTSSr, clusters = "consensusClusters", filterCluster = TRUE ) head(assignedClusters(exampleTSSr, sample = "control"))data(exampleTSSr) exampleTSSr <- annotateCluster( exampleTSSr, clusters = "consensusClusters", filterCluster = TRUE ) head(assignedClusters(exampleTSSr, sample = "control"))
Calculates enhancer candidates, which are characterized by bidirectional clusters as described in Andersson et al. 2014.
callEnhancer(object, flanking = 400, dis2gene = 2000) ## S4 method for signature 'TSSr' callEnhancer(object, flanking = 400, dis2gene = 2000)callEnhancer(object, flanking = 400, dis2gene = 2000) ## S4 method for signature 'TSSr' callEnhancer(object, flanking = 400, dis2gene = 2000)
object |
A TSSr object. |
flanking |
The flanking region range where bidirectional clusters composing a enhancer candidate. Default is 400. |
dis2gene |
The minimum distance to the main annotated core promoter of genes. Default is 2000. |
A modified TSSr object with updated enhancers slot. The
input object is not modified; assign the returned object to retain the
changes.
data(exampleTSSr) exampleTSSr <- callEnhancer(exampleTSSr) head(enhancers(exampleTSSr, sample = "control"))data(exampleTSSr) exampleTSSr <- callEnhancer(exampleTSSr) head(enhancers(exampleTSSr, sample = "control"))
Clusters TSSs within small genomic regions into tag clusters (TCs) using "peakclu" method. "peakclu" method is an implementation of peak-based clustering. The minimum distance of two neighboring peaks can be specified.
clusterTSS(object, method = "peakclu", peakDistance=100,extensionDistance=30 , localThreshold = 0.02,clusterThreshold = 1, useMultiCore=FALSE, numCores=NULL) ## S4 method for signature 'TSSr' clusterTSS( object, method = "peakclu", peakDistance = 100, extensionDistance = 30, localThreshold = 0.02, clusterThreshold = 1, useMultiCore = FALSE, numCores = NULL )clusterTSS(object, method = "peakclu", peakDistance=100,extensionDistance=30 , localThreshold = 0.02,clusterThreshold = 1, useMultiCore=FALSE, numCores=NULL) ## S4 method for signature 'TSSr' clusterTSS( object, method = "peakclu", peakDistance = 100, extensionDistance = 30, localThreshold = 0.02, clusterThreshold = 1, useMultiCore = FALSE, numCores = NULL )
object |
A TSSr object |
method |
Clustering method to be used for clustering: "peakclu". Default is "peakclu". |
peakDistance |
Minimum distance of two neighboring peaks. Default value = 100. |
extensionDistance |
Maximal distance between peak and its neighboring TSS or two neighboring TSSs to be grouped in the same cluster. Default value = 30. |
localThreshold |
Ignore downstream TSSs with signal < localThreshold*peak within clusters, which is used to filter TSS signals brought from possible recapping events, or sequencing noise. Default value = 0.02. |
clusterThreshold |
Ignore clusters if signal < clusterThreshold. Default value = 1. |
useMultiCore |
Logical indicating whether multiple cores are used (TRUE) or not (FALSE). Default is FALSE. |
numCores |
Number of cores are used in clustering step. Used only if useMultiCore = TRUE. Default is NULL. |
A modified TSSr object with updated tagClusters slot. The
input object is not modified; assign the returned object to retain the
changes.
example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS( example_object, method = "peakclu", clusterThreshold = 1, useMultiCore = FALSE ) head(tagClusters(example_object, sample = "control"))example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS( example_object, method = "peakclu", clusterThreshold = 1, useMultiCore = FALSE ) head(tagClusters(example_object, sample = "control"))
Makes consensus clusters from multiple samples in TSSr object and calculates inter-quantile positions within consensus clusters for each sample.
consensusCluster(object, dis = 50 , useMultiCore=FALSE, numCores = NULL) ## S4 method for signature 'TSSr' consensusCluster(object, dis = 50, useMultiCore = FALSE, numCores = NULL)consensusCluster(object, dis = 50 , useMultiCore=FALSE, numCores = NULL) ## S4 method for signature 'TSSr' consensusCluster(object, dis = 50, useMultiCore = FALSE, numCores = NULL)
object |
A TSSr object. |
dis |
Minimum distance between two peaks to be aggregated together into the same consensus cluster. |
useMultiCore |
Logical indicating whether multiple cores are used (TRUE) or not (FALSE). Default is FALSE. |
numCores |
Number of cores are used in clustering step. Used only if useMultiCore = TRUE. Default is NULL. |
A modified TSSr object with updated consensusClusters
slot. The input object is not modified; assign the returned object to
retain the changes.
example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS(example_object, useMultiCore = FALSE) example_object <- consensusCluster( example_object, useMultiCore = FALSE ) head(consensusClusters(example_object, sample = "control"))example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS(example_object, useMultiCore = FALSE) example_object <- consensusCluster( example_object, useMultiCore = FALSE ) head(consensusClusters(example_object, sample = "control"))
Analyzes gene-level differential expression using DESeq2 method (Love et al., 2014).
deGene(object,comparePairs=list(c("control","treat")), pval = 0.01, useMultiCore=FALSE, numCores = NULL, fitType = "parametric") ## S4 method for signature 'TSSr' deGene( object, comparePairs = list(c("control", "treat")), pval = 0.01, useMultiCore = FALSE, numCores = NULL, fitType = "parametric" )deGene(object,comparePairs=list(c("control","treat")), pval = 0.01, useMultiCore=FALSE, numCores = NULL, fitType = "parametric") ## S4 method for signature 'TSSr' deGene( object, comparePairs = list(c("control", "treat")), pval = 0.01, useMultiCore = FALSE, numCores = NULL, fitType = "parametric" )
object |
A TSSr object. |
comparePairs |
Specified list of sample pairs for comparison with DESeq2 method. |
pval |
Genes with an adjusted p value below |
useMultiCore |
Logical indicating whether multiple cores are used (TRUE) or not (FALSE). Default is FALSE. |
numCores |
Number of cores are used in clustering step. Used only if useMultiCore = TRUE. Default is NULL. |
fitType |
Dispersion trend fitting method passed to
|
Requires the suggested package DESeq2.
A modified TSSr object with updated DEtables and
TAGtables slots. The input object is not modified; assign the
returned object to retain the changes.
data(exampleTSSr) exampleTSSr <- deGene( exampleTSSr, comparePairs = list(c("control", "treat")), pval = 0.01, useMultiCore = FALSE, fitType = "mean" ) head(DEtables( exampleTSSr, comparison = "control_VS_treat", result = "all" ))data(exampleTSSr) exampleTSSr <- deGene( exampleTSSr, comparePairs = list(c("control", "treat")), pval = 0.01, useMultiCore = FALSE, fitType = "mean" ) head(DEtables( exampleTSSr, comparison = "control_VS_treat", result = "all" ))
A pre-processed TSSr object containing a subset of the CAGE dataset from Lu and Lin, Genome Research 2019 Jul;29(7):1198-1210.
data(exampleTSSr)data(exampleTSSr)
An S4 object of class TSSr containing:
BSgenome reference name
An empty character vector because source BAM files are not bundled
The original input type, retained as provenance
Sample identifiers
Raw TSS count matrix
Processed TSS count matrix
An empty character vector; no machine-specific GFF path is stored
The bundled chromosome-I reference annotation
This example object contains TSS data that has already been processed
through the TSSr workflow. The original BAM files are not included, so its
inputFiles and refSource slots are empty and getTSS()
cannot be called on this object. The inputFilesType = "bam" value is
retained only as provenance, and the bundled annotation is stored in
refTable.
However, all downstream analysis functions (such as mergeSamples,
normalizeTSS, filterTSS, clusterTSS, etc.) can be
used with this object.
https://genome.cshlp.org/content/29/7/1198.short
data(exampleTSSr) exampleTSSrdata(exampleTSSr) exampleTSSr
Export cluster tables to text files.
exportClustersTable(object, data = "assigned") ## S4 method for signature 'TSSr' exportClustersTable(object, data = "assigned")exportClustersTable(object, data = "assigned") ## S4 method for signature 'TSSr' exportClustersTable(object, data = "assigned")
object |
A TSSr object. |
data |
Specify which cluster data will be exported: "tagClusters", "consensusClusters", "assigned", "unassigned". Default is "assigned". |
cluster tables
data(exampleTSSr) oldwd <- setwd(tempdir()) exportClustersTable(exampleTSSr, data = "tagClusters") setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportClustersTable(exampleTSSr, data = "tagClusters") setwd(oldwd)
Creates bed files of clusters.
exportClustersToBed(object, data = "consensusClusters", assigned = TRUE) ## S4 method for signature 'TSSr' exportClustersToBed(object, data = "consensusClusters", assigned = TRUE)exportClustersToBed(object, data = "consensusClusters", assigned = TRUE) ## S4 method for signature 'TSSr' exportClustersToBed(object, data = "consensusClusters", assigned = TRUE)
object |
A TSSr object. |
data |
Specify which data will be exported: "tagClusters" or "consensusClusters". Default is "consensusClusters". |
assigned |
Specify which consensus clusters will be exported. Used only if data = "consensusClusters. Default is TRUE. |
bed files of clusters
example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS(example_object, useMultiCore = FALSE) oldwd <- setwd(tempdir()) exportClustersToBed(example_object, data = "tagClusters") setwd(oldwd)example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS(example_object, useMultiCore = FALSE) oldwd <- setwd(tempdir()) exportClustersToBed(example_object, data = "tagClusters") setwd(oldwd)
Exports gene differential expression results table to text files.
exportDETable(object, data = "sig") ## S4 method for signature 'TSSr' exportDETable(object, data = "sig")exportDETable(object, data = "sig") ## S4 method for signature 'TSSr' exportDETable(object, data = "sig")
object |
A TSSr object. |
data |
Specify which data will be exported: "all" or "sig". |
gene differential expression tables
data(exampleTSSr) oldwd <- setwd(tempdir()) exportDETable(exampleTSSr, data = "sig") setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportDETable(exampleTSSr, data = "sig") setwd(oldwd)
Exports enhancer tables to text files.
exportEnhancerTable(object) ## S4 method for signature 'TSSr' exportEnhancerTable(object)exportEnhancerTable(object) ## S4 method for signature 'TSSr' exportEnhancerTable(object)
object |
A TSSr object. |
enhancer candidate tables
data(exampleTSSr) oldwd <- setwd(tempdir()) exportEnhancerTable(exampleTSSr) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportEnhancerTable(exampleTSSr) setwd(oldwd)
Exports core promoter shape score tables to text files. Shape score is calculated with shapeCluster(object) method.
exportShapeTable(object) ## S4 method for signature 'TSSr' exportShapeTable(object)exportShapeTable(object) ## S4 method for signature 'TSSr' exportShapeTable(object)
object |
A TSSr object. |
core promoter shape score tables
data(exampleTSSr) oldwd <- setwd(tempdir()) exportShapeTable(exampleTSSr) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportShapeTable(exampleTSSr) setwd(oldwd)
Export core promoter shift tables to text files.
exportShiftTable(object) ## S4 method for signature 'TSSr' exportShiftTable(object)exportShiftTable(object) ## S4 method for signature 'TSSr' exportShiftTable(object)
object |
A TSSr object. |
core promoter shift tables
data(exampleTSSr) oldwd <- setwd(tempdir()) exportShiftTable(exampleTSSr) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportShiftTable(exampleTSSr) setwd(oldwd)
Exports TSS tables to text file.
exportTSStable(object, data = "raw", merged = TRUE) ## S4 method for signature 'TSSr' exportTSStable(object, data = "raw", merged = TRUE)exportTSStable(object, data = "raw", merged = TRUE) ## S4 method for signature 'TSSr' exportTSStable(object, data = "raw", merged = TRUE)
object |
A TSSr object. |
data |
Specify which data will be exported: "raw" or "processed". Default is "raw". |
merged |
Logical indicating whether raw sample columns should be merged
according to |
Raw exports always use TSSrawMatrix. With
merged = FALSE, the file is ALL.samples.TSS.raw.txt; with
merged = TRUE, raw counts are combined according to
mergeIndex and written to
ALL.samples.TSS.raw.merged.txt. Processed data are written to
ALL.samples.TSS.processed.txt.
Invisibly returns NULL after writing a TSS table.
data(exampleTSSr) oldwd <- setwd(tempdir()) exportTSStable(exampleTSSr, data = "raw", merged = TRUE) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportTSStable(exampleTSSr, data = "raw", merged = TRUE) setwd(oldwd)
Creates bedGraph/BigWig files of TSSs that can be visualized in the UCSC Genome Browser and Integrative Genomics Viewer (IGV).
exportTSStoBedgraph(object, data = "processed", format = "bedGraph",oneFile = FALSE) ## S4 method for signature 'TSSr' exportTSStoBedgraph( object, data = "processed", format = "bedGraph", oneFile = FALSE )exportTSStoBedgraph(object, data = "processed", format = "bedGraph",oneFile = FALSE) ## S4 method for signature 'TSSr' exportTSStoBedgraph( object, data = "processed", format = "bedGraph", oneFile = FALSE )
object |
A TSSr object. |
data |
Specify which data will be exported: "raw" or "processed". Default is "processed". |
format |
The format of output files: "bedGraph" or "BigWig". Default is "bedGraph". |
oneFile |
Logical, specify whether to export individual TSS tracks into the one bedGraph file (TRUE) of in separate bedGraph files (FALSE). |
Bedgraph/BigWig tracks of TSSs
data(exampleTSSr) oldwd <- setwd(tempdir()) exportTSStoBedgraph(exampleTSSr, data = "processed", format = "bedGraph") setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) exportTSStoBedgraph(exampleTSSr, data = "processed", format = "bedGraph") setwd(oldwd)
Filters transcriptional or sequencing noise.
filterTSS(object, method = "poisson", normalization = TRUE, pVal =0.01, tpmLow = 0.1) ## S4 method for signature 'TSSr' filterTSS( object, method = "poisson", normalization = TRUE, pVal = 0.01, tpmLow = 0.1 )filterTSS(object, method = "poisson", normalization = TRUE, pVal =0.01, tpmLow = 0.1) ## S4 method for signature 'TSSr' filterTSS( object, method = "poisson", normalization = TRUE, pVal = 0.01, tpmLow = 0.1 )
object |
A TSSr object. |
method |
Method to be used for TSS filtering: "poisson" or "TPM". "poisson" can be used only if the input TSS data in raw number of counts. |
normalization |
Define whether normalization data to TPM. Used only if method = “poisson”. Default is TRUE. |
pVal |
Used only if method = "poisson". Default value is 0.01. |
tpmLow |
Used only if method = "TPM". Default value is 0.1. Filtering
removes a nonzero count only when this threshold is greater than that
sample's smallest possible nonzero TPM value, approximately
|
A modified TSSr object with updated TSSprocessedMatrix
slot after filtering. The input object is not modified; assign the
returned object to retain the changes.
data(exampleTSSr) exampleTSSr <- filterTSS(exampleTSSr, method = "TPM", tpmLow = 2)data(exampleTSSr) exampleTSSr <- filterTSS(exampleTSSr, method = "TPM", tpmLow = 2)
getTSS function is used to precisely identify TSSs from multiple input file formats. The files include users' home-made alignment files (bam format) or downloaded files from public databases. See inputFilesType for details on the supported input file formats.
getTSS(object, sequencingQualityThreshold = 10, mappingQualityThreshold = 20, softclippingAllowed = FALSE) ## S4 method for signature 'TSSr' getTSS( object, sequencingQualityThreshold = 10, mappingQualityThreshold = 20, softclippingAllowed = FALSE )getTSS(object, sequencingQualityThreshold = 10, mappingQualityThreshold = 20, softclippingAllowed = FALSE) ## S4 method for signature 'TSSr' getTSS( object, sequencingQualityThreshold = 10, mappingQualityThreshold = 20, softclippingAllowed = FALSE )
object |
A TSSr object. |
sequencingQualityThreshold |
Used only if inputFilesType == "bam" or "bamPairedEnd", otherwise ignored. |
mappingQualityThreshold |
Used only if inputFilesType == "bam" or "bamPairedEnd", otherwise ignored. |
softclippingAllowed |
Used only if inputFilesType == "bam" or "bamPairedEnd". Default is FALSE. When FALSE, TSSr applies G-only uncoded G correction to leading G bases on plus-strand reads and trailing C bases on minus-strand reads as transcript-sense G bases. When TRUE, TSSr uses the aligner's aligned 5' boundary directly and skips uncoded G correction. |
A modified TSSr object with updated TSSrawMatrix,
TSSprocessedMatrix, and librarySizes slots. The input
object is not modified; assign the returned object to retain the changes.
exampleInput <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) importedTSSr <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = exampleInput, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) importedTSSr <- getTSS(importedTSSr) head(TSSmatrix(importedTSSr, data = "raw"))exampleInput <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) importedTSSr <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = exampleInput, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) importedTSSr <- getTSS(importedTSSr) head(TSSmatrix(importedTSSr, data = "raw"))
Merges individual samples within TSSr object into specified groups.
mergeSamples(object, mergeIndex) ## S4 method for signature 'TSSr' mergeSamples(object, mergeIndex = NULL)mergeSamples(object, mergeIndex) ## S4 method for signature 'TSSr' mergeSamples(object, mergeIndex = NULL)
object |
A TSSr object |
mergeIndex |
Integer vector specifying which samples to be merged |
A modified TSSr object with updated TSSprocessedMatrix
and librarySizes slots after merging samples. The input object is
not modified; assign the returned object to retain the changes.
data(exampleTSSr) exampleTSSr <- mergeSamples(exampleTSSr, mergeIndex = c(1, 1, 2, 2))data(exampleTSSr) exampleTSSr <- mergeSamples(exampleTSSr, mergeIndex = c(1, 1, 2, 2))
Normalizes raw TSS counts in all samples by tags per million (TPM)
normalizeTSS(object) ## S4 method for signature 'TSSr' normalizeTSS(object)normalizeTSS(object) ## S4 method for signature 'TSSr' normalizeTSS(object)
object |
A TSSr object. |
A modified TSSr object with updated TSSprocessedMatrix
slot containing normalized TPM values. The input object is not modified;
assign the returned object to retain the changes.
data(exampleTSSr) exampleTSSr <- mergeSamples(exampleTSSr) exampleTSSr <- normalizeTSS(exampleTSSr)data(exampleTSSr) exampleTSSr <- mergeSamples(exampleTSSr) exampleTSSr <- normalizeTSS(exampleTSSr)
Calculates the pairwise correlation coefficients between samples and creates a matix showing pairwise scatter plots and correlation coefficients. Scatterplot panels use logarithmic axes, so observations with a non-positive value in either sample are omitted from that panel with a warning. Correlation coefficients are calculated from the original, untransformed values, including zeros.
plotCorrelation(object, samples = "all") ## S4 method for signature 'TSSr' plotCorrelation(object, samples = "all")plotCorrelation(object, samples = "all") ## S4 method for signature 'TSSr' plotCorrelation(object, samples = "all")
object |
A TSSr object. |
samples |
Specify samples to be plotted. Can be either "all" to plot all samples in the object or a subset of samples in the object. Default is "all". |
pairwise correlations visualized in a graph
data(exampleTSSr) oldwd <- setwd(tempdir()) plotCorrelation(exampleTSSr, samples = "all") setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) plotCorrelation(exampleTSSr, samples = "all") setwd(oldwd)
Vocano plots of gene differential expression (with DESeq2 method) results.
plotDE(object, withGeneName = TRUE, xlim, ylim) ## S4 method for signature 'TSSr' plotDE(object, withGeneName = TRUE, xlim = c(-2.5, 2.5), ylim = c(0, 10))plotDE(object, withGeneName = TRUE, xlim, ylim) ## S4 method for signature 'TSSr' plotDE(object, withGeneName = TRUE, xlim = c(-2.5, 2.5), ylim = c(0, 10))
object |
A TSSr object. |
withGeneName |
Logical indicating whether to display names for genes which are differentially expressed. Default is TRUE. |
xlim |
Only enes of which log2FoldChange value within the xlim range are plotted. Default xlim = c(-2.5, 2.5). |
ylim |
Only genes of which -log10(pvalue) within the ylim range are plotted. Default ylim = c(0, 10). |
Displaying gene names requires the suggested package calibrate.
gene differential expression visualized in a graph
data(exampleTSSr) oldwd <- setwd(tempdir()) plotDE(exampleTSSr, withGeneName = TRUE) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) plotDE(exampleTSSr, withGeneName = TRUE) setwd(oldwd)
Plots histograms of the interquantile width of processed clusters.
plotInterQuantile(object, samples ="all", tagsThreshold = 1) ## S4 method for signature 'TSSr' plotInterQuantile(object, samples = "all", tagsThreshold = 1)plotInterQuantile(object, samples ="all", tagsThreshold = 1) ## S4 method for signature 'TSSr' plotInterQuantile(object, samples = "all", tagsThreshold = 1)
object |
A TSSr object. |
samples |
Specify samples to be plotted. Default is "all". |
tagsThreshold |
Excludes clusters with tags < tagsThreshold. |
core promoter interquantile width visualized in a graph
data(exampleTSSr) oldwd <- setwd(tempdir()) plotInterQuantile(exampleTSSr, samples = "all", tagsThreshold = 1) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) plotInterQuantile(exampleTSSr, samples = "all", tagsThreshold = 1) setwd(oldwd)
Plots histograms of core promoter shape scores.
plotShape(object, samples = "all") ## S4 method for signature 'TSSr' plotShape(object, samples = "all")plotShape(object, samples = "all") ## S4 method for signature 'TSSr' plotShape(object, samples = "all")
object |
A TSSr object. |
samples |
Specify samples to be plotted. Default is "all". |
core promoter shape score visualized in a graph
data(exampleTSSr) oldwd <- setwd(tempdir()) plotShape(exampleTSSr, samples = "all") setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) plotShape(exampleTSSr, samples = "all") setwd(oldwd)
Plots Gviz-track of TSSs, clusters, and genes.
plotTSS(object,samples,tssData = "processed",clusters = "assigned", clusterThreshold = 0.02,genelist,Bidirection = TRUE, up.dis =500,down.dis = 500,yFixed = TRUE) ## S4 method for signature 'TSSr' plotTSS( object, samples, tssData = "processed", clusters = "assigned", clusterThreshold = 0.02, genelist, Bidirection = TRUE, up.dis = 500, down.dis = 500, yFixed = TRUE )plotTSS(object,samples,tssData = "processed",clusters = "assigned", clusterThreshold = 0.02,genelist,Bidirection = TRUE, up.dis =500,down.dis = 500,yFixed = TRUE) ## S4 method for signature 'TSSr' plotTSS( object, samples, tssData = "processed", clusters = "assigned", clusterThreshold = 0.02, genelist, Bidirection = TRUE, up.dis = 500, down.dis = 500, yFixed = TRUE )
object |
A TSSr object. |
samples |
Specify samples to be included for plotting. |
tssData |
Specify which TSS data to be included for plotting: "raw" or "processed". |
clusters |
Specify which cluster data to be included for plotting: "all" or "assigned". |
clusterThreshold |
Ignore downstream clusters if signal < filterClusterThreshold*the strongest clusters within the same gene promoter region. Default value = 0.02. |
genelist |
List of gene names used for plotting. |
Bidirection |
Specify whether to display bidirectional TSS signals within defined region. Default is TRUE. |
up.dis |
Distance upstream of genes to specify plotting range. Default value = 500. |
down.dis |
Distance downstream of genes to specify plotting range. Default value = 500. |
yFixed |
Logical, specify whether to fix y axis limits. Default is TRUE. |
Requires the suggested package Gviz.
TSS and cluster examples visualized in a graph
data(exampleTSSr) oldwd <- setwd(tempdir()) plotTSS(exampleTSSr, samples = c("control", "treat"), genelist = c("YBL017C", "YBL067C"), up.dis = 500, down.dis = 500) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) plotTSS(exampleTSSr, samples = c("control", "treat"), genelist = c("YBL017C", "YBL067C"), up.dis = 500, down.dis = 500) setwd(oldwd)
Calculates principle component analysis (PCA) of all samples and creates a biplot which includes the position of each sample in terms of PC1 and PC2.
plotTssPCA(object, TSS.threshold =10) ## S4 method for signature 'TSSr' plotTssPCA(object, TSS.threshold = 10)plotTssPCA(object, TSS.threshold =10) ## S4 method for signature 'TSSr' plotTssPCA(object, TSS.threshold = 10)
object |
A TSSr object. |
TSS.threshold |
Only TSSs with raw signal >= TSS.threshold will be included in PCA analysis |
Requires the suggested package ggfortify.
PCA plotted in a graph
data(exampleTSSr) oldwd <- setwd(tempdir()) plotTssPCA(exampleTSSr, TSS.threshold = 10) setwd(oldwd)data(exampleTSSr) oldwd <- setwd(tempdir()) plotTssPCA(exampleTSSr, TSS.threshold = 10) setwd(oldwd)
Calculates core promoter shape based on the distributions of TSSs within core promoters using Shape Index (SI) algorithm (Hoskins et al. 2011) or Promoter Shape Score (PSS) algorithm (Lu et al. 2019).
shapeCluster(object, clusters = "consensusClusters", method = "PSS", useMultiCore=FALSE, numCores = NULL) ## S4 method for signature 'TSSr' shapeCluster( object, clusters = "consensusClusters", method = "PSS", useMultiCore = FALSE, numCores = NULL )shapeCluster(object, clusters = "consensusClusters", method = "PSS", useMultiCore=FALSE, numCores = NULL) ## S4 method for signature 'TSSr' shapeCluster( object, clusters = "consensusClusters", method = "PSS", useMultiCore = FALSE, numCores = NULL )
object |
A TSSr object. |
clusters |
Clusters to be used for calculating shape score: "tagClusters" or "consensusClusters". Default is "consensusClusters". |
method |
Method to be used for calculating core promoter shape score: "SI" or "PSS". Default is "PSS". |
useMultiCore |
Logical indicating whether multiple cores are used (TRUE) or not (FALSE). Default is FALSE. |
numCores |
Number of cores are used in clustering step. Used only if useMultiCore = TRUE. Default is NULL. |
A modified TSSr object with updated clusterShape slot. The
input object is not modified; assign the returned object to retain the
changes.
example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS(example_object, useMultiCore = FALSE) example_object <- consensusCluster( example_object, useMultiCore = FALSE ) example_object <- shapeCluster( example_object, clusters = "consensusClusters", method = "PSS", useMultiCore = FALSE ) head(clusterShape(example_object, sample = "control"))example_input <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) example_object <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = example_input, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2) ) example_object <- getTSS(example_object) example_object <- mergeSamples(example_object) example_object <- normalizeTSS(example_object) example_object <- clusterTSS(example_object, useMultiCore = FALSE) example_object <- consensusCluster( example_object, useMultiCore = FALSE ) example_object <- shapeCluster( example_object, clusters = "consensusClusters", method = "PSS", useMultiCore = FALSE ) head(clusterShape(example_object, sample = "control"))
Selects genes which have multiple core promoters and undergo core promoter shifting across different experiments. Generates gene list with Ds (degree of shift) value (Lu et al., 2019), p value and adjusted p value. Chi-squared tests use raw counts reconstructed from TPM values and the corresponding library sizes. When sparse 2-by-2 tables have small expected counts, the function emits one summary warning for all affected gene-level tests. Their approximate p values may be unreliable; the warning should not be treated as safe to ignore for inferential use.
shiftPromoter(object, comparePairs, pval=0.01) ## S4 method for signature 'TSSr' shiftPromoter(object, comparePairs, pval = 0.01)shiftPromoter(object, comparePairs, pval=0.01) ## S4 method for signature 'TSSr' shiftPromoter(object, comparePairs, pval = 0.01)
object |
A TSSr object. |
comparePairs |
Specified list of sample pairs for comparison. |
pval |
Genes with adjusted p value less than or equal to |
A modified TSSr object with updated PromoterShift slot. The
input object is not modified; assign the returned object to retain the
changes.
data(exampleTSSr) exampleTSSr <- shiftPromoter( exampleTSSr, comparePairs = list(c("control", "treat")), pval = 0.01 ) head(PromoterShift(exampleTSSr, comparison = "control_VS_treat"))data(exampleTSSr) exampleTSSr <- shiftPromoter( exampleTSSr, comparePairs = list(c("control", "treat")), pval = 0.01 ) head(PromoterShift(exampleTSSr, comparison = "control_VS_treat"))
Shows the genome, sample and TSS counts, and concise row counts for completed analyses without expanding the full contents of the object's slots.
## S4 method for signature 'TSSr' show(object)## S4 method for signature 'TSSr' show(object)
object |
A TSSr object. |
The input TSSr object, invisibly.
data(exampleTSSr) show(exampleTSSr)data(exampleTSSr) show(exampleTSSr)
These read-only accessors provide stable alternatives to direct slot
access. Tables are returned as independent base data.frame copies,
so modifying a returned value does not modify object or expose its
internal data.table representation.
TSSmatrix(object, data = c("raw", "processed")) ## S4 method for signature 'TSSr' TSSmatrix(object, data = c("raw", "processed")) librarySizes(object) ## S4 method for signature 'TSSr' librarySizes(object) refTable(object) ## S4 method for signature 'TSSr' refTable(object) tagClusters(object, sample = NULL) ## S4 method for signature 'TSSr' tagClusters(object, sample = NULL) consensusClusters(object, sample = NULL) ## S4 method for signature 'TSSr' consensusClusters(object, sample = NULL) clusterShape(object, sample = NULL) ## S4 method for signature 'TSSr' clusterShape(object, sample = NULL) assignedClusters(object, sample = NULL) ## S4 method for signature 'TSSr' assignedClusters(object, sample = NULL) unassignedClusters(object, sample = NULL) ## S4 method for signature 'TSSr' unassignedClusters(object, sample = NULL) filteredClusters(object, sample = NULL) ## S4 method for signature 'TSSr' filteredClusters(object, sample = NULL) enhancers(object, sample = NULL) ## S4 method for signature 'TSSr' enhancers(object, sample = NULL) DEtables(object, comparison = NULL, result = c("all", "significant")) ## S4 method for signature 'TSSr' DEtables(object, comparison = NULL, result = c("all", "significant")) TAGtables(object, sample = NULL) ## S4 method for signature 'TSSr' TAGtables(object, sample = NULL) PromoterShift(object, comparison = NULL) ## S4 method for signature 'TSSr' PromoterShift(object, comparison = NULL)TSSmatrix(object, data = c("raw", "processed")) ## S4 method for signature 'TSSr' TSSmatrix(object, data = c("raw", "processed")) librarySizes(object) ## S4 method for signature 'TSSr' librarySizes(object) refTable(object) ## S4 method for signature 'TSSr' refTable(object) tagClusters(object, sample = NULL) ## S4 method for signature 'TSSr' tagClusters(object, sample = NULL) consensusClusters(object, sample = NULL) ## S4 method for signature 'TSSr' consensusClusters(object, sample = NULL) clusterShape(object, sample = NULL) ## S4 method for signature 'TSSr' clusterShape(object, sample = NULL) assignedClusters(object, sample = NULL) ## S4 method for signature 'TSSr' assignedClusters(object, sample = NULL) unassignedClusters(object, sample = NULL) ## S4 method for signature 'TSSr' unassignedClusters(object, sample = NULL) filteredClusters(object, sample = NULL) ## S4 method for signature 'TSSr' filteredClusters(object, sample = NULL) enhancers(object, sample = NULL) ## S4 method for signature 'TSSr' enhancers(object, sample = NULL) DEtables(object, comparison = NULL, result = c("all", "significant")) ## S4 method for signature 'TSSr' DEtables(object, comparison = NULL, result = c("all", "significant")) TAGtables(object, sample = NULL) ## S4 method for signature 'TSSr' TAGtables(object, sample = NULL) PromoterShift(object, comparison = NULL) ## S4 method for signature 'TSSr' PromoterShift(object, comparison = NULL)
object |
A TSSr object. |
data |
Which TSS matrix to return: |
sample |
A sample name, or |
comparison |
A comparison name, or |
result |
For |
TSSmatrix() and refTable() return a base
data.frame. librarySizes() returns a named numeric vector.
The analysis-result accessors return a base data.frame when a
sample or comparison is selected, and otherwise return a named list of
base data.frame objects.
data(exampleTSSr) head(TSSmatrix(exampleTSSr, data = "raw")) librarySizes(exampleTSSr) head(refTable(exampleTSSr)) head(tagClusters(exampleTSSr, sample = "control")) head(consensusClusters(exampleTSSr, sample = "control")) head(clusterShape(exampleTSSr, sample = "control")) head(assignedClusters(exampleTSSr, sample = "control")) head(unassignedClusters(exampleTSSr, sample = "control")) head(filteredClusters(exampleTSSr, sample = "control")) head(enhancers(exampleTSSr, sample = "control")) head(DEtables( exampleTSSr, comparison = "control_VS_treat", result = "significant" )) head(TAGtables(exampleTSSr, sample = "control")) head(PromoterShift(exampleTSSr, comparison = "control_VS_treat"))data(exampleTSSr) head(TSSmatrix(exampleTSSr, data = "raw")) librarySizes(exampleTSSr) head(refTable(exampleTSSr)) head(tagClusters(exampleTSSr, sample = "control")) head(consensusClusters(exampleTSSr, sample = "control")) head(clusterShape(exampleTSSr, sample = "control")) head(assignedClusters(exampleTSSr, sample = "control")) head(unassignedClusters(exampleTSSr, sample = "control")) head(filteredClusters(exampleTSSr, sample = "control")) head(enhancers(exampleTSSr, sample = "control")) head(DEtables( exampleTSSr, comparison = "control_VS_treat", result = "significant" )) head(TAGtables(exampleTSSr, sample = "control")) head(PromoterShift(exampleTSSr, comparison = "control_VS_treat"))
TSSr is designed to analyze transcription start sites (TSSs) and core promoters with most types of 5’end sequencing data, such as cap analysis of gene expression (CAGE) (Takahashi, Lassmann et al. 2012), no-amplification non-tagging CAGE libraries for Illumina next-generation sequencers (nAnT-iCAGE) (Murata, Nishiyori-Sueki et al. 2014), a Super-Low Input Carrier-CAGE (SLIC-CAGE) (Cvetesic, Leitch et al. 2018), NanoCAGE (Cumbie, Ivanchenko et al. 2015), TSS-seq (Malabat, Feuerbach et al. 2015), transcript isoform sequencing (TIF-seq) (Pelechano, Wei et al. 2013), transcript-leaders sequencing (TL-seq) (Arribere and Gilbert 2013), precision nuclear run-on sequencing (PRO-Cap) (Mahat, Kwak et al. 2016), and GRO-Cap/5’GRO-seq (Kruesi, Core et al. 2013).
Creates a new TSSr object for TSS sequencing data analysis.
TSSr( genomeName, inputFiles, inputFilesType, sampleLabels, sampleLabelsMerged = character(), mergeIndex = numeric(), refSource = character(), organismName = character() )TSSr( genomeName, inputFiles, inputFilesType, sampleLabels, sampleLabelsMerged = character(), mergeIndex = numeric(), refSource = character(), organismName = character() )
genomeName |
A character string specifying the BSgenome object name (e.g., "BSgenome.Scerevisiae.UCSC.sacCer3"). |
inputFiles |
A character vector of input file paths. For
|
inputFilesType |
A character string specifying the type of input files. Must be one of: "bam", "bamPairedEnd", "bed", "tss", "TSStable", "BigWig". |
sampleLabels |
A character vector of sample labels corresponding to input files, or to sample columns in a TSStable table. |
sampleLabelsMerged |
An optional character vector of merged sample
labels for biological replicates. Supply this together with
|
mergeIndex |
An optional numeric vector indicating which samples to
merge together. Supply this together with |
refSource |
An optional path to a GFF annotation file. If supplied, it
must identify an existing regular file. |
organismName |
An optional character string describing the organism.
This metadata is retained for backward compatibility and is not required
by |
TSSr package provides a comprehensive workflow on TSS data starts from identification of accurate TSS locations, clustering TSSs within small genomic regions corresponding to core promoters, and transcriptional activity quantifications, as well as specialized downstream analyses including core promoter shape, cluster annotation, gene differential expression, core promoter shift. TSSr can take multiple formats of files as input, such as Binary Sequence Alignment Map (BAM) files (single-ended or paired-ended), Browser Extension Data (bed) files, BigWig files, ctss files or tss tables. TSSr also generates various types of TSS or core promoter track files which can be visualized in the UCSC Genome Browser or Integrative Genomics Viewer (IGV). TSSr also exports downstream analyses result tables and plots. Multiple cores are supported on Linux or Mac platforms.
A TSSr object.
genomeNamecharacter.
inputFilescharacter.
inputFilesTypecharacter.
sampleLabelscharacter.
sampleLabelsMergedcharacter.
librarySizesnumeric.
normalizationStatusA scalar character value describing whether
TSSprocessedMatrix contains "raw" counts or
"normalized" values. NA indicates that no state has been
established yet.
TSSrawMatrixdata.frame.
mergeIndexnumeric.
TSSprocessedMatrixdata.frame.
tagClusterslist.
consensusClusterslist.
clusterShapelist.
refSourcecharacter.
refTabledata.frame.
organismNameOptional character metadata describing the organism. It is retained for backward compatibility and is not used for cluster-to-gene assignment.
assignedClusterslist.
unassignedClusterslist.
filteredClusterslist.
enhancerslist.
DEtableslist.
TAGtableslist
PromoterShiftlist.
exampleInput <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) exampleAnnotation <- system.file( "extdata", "example-annotation.gff3", package = "TSSr", mustWork = TRUE ) myTSSr <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = exampleInput, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2), refSource = exampleAnnotation )exampleInput <- system.file( "extdata", "example-tss-table.tsv", package = "TSSr", mustWork = TRUE ) exampleAnnotation <- system.file( "extdata", "example-annotation.gff3", package = "TSSr", mustWork = TRUE ) myTSSr <- TSSr( genomeName = "BSgenome.Scerevisiae.UCSC.sacCer3", inputFiles = exampleInput, inputFilesType = "TSStable", sampleLabels = c("SL01", "SL02", "SL03", "SL04"), sampleLabelsMerged = c("control", "treat"), mergeIndex = c(1, 1, 2, 2), refSource = exampleAnnotation )