check_cancer_types: Process Batch Table and Check Cancer Types

View source: R/timer.R

check_cancer_typesR Documentation

Process Batch Table and Check Cancer Types

Description

This function processes a batch table containing cancer types and checks each cancer category against a predefined list of available cancer types. The batch table can either be specified through a file or directly passed via function arguments. If the cancer type from the batch is not recognized, the function will halt and report an error.

Usage

check_cancer_types(args)

Arguments

args

A list containing either a path to a batch file ('batch') or direct expressions and category inputs ('expression' and 'category'). If 'batch' is provided, it should be a path to a comma-separated file where the second column contains cancer categories. If 'batch' is not provided, 'expression' and 'category' should be used to manually specify data.

Value

Returns a matrix with two columns: one for expression data (if provided) and one for cancer categories. Each row corresponds to a record from the input batch.

Examples

# Using a batch file:
args <- list(batch = "path/to/batch_file.csv")
result <- check_cancer_types(args)

# Using direct inputs:
args <- list(expression = c("exp1", "exp2"), category = c("lung", "breast"))
result <- check_cancer_types(args)

IOBR/IOBR documentation built on July 16, 2025, 8:12 p.m.