caravagnalab / CNAqc

CNAqc - Copy Number Alteration (CNA) Quality Check package
GNU General Public License v3.0
17 stars 8 forks source link

CNAqc v0.1.1: bug in plot_gw_vaf and plot_gw_depth ? #15

Closed auroramaurizio closed 2 years ago

auroramaurizio commented 2 years ago

Hi guys, thank you for developing such a great tool! It's very useful!

Unfortunately, I found a problem with the new version of CNAqc (both in the package version installed from the branch "main" as well as from "subclonal") that I did not encounter in the previous version. The functions "plot_gw_vaf" and "plot_gw_depth" plot VAF and DP only for chr1 (or is it chr1 and part of chr2?) even if VAF and DP info are present for every other chromosome (chr3, chr4, etc.) in the x$snvs$VAF and x$snvs$DP fields.

Here is an example with the example template dataset you provide.

library(CNAqc) require(dplyr) require(vcfR)

data('example_dataset_CNAqc', package = 'CNAqc') packageVersion("CNAqc")

'0.1.1'

x = init( example_dataset_CNAqc$snvs, example_dataset_CNAqc$cna, example_dataset_CNAqc$purity, ref = 'hg19' )

I attach the plot

pdf("CNAqc_plot.pdf") cowplot::plot_grid( plot_gw_counts(x), plot_gw_vaf(x, N = 10000), plot_gw_depth(x, N = 10000), plot_segments(x, highlight = c("1:0", "1:1", "2:0", "2:1", '2:2')), align = 'v', nrow = 4, rel_heights = c(.15, .15, .15, .8)) dev.off()

VAF and DP info are available for e.g. chr3

x$snvs[grepl("chr3", x$snvs$chr),]

chr from to ref alt FILTER DP NV VAF ANNOVAR_FUNCTION GENE is_driver

1 chr3 107282 107283 T G PASS 206 68 0.330 intergenic AY269186.2(… FALSE

2 chr3 243965 243966 T C PASS 226 70 0.310 intronic CHL1 FALSE

I also tried to make it explicit that I want to plot VAF for all chromosomes in the function "plot_gw_vaf" but nothing changes

plot_gw_vaf(x, N = 10000, chromosomes = paste0("chr", c(1:22, "X", "Y")))

I do not know if this problem is limited to these 2 plotting functions or is going to affect the whole analysis.

Thank you for your support! Best, Aurora

CNAqc_plot.pdf