bin_scdata {scFeatureFilter} | R Documentation |
Divides the genes that were not included in the top window in windows of the same size with decreasing mean expression levels.
bin_scdata(dataset, window_number = NULL, window_size = NULL, verbose = TRUE)
dataset |
A list, containing the top window generated by |
window_number |
An integer, indicating the number of bins to be used. |
window_size |
An integer, indicating the number of genes to be included
in each window. Ignored if |
verbose |
A boolean. Should the function print a message about window size or the number of windows created? |
Two binning methods are available:
window_number
: Divides the genes into the number of windows specified.
window_size
: Divides the genes into windows of the size specified.
This function adds a bin number column to the data frame.
This function is designed to take the list output by the
extract_top_window
function as an argument, operating only on the second element
of it. Once the genes in it have been binned, both elements of the list are bound
together in a data frame and returned. The output contains a new column bin
,
which indicates the window number assigned to each gene.
A data frame containing the binned genes.
library(magrittr) expMat <- matrix( c(1, 1, 1, 1, 2, 3, 0, 1, 2, 0, 0, 2), ncol = 3, byrow = TRUE, dimnames = list(paste("gene", 1:4), paste("cell", 1:3)) ) calculate_cvs(expMat) %>% define_top_genes(window_size = 1) %>% bin_scdata(window_number = 2) calculate_cvs(expMat) %>% define_top_genes(window_size = 1) %>% bin_scdata(window_size = 1)