Retains only a subset of clonal simple segments, e.g., all segments with total ploidy 2.

subset_by_segment_totalcn(x, totalcn)

Arguments

x

A CNAqc object.

totalcn

The total (Major + minor) copy numbers to filter.

Value

x A new CNAqc object with subset data.

Examples

data('example_dataset_CNAqc', package = 'CNAqc')
x = init(mutations = example_dataset_CNAqc$mutations, cna = example_dataset_CNAqc$cna, purity = example_dataset_CNAqc$purity)
#> 
#> ── CNAqc - CNA Quality Check ───────────────────────────────────────────────────
#> 
#>  Using reference genome coordinates for: GRCh38.
#>  Found annotated driver mutations: TTN, CTCF, and TP53.
#>  Fortified calls for 12963 somatic mutations: 12963 SNVs (100%) and 0 indels.
#> ! CNAs have no CCF, assuming clonal CNAs (CCF = 1).
#>  Fortified CNAs for 267 segments: 267 clonal and 0 subclonal.
#>  12963 mutations mapped to clonal CNAs.

subset_by_segment_totalcn(x, 2)
#> 
#> ── CNAqc - CNA Quality Check ───────────────────────────────────────────────────
#> 
#>  Using reference genome coordinates for: GRCh38.
#>  Found annotated driver mutations: TTN, CTCF, and TP53.
#>  Fortified calls for 12963 somatic mutations: 12963 SNVs (100%) and 0 indels.
#>  Fortified CNAs for 9 segments: 9 clonal and 0 subclonal.
#> Warning: [CNAqc] a karyotype column is present in CNA calls, and will be overwritten
#>  81 mutations mapped to clonal CNAs.
#> 
#>               ┌ Driver(s):  TTN, CTCF ────────────────────────────┐
#>                                                                  
#>                  Driver cannot be mapped - out of any segment!   
#>                                                                  
#>               └───────────────────────────────────────────────────┘
#> ── [ CNAqc ] MySample 81 mutations in 9 segments (9 clonal, 0 subclonal). Genome
#> 
#> ── Clonal CNAs 
#> 
#>  2:0  [n = 81, L = 39 Mb] ■■■■■■■■■■■■■■■■■■■■■■■■■■■  { TP53 }
#> 
#>  Sample Purity: 89% ~ Ploidy: 2.
#> 
#>  There are 1 annotated driver(s) mapped to clonal CNAs.
#>          chr    from      to ref alt DP NV       VAF driver_label is_driver
#>        chr17 7577106 7577107   G   C 84 78 0.9285714         TP53      TRUE