call_cnv: Call Copy-number Variation from SLRatio and segmentation

View source: R/call_cnv.R

call_cnvR Documentation

Call Copy-number Variation from SLRatio and segmentation

Description

Call Copy-number Variation from SLRatio and segmentation

Usage

call_cnv(
  sample_segmentation,
  sample_zscore,
  callChr = seq_len(22),
  tfs = c(0, 0.7),
  ploidies = c(1.5, 3),
  MaxCN = 4
)

Arguments

sample_segmentation

segmentation dataframe from segmentByPSCBS

sample_zscore

zscore dataframe

callChr

chromosome to analysis : Default c(1:22)

tfs

range of fitting tumor fraction : Default c(0,0.8)

ploidies

range of fitting chromosomal ploidy : Default c(1.5,4)

MaxCN

maximum copy-number : Default 4

Value

List of cnvcalling solutions

Examples

### Loading example SampleBam file
example_file <-  system.file("extdata","example_patientcfDNA_SampleBam.RDS",package = "cfdnakit")
sample_bambin <- readRDS(example_file)
### Example PoN
PoN_rdsfile <- system.file("extdata","ex.PoN.rds",package = "cfdnakit")
pon_profiles <- readRDS(PoN_rdsfile)
sample_profile <- get_fragment_profile(sample_bambin,sample_id = "Patient1")

sample_zscore <- get_zscore_profile(sample_profile,pon_profiles)

sample_zscore_segment <- segmentByPSCB(sample_zscore)

sample_cnv <- call_cnv(sample_zscore_segment,sample_zscore, tfs=c(0.1,0.3),ploidies=c(1.5,2), MaxCN=3)
plot_cnv_solution(sample_cnv,selected_solution = 1)


Pitithat-pu/cfdnakit documentation built on April 5, 2024, 8:50 p.m.