This is generating a randomized umi matrix by substituting each umi call (per cell and gene) with a umi call from the same gene on a cell that is connected to the original cell in a given similarity graph. If the similarity graph is based on some specific features that express a specific process (e.g. cell cycle), this can help in normalizing this effect and retaining correlation that are independent of it.

mcell_cgraph_norm_gcor(cgraph_id, mat_id, K = -1, min_gtot = 1000)

Arguments

cgraph_id

id of the cell graph to be used for normalization

mat_id

the matrix with umis to be analyzed

K

the maxium number of edges to consider per cell in normalization. This can be smaller than the K used in cgraph_id, to provide tighter control

min_gtot

minimal number of umis to consider when computing gene-gene correlaitons

Value

a list with two entries. gcor - is the gene correlation matrix of the downsampled matrix. r_gcor - is the correlation of the randomized umi matrix