tx_add_rollingMean: Add rolling mean

View source: R/tx_core.R

tx_add_rollingMeanR Documentation

Add rolling mean

Description

Add rolling mean

Usage

tx_add_rollingMean(
  DT,
  colName,
  winSize,
  newColName = NULL,
  fill = NA,
  align = "center",
  minCov = 20,
  nCores = 1
)

Arguments

DT

data.table. A table as output by the tx_makeDT_coverage(), tx_makeDT_nucFreq() or tx_makeDT_covNucFreq() functions.

colName

character. Column to which rolling mean will be applied

winSize

numeric. Size of window

newColName

character. Name to be given to the output. If left empty, will assign a default name, combination of the colName and winSize arguments.

fill

Either an empty vector (no fill), or a vector (recycled to) length 3 giving left, middle and right fills. By default NA.

align

character. Align windows on the "left", "center" or "right".

minCov

numeric. Minimum coverage required to output ratio. If coverage is less then an NA is output in that position. To output all positions assign 0.

nCores

integer. Number of cores to run the function with. Multicore capability is not available in Windows OS.

Value

data.table


AngelCampos/tx_tools documentation built on Sept. 17, 2024, 1:27 a.m.