degnorm: Main function to perform degradation normalization.

View source: R/NMF_functions_short.R

degnormR Documentation

Main function to perform degradation normalization.

Description

degnorm calcualtes the degradation index score for each gene within each sample and return the degradation-normalized read counts.

Usage

degnorm(read_coverage,counts,iteration,loop,down_sampling=1,grid_size=10,
cores=1)

Arguments

read_coverage

a list of converage matrices, one per gene

counts

dataframe of read counts, each row for one gene, and column for sample. The order and number of genes must match the order in read_coverage matrices.

iteration

iteration number for degnorm algorithm. 5 is sufficient.

loop

iteration number inside of nonnegative matrix factorization-over approximation. Default is 100.

down_sampling

1 for yes (default) and 0 for no. If yes, average coverage score is calcualted on a grid of size specified by grid_size argument. The new coverage matrix formed by the grid average score will be used for baseline selection. This increases the efficiency of algorithm while maintaining comparable accuracy.

grid_size

default size is 10 bp.

cores

number of cores. Default number if 1. Users should input the maximum possible number of cores for efficiency.

Value

degnorm outputs a list of following objects:

counts

a data.drame of read counts for each gene within each sample.

counts_normed

a data.drame of degradation-normalized read counts for each gene within each sample.

DI

a matrix of degradation index scores for each gene within each sample.

K

normalizing scale factor for each gene within each sample after accounting for degradation normalization.

convergence

convergence tag; 0 = degnorm was not done on this gene because smaller counts or too short length.1 = degnorm was done with baseline selection. 2 = degnorm done without baseline selection because gene length (after filtering out low count regions)<200 bp. 3= baseline was found, but DI score is too large. 4 = baseline selection didn't coverge.

envelop

list of the envelop curves for all genes.

Examples

##coverage_res_chr21 is a \code{CoverageClass} object from DegNorm Package.
data(coverage_res_chr21)
res_DegNorm = degnorm(read_coverage = coverage_res_chr21[[1]],
                    counts = coverage_res_chr21[[2]],
                    iteration = 2,
                    down_sampling = 1,
                    grid_size=10,
                    loop = 20,
                    cores=2)

jipingw/DegNorm documentation built on April 3, 2024, 1:22 a.m.