clean_dt: clean_dt helper function

Description Usage Arguments Value Examples

View source: R/clean_dt.R

Description

Internal function, that checks the formatting of imported files and prepares them to be applicable for the following pcr-bias correction steps.

Usage

1
clean_dt(datatable, description, type, logfilename)

Arguments

datatable

A data.table object that contains either the experimental data or the calibration data.

description

A character string, indicating if datatable contains either "calibration" data or "experimental" data.

type

A single integer. Type of data to be corrected: either "1" (one locus in many samples, e.g. pyrosequencing data) or "2" (many loci in one sample, e.g. next-generation sequencing data or microarray data).

logfilename

A character string. Path to the logfile to save the log messages.

Value

If a valid file is provided, the function returns a cleaned data.table, suited for BiasCorrection.

Examples

1
2
3
4
5
6
7
8
9
logfilename <- paste0(tempdir(), "/log.txt")
cleaned_experimental <- clean_dt(
  datatable = rBiasCorrection::example.data_experimental$dat,
  description = "experimental",
  type = 1,
  logfilename = logfilename
)
dim(cleaned_experimental)
class(cleaned_experimental)

rBiasCorrection documentation built on Aug. 4, 2021, 9:08 a.m.