as.normalizedMatrix: Convert a Normal Matrix to a normalizedMatrix Object

Description Usage Arguments Details Value Author(s) Examples

View source: R/normalize.R

Description

Convert a Normal Matrix to a normalizedMatrix Object

Usage

1
2
3
4
as.normalizedMatrix(mat, k_upstream = 0, k_downstream = 0, k_target = 0,
    extend, signal_name = "signals", target_name = "targets",
    background = NA, smooth = FALSE, smooth_fun = default_smooth_fun,
    keep = c(0, 1), trim = NULL)

Arguments

mat

A matrix generated by other software.

k_upstream

Number of windows in the upstream.

k_downstream

Number of windows in the downstream.

k_target

Number of windows in the target.

extend

Extension to the target. The length should be 1 (if one of k_upstream or k_downstream is zero). or 2 (if both of k_upstream and k_downstream are non-zero).

signal_name

The name of signal regions. It is only used for printing the object.

target_name

The name of the target names. It is only used for printing the object.

background

The background value in the matrix.

smooth

Whether apply smoothing on rows in the matrix.

smooth_fun

The smoothing function that is applied to each row in the matrix. This self-defined function accepts a numeric vector (may contain NA values) and returns a vector with same length. If the smoothing is failed, the function should call stop to throw errors so that normalizeToMatrix can catch how many rows are failed in smoothing. See the default default_smooth_fun for example.

keep

Percentiles in the normalized matrix to keep. The value is a vector of two percent values. Values less than the first percentile is replaces with the first pencentile and values larger than the second percentile is replaced with the second percentile.

trim

Deprecated, please use keep instead.

Details

If users use the matrix from other software, they can use this function to convert it to the normalizedMatrix object and visualize it afterwards.

Value

A normalizedMatrix object.

Author(s)

z.gu@dkfz.de

Examples

1
2
# There is no example
NULL

Example output

Loading required package: grid
Loading required package: ComplexHeatmap
Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22

Attaching package: 'EnrichedHeatmap'

The following object is masked from 'package:ComplexHeatmap':

    +.AdditiveUnit

NULL

EnrichedHeatmap documentation built on Nov. 8, 2020, 8:20 p.m.