scImpute: Site- and condition-specific (sc) impute

View source: R/Impute.R

scImputeR Documentation

Site- and condition-specific (sc) impute

Description

Impute the missing values for a phosphosite across replicates within a single condition (or treatment) if there are n or more quantified values of that phosphosite in that condition.

Usage

scImpute(mat, percent, grps, assay)

Arguments

mat

a matrix (or PhosphoExperiment object) with rows correspond to phosphosites and columns correspond to replicates within a condition.

percent

a percent from 0 to 1, specifying the percentage of quantified values in any treatment group.

grps

a string specifying the grouping (replciates).

assay

an assay to be selected if mat is a PhosphoExperiment object.

Value

An imputed matrix. If param mat is a PhosphoExperiment object, a PhosphoExperiment object will be returned.

Examples


data('phospho.cells.Ins.sample')
grps = gsub('_[0-9]{1}', '', colnames(phospho.cells.Ins))
phospho.cells.Ins.filtered <- selectGrps(phospho.cells.Ins, grps, 0.5, n=1)

set.seed(123)
phospho.cells.Ins.impute <-
    scImpute(phospho.cells.Ins.filtered,
    0.5,
    grps)[,colnames(phospho.cells.Ins.filtered)]
    
# for PhosphoExperiment Object
data('phospho.cells.Ins.pe')
grps = gsub('_[0-9]{1}', '', colnames(phospho.cells.Ins.pe))
phospho.cells.Ins.filtered <- selectGrps(phospho.cells.Ins.pe, grps, 
    0.5, n=1)

set.seed(123)
phospho.cells.Ins.impute <-
    scImpute(phospho.cells.Ins.filtered,
    0.5,
    grps)[,colnames(phospho.cells.Ins.filtered)]


PYangLab/PhosR documentation built on Nov. 1, 2024, 1:47 p.m.