impute: Impute

View source: R/7_impute.R

imputeR Documentation

Impute

Description

Impute NA values

Usage

impute(object, ...)

## S3 method for class 'numeric'
impute(object, shift = 2.5, width = 0.3, verbose = TRUE, plot = FALSE, ...)

## S3 method for class 'matrix'
impute(
  object,
  shift = 2.5,
  width = 0.3,
  verbose = TRUE,
  plot = FALSE,
  n = min(9, ncol(object)),
  palette = make_colors(colnames(object)),
  ...
)

## S3 method for class 'SummarizedExperiment'
impute(
  object,
  assay = assayNames(object)[1],
  by = "subgroup",
  shift = 2.5,
  width = 0.3,
  frac = 0.5,
  verbose = TRUE,
  plot = FALSE,
  palette = make_colors(colnames(object)),
  n = min(9, ncol(object)),
  ...
)

Arguments

object

numeric vector, SumExp

...

required for s3 dispatch

shift

number: sd units

width

number: sd units

verbose

TRUE or FALSE

plot

TRUE or FALSE

n

number of samples to plot

palette

color vector

assay

string

by

svar

frac

fraction: fraction of available samples should be greater than this value for a subgroup to be called available

Details

Imputes NA values from N(mean - 2.5 sd, 0.3 sd)

Value

numeric vector, matrix or SumExp

Examples

# Simple Design
   file <- system.file('extdata/fukuda20.proteingroups.txt', package = 'autonomics')
   object <- read_maxquant_proteingroups(file)
   impute(values(object)[, 1], plot = TRUE)[1:3]              # vector
   impute(values(object),      plot = TRUE)[1:3, 1:3]         # matrix
   impute(object, plot = TRUE)                                # sumexp
# Complex Design
   subgroups <- sprintf('%s_STD', c('E00','E01','E02','E05','E15','E30','M00'))
   file <- system.file('extdata/billing19.proteingroups.txt', package = 'autonomics')
   object <- read_maxquant_proteingroups(file, subgroups = subgroups)
   impute(values(object)[1:3, 1   ])     # vector
   impute(values(object)[1:3, 1:5 ])     # matrix
   impute( object )                      # sumexp

bhagwataditya/importomics documentation built on Oct. 29, 2024, 3:19 p.m.