generate_coverage_tracks {ChromSCape} | R Documentation

## Generate cell cluster pseudo-bulk coverage tracks

### Description

Generate cell cluster pseudo-bulk coverage tracks. First, scBED files are concatenated into cell clusters contained in the 'cell_cluster' column of your SingleCellExperiment object. To do so, for each sample in the given list, the barcodes of each cluster are grepped and BED files are merged into pseudo-bulk of clusters (C1,C2...). Two cells from different can have the same barcode ID as cell affectation is done sample by sample. Then coverage of pseudo-bulk BED files is calculated by averaging & smoothing reads on small genomic window (150bp per default). The pseudo bulk BED and BigWigs coverage tracks are writtend to the output directory. This functionality is not available on Windows as it uses the 'cat' and 'gzip' utilities from Unix OS.

### Usage

    generate_coverage_tracks(
      scExp_cf,
      input_files_coverage,
      odir,
      ref_genome = c("hg38", "mm10")[1],
      bin_width = 150,
      n_smoothBin = 5,
      read_size = 101,
      progress = NULL
    )

### Arguments

`scExp_cf` | A SingleCellExperiment with cluster selected. (see `choose_cluster_scExp`). It is recommended having a minimum of ~100 cells per cluster in order to obtain smooth tracks.
`input_files_coverage` | A named list of character vector of path towards single-cell BED files. The names MUST correspond to the 'sample_id' column in your SingleCellExperiment object. The single-cell BED files names MUST match the barcode names in your SingleCellExperiment (column 'barcode'). The scBED files can be gzipped or not.
`odir` | The output directory to write the cumulative BED and BigWig files.
`ref_genome` | The genome of reference, used to constrain to canonical chromosomes. Either 'hg38' or 'mm10'. 'hg38' per default.
`bin_width` | The width of the bin to create the coverage track. The smaller the greater the resolution & runtime. Default to 150.
`n_smoothBin` | Number of bins left & right to average ('smooth') the signal on. Default to 5.
`read_size` | The estimated size of reads. Default to 101.
`progress` | A Progress object for Shiny. Default to NULL.

### Value

Generate coverage tracks (.bigwig) for each cluster in the SingleCellExperiment ("cell_cluster" column).

### Examples

    ## Not run:
    data(scExp)
    input_files_coverage = list(
      "scChIP_Jurkat_K4me3" = paste0("/path/to/",scExp$barcode[1:51],".bed"),
      "scChIP_Ramos_K4me3" = paste0("/path/to/",scExp$barcode[52:106],".bed")
    )
    generate_coverage_tracks(scExp, input_files_coverage, "/path/to/output",
    ref_genome = "hg38")

    ## End(Not run)

[Package ChromSCape version 1.2.62 Index]