Retains only a subset of clonal simple segments, e.g., all segments with total ploidy 2.
subset_by_segment_totalcn(x, totalcn)
x A new CNAqc object with subset data.
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