Learn R Programming

omicsTools (version 1.1.7)

qc_normalize: QC-RLSC Normalize function

Description

This function performs normalization on the input data matrix using the robust loess signal correction (RLSC) method. Normalization is based on Quality Control (QC) samples in the data.

Usage

qc_normalize(data, qc_label = "QC", sample_id_col = "sample_id")

Value

A data frame with the first column as the sample identifiers and the rest of the columns containing the normalized peak intensities.

Arguments

data

A data frame containing the sample data. The first column should contain the sample identifiers by default named 'sample_id', and the rest of the columns contain the peaks to be normalized. QC samples should be indicated in the sample identifiers with 'QC'.

qc_label

A string indicating the label used for QC samples. Default is 'QC'.

sample_id_col

A string indicating the column name used for sample identifiers. Default is 'sample_id'.

Author

Yaoxiang Li

Examples

Run this code
# Load the CSV data
data_file <- system.file("extdata", "example2.csv", package = "omicsTools")
data <- readr::read_csv(data_file)

# Display the first few rows of the original data
print(head(data))

# Apply the qc_rlsc_normalize function
normalized_data <- qc_normalize(data, qc_label = "QC", sample_id_col = "Sample")

# Display the first few rows of the normalized data
print(head(normalized_data))

# \donttest{
# Write the normalized data to a new CSV file
readr::write_csv(normalized_data, paste0(tempdir(), "/normalized_data.csv"))
# }

Run the code above in your browser using DataLab