maftools
maftools copied to clipboard
sampleSwaps bugfix
for samples with a low read depth, it can happen that no SNP/variant is found per sample and the vaf
column in rc_af
contains only NAs.
This causes problems in cor.test()
codeline with one argument only containing NAs when iterating over all parallel::mclapply(seq_along(rc_af), function(idx)
codeline
-> simple fix with filtering beforehand for only selected samples containing SNPS which passed the min_depth
requirement. also include output information about samples which have been ignored (also this could theoretically extracted by the user from the difference of SNP_readcounts$BAM
and colnames(AF_table)
but makes it clearer)
feel free to edit, was only a fast easy fix, it is a really nice method
this does not solve the whole problem, still some edge cases can appear where not a sufficient number of SNPs (more than 1 but less than 3?) is present to calculate correlations, some threshold of a minimal number of SNPs are needed.
following 2 errors occur:
[1] "Error in concordant_snps[[2]] : subscript out of bounds\n"
[1] "Error in cor.test.default(x$vaf, y$vaf) : not enough finite observations\n"
this leads to null
entries in sample_matches
, leading to errors in next lapply
I have encountered this bug. Can this fix be merged into the official repository?