normalize_expt: Normalize the data of an expt object. Save the original...

View source: R/normalize_shared.R

normalize_exptR Documentation

Normalize the data of an expt object. Save the original data, and note what was done.

Description

It is the responsibility of normalize_expt() to perform any arbitrary normalizations desired as well as to ensure that the data integrity is maintained. In order to do this, it writes the actions performed in expt$state and saves the intermediate steps of the normalization in expt$intermediate_counts. Furthermore, it should tell you every step of the normalization process, from count filtering, to normalization, conversion, transformation, and batch correction.

Usage

normalize_expt(
  expt,
  transform = "raw",
  norm = "raw",
  convert = "raw",
  batch = "raw",
  filter = FALSE,
  annotations = NULL,
  fasta = NULL,
  entry_type = "gene",
  use_original = FALSE,
  batch1 = "batch",
  batch2 = NULL,
  batch_step = 4,
  low_to_zero = TRUE,
  thresh = 2,
  min_samples = 2,
  p = 0.01,
  A = 1,
  k = 1,
  cv_min = 0.01,
  cv_max = 1000,
  na_to_zero = FALSE,
  adjust_method = "ruv",
  verbose = TRUE,
  ...
)

Arguments

expt

Original expt.

transform

Transformation desired, usually log2.

norm

How to normalize the data? (raw, quant, sf, upperquartile, tmm, rle)

convert

Conversion to perform? (raw, cpm, rpkm, cp_seq_m)

batch

Batch effect removal tool to use? (limma sva fsva ruv etc)

filter

Filter out low/undesired features? (cbcb, pofa, kofa, others?)

annotations

Used for rpkm – probably not needed as this is in fData now.

fasta

Fasta file for cp_seq_m counting of oligos.

entry_type

For getting genelengths by feature type (rpkm or cp_seq_m).

use_original

Use the backup data in the expt class?

batch1

Experimental factor to extract first.

batch2

Second factor to remove (only with limma's removebatcheffect()).

batch_step

From step 1-5, when should batch correction be applied?

low_to_zero

When log transforming, change low numbers (< 0) to 0 to avoid NaN?

thresh

Used by cbcb_lowfilter().

min_samples

Also used by cbcb_lowfilter().

p

Used by genefilter's pofa().

A

Also used by genefilter's pofa().

k

Used by genefilter's kofa().

cv_min

Used by genefilter's cv().

cv_max

Also used by genefilter's cv().

na_to_zero

Sometimes rpkm gives some NA values for very low numbers.

adjust_method

Given a set of sv estimates, change the counts with this method.

verbose

Print what is happening while the normalization is performed? I am not sure why, but I think they should be 0.

...

more options

Value

Expt object with normalized data and the original data saved as 'original_expressionset'

See Also

[convert_counts()] [normalize_counts()] [batch_counts()] [filter_counts()] [transform_counts()]

Examples

## Not run: 
 normed <- normalize_expt(exp, transform='log2', norm='rle', convert='cpm',
                          batch='raw', filter='pofa')
 normed_batch <- normalize_expt(exp, transform='log2', norm='rle', convert='cpm',
                                batch='sva', filter='pofa')

## End(Not run)

elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.