Skip to contents

This would create a sparse track of the form "track_prefix.mcmetacell" for each metacell in the McCounts object. The counts are smoothed by a running sum window of size window_size * 2 + 1 (default: 201). The resulted track would be stored in a 'dense' format with a resolution of resolution bp (default: 10).
Each track would have a track attribute named "total_cov" with the total coverage of the metacell.
If create_marginal_track is TRUE (default), an additional track with the total counts over all the metacells will be created.
Counts can be normalized to the total counts of each metacell by setting normalize = TRUE.

Usage

mcc_to_tracks(
  mc_counts,
  track_prefix,
  metacells = NULL,
  overwrite = FALSE,
  resolution = 20,
  window_size = NULL,
  create_marginal_track = TRUE,
  normalize = FALSE
)

Arguments

mc_counts

A McCounts object

track_prefix

The prefix of the tracks to create (i.e. misha directory). Track names will be of the form "track_prefix.mcmetacell"

metacells

metacells for which to create tracks. If NULL, all metacells will be used.

overwrite

Whether to overwrite existing tracks.

resolution

The resolution of each track (default: 20bp)

window_size

The size of the window used to smooth the counts. The counts of at position i are smoothed by a sum of the counts of i - window_size, i + window_size. If NULL - the counts are not smoothed.

create_marginal_track

Create a track with the total counts from all the metacells. The track would be named "track_prefix.marginal"

normalize

Normalize each metacell by the sum of its counts.

Value

An McTracks object with the new tracks.

Examples

if (FALSE) {
mcc_to_tracks(mc_counts, "pbmc_mc")
}