Description Usage Arguments Details Value Examples
View source: R/build_tornado.R
Aggregates coverage data in an array. Coverage can be read in from BigWigFiles or computed from a GRanges object or a TabixFile.
1 2 3 4 5 6 7 8 9 |
features |
A GRanges or GRangesList object containing genomic loci of interest. |
data |
The data source to get coverages. Either a GRanges,
GRangesList, TabixFile,
BigWigFile, BigWigFileList object or
|
width, binwidth, nbin |
An |
... |
Arguments used for TabixFile input (see single cell data section in details):
|
pad_value |
A |
The genomic ranges provided as the features
argument get
resize
d to all have widths equal to
the (computed) width
argument, with fixed centres. Features with a negative
strand will have their output flipped in the output, such that stranded
features yield 5' -> 3' coverage data. If this is undesired, the features can
be unstrand
ed to prevent this flipping. When
the features
are provided as a GRangesList, every list
element is interpreted as part of a different feature set. Internally these
get unlisted an their set membership is tracked as the feature_set
column
in the rowData
slot.
If the data is a (set of) bigwig files, the output is constructed through the
summary()
method for bigwig files. For
other types of data, the coverage()
is
computed at the locations of the features. This basepair resolution coverage
is subsequently binned and averaged.
A popular format for storing single cell chromatin data is as a
TabixFile. For example, the 10x Genomics 'cellranger' pipeline
for single cell ATAC-seq produces a
fragments
tabix file, wherein the 4th column indicates the barcode of a
cell. When the data
argument is a tabix file, the barcode_column
argument
instructs this function where to look for barcodes. The list elements of the
barcode_groups
argument can then be matched against that column in the
tabix file to extract the data for every group of cells. Next, the coverage
for every group of cells is calculated, binned and averaged in the same way
bulk data is.
A TornadoExperiment object with the following populated slots:
Has an n features
× m samples
× o bins
3D
array with coverage data.
Information that could be derived from the data
argument.
Flattened and resized GRanges
derived from the
features
argument
Has a feature_set
column. See the 'Features' details
subsection.
A DataFrame with a bin_id
and range
column.
1 2 3 4 5 6 7 8 9 | # Some very small features and data that works
feats <- dummy_features()
dat <- dummy_granges_data()
# Make a tornado
tor <- build_tornado(feats, dat, width = 2000)
# Plotting the tornado
autoplot(tor)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.