Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sampleSwaps bugfix #797

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

loipf
Copy link

@loipf loipf commented Jan 11, 2022

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

@loipf
Copy link
Author

loipf commented Jan 12, 2022

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

@Yunuuuu
Copy link

Yunuuuu commented Sep 8, 2023

I have encountered this bug. Can this fix be merged into the official repository?

@eolaniru eolaniru mentioned this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants