Integration of maftools with CNAqc
Dear @PoisonAlien, first of all congratulations on this great package (we chatted before on my TRONCO github space).
I would like to interface my new CNAqc package with maftools, and I am unsure on the best way to convert data formats (CNAqc to maf).
CNAqc can QC allele-specific CNAs and mutations calls for a single patient, and contains multiple functions to plot data from a single patient. Sometimes, when I have multiple CNAqc objects from many patients, I wish to plot a cohort-level visualisation of the input data. For CNA segments, I have implemented something pretty canonical. For mutations, however, I would like to interface maftools instead of coding a new visualisation from scratch...
Every CNAqc patient has input mutation data in this format (copying some examples from here, the reference could be either hg19 or GRCh38)
#> # A tibble: 12,963 × 8
#> chr from to ref alt DP NV VAF
#> <chr> <dbl> <dbl> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 chr1 1027104 1027105 T G 60 6 0.1
#> 2 chr1 2248588 2248589 A C 127 9 0.0709
#> 3 chr1 2461999 2462000 G A 156 65 0.417
and CNA data in this format
#> # A tibble: 267 × 5
#> chr from to Major minor
#> <chr> <int> <int> <dbl> <dbl>
#> 1 chr1 840009 1689987 3 2
#> 2 chr1 1689988 1815015 3 2
#> 3 chr1 1815016 9799969 3 2
I know maftools can parse ANNOVAR annotations, so I am thinking that maybe the best option would be to create a function to annotate with ANNOVAR mutations from a CNAqc input object, and then take it to maftools.
Would you have functions or best practices/ parameters to make this step?
Thanks,
Giulio