Description Usage Arguments Value Examples
View source: R/preprocessing_filtering_reduction.R
This functions is best used to re-count large number of small peaks (e.g. <= 5000bp) into equal or larger bins. The genome is either cut in fixed bins (e.g. 50,000bp) or into an user defined number of bins. Bins are calculated based on the canconical chromosomes. Note that if peaks are larger than bins, or if peaks are overlapping multiple bins, the signal is added to each bin. Users can increase the minimum overlap to consider peaks overlapping bins (by default 150bp, size of a nucleosome) to disminish the number of peaks overlapping multiple region. Any peak smaller than the minimum overlapp threshold will be dismissed. Therefore, library size might be slightly different from peaks to bins if signal was duplicated into multiple bins or ommitted due to peaks smaller than minimum overlap.
1 2 3 4 5 6 7 8 | peaks_to_bins(
mat,
bin_width = 50000,
n_bins = NULL,
minoverlap = 150,
verbose = TRUE,
ref = "hg38"
)
|
mat |
A matrix of peaks x cells |
bin_width |
width of bins to produce in base pairs (minimum 500) (50000) |
n_bins |
number of bins (exclusive with bin_width) |
minoverlap |
Minimum overlap between a peak and a bin to consider the peak as overlapping the bin (150). |
verbose |
Verbose |
ref |
reference genome to use (hg38) |
A sparse matrix of bins instead of peaks
1 2 3 | mat = create_scDataset_raw()$mat
binned_mat = peaks_to_bins(mat,bin_width = 10e6)
dim(binned_mat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.