fit_mp: Fit the Marchenko-Pastur distribution

Description Usage Arguments Value Examples

View source: R/fit_mp.R

Description

This function takes a data matrix as input and out puts the parameters asscociated to the MP distribution.

Usage

1
fit_mp(expr, sample = FALSE, cor = TRUE, nu = 50, p.val = 0.01)

Arguments

expr

a data matrix with cells in the columns and genes in the rows, preferably standardized gene-wise

sample

TRUE/FALSE, if the parameters should be estimated by random sampling or not, default is FALSE

cor

TRUE/FALSE, if the svd should be calculated on the correlation matrix or not (covariance matrix), default is TRUE

nu

the number of gene singular vectors to calculate in the process (the more, the more time expansive), default is 50

p.val

the p-value to be used in the test of normality for the singular vectors, default is 0.01

Value

A MP object:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(splatter)
data("splatO")
expr <- counts(splatO)
expr <- expr[rowSums(expr)>0,]

#Normalize and log-transform the data
expr.norm <- t(t(expr)/colSums(expr))*10000
expr.norm.log <- log(expr.norm + 1)

expr.scale <- t(scale(t(expr.norm.log)))
L <- fit_mp(expr.scale)

Siliegia/SIGMA documentation built on Dec. 18, 2021, 2 p.m.