recurrent: Identify Recurrent Copy Number Variations by Risk Group

View source: R/recurrent.R

recurrentR Documentation

Identify Recurrent Copy Number Variations by Risk Group

Description

Filters a CNV data file for samples belonging to a specified risk group and identifies genomic regions that recur across multiple samples above a given threshold. Results are saved as a CSV file.

Usage

recurrent(x, risk_level, cnv_data_file, threshold = 2)

Arguments

x

A named list of sample ID vectors, as returned by classify_risk. Each element name corresponds to a risk group label (e.g., "low_risk", "intermediate_risk", "high_risk").

risk_level

Character. The risk group to analyse. Must be a name present in x.

cnv_data_file

Character. Path to the CNV data file (whitespace-delimited, with a header). Must contain columns: Sample, Chromosome, Start, End, Num_Probes, Segment_Mean.

threshold

Numeric. Minimum number of samples a CNV region must appear in to be considered recurrent. Default is 2.

Details

Sample IDs in the CNV file are trimmed to 12 characters and hyphens are replaced with dots to match standard TCGA-style identifiers. The output CSV is saved inside a timestamped subdirectory under recurrent_cnv/ in the temporary directory. This function is cancer-type agnostic.

Value

Character. The file path of the saved CSV file containing the recurrent CNV regions for the specified risk group.

Examples

sample_file <- system.file("extdata", "sample_data.csv", package = "RiskyCNV")
cnv_file    <- system.file("extdata", "cnv_data.txt",    package = "RiskyCNV")
risk_result <- classify_risk(
  file_path    = sample_file,
  column_name  = "gleason_score",
  disease_type = "prostate",
  output_dir   = tempdir()
)
output_path <- recurrent(
  x             = risk_result,
  risk_level    = "low_risk",
  cnv_data_file = cnv_file,
  threshold     = 2
)
print(output_path)


RiskyCNV documentation built on June 5, 2026, 5:07 p.m.