-
Notifications
You must be signed in to change notification settings - Fork 27
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
exportBins to seg/vcf when one or zero CNV are called #102
Comments
Hi. Thanks for reporting. In order to troubleshoot and fix this, could you please do: saveRDS(copyNumbersCalled, file = "issue_102.rds.zip") and attach that file in a comment here? We use a fake *.zip extension, because GitHub doesn't support uploading of files with an *.rds extension. |
Here it is ! |
Thanks, I can now get the same: library(QDNAseq)
copyNumbersCalled <- readRDS("issue_102.rds")
file <- exportBins(copyNumbersCalled, file="issue_102.seg", format="seg")
cat(readLines(file), sep = "\n")
x
issue_102.seg
21
14000001
25000000
21
0.17 So far, so good. This means anyone can work on this (I cannot promise anything anytime soon myself.) Now, I'm very rust on these formats and others might be too. Can you clarify what the problem is with the SEG output and what you'd expect it to be instead? That would help too. Thanks. |
I’m on phone only at the moment so can’t test it, but I’d imagine this line might just need a “, drop=FALSE”. Line 355 in b77cbd7
|
It should be
The header is missing and the data is in rows while it should be in columns.
Actually the biggest problem is with the VCF, because it's used downstream with other tools in NGS pipelines |
Hi @HenrikBengtsson , I came across this issue a few years ago, #58. It was closed but never resolved. Not sure what happened with the pull request. The issue in exportSEG comes from line 325, with Lines 323 to 325 in b77cbd7
I suppose it's the same in exportVCF as the code is strikingly similar: Lines 233 to 236 in b77cbd7
A solution I had for exportSeg was to have a conditional to include or exclude zeros, for example:
instead of just : Line 300 in b77cbd7
Lines 323 to 325 in b77cbd7
I have a version with the issue fixed that you can use, but it's an old QDNAseq version from 2019, that' you're welcome to test: https://github.com/RodrigoGM/QDNAseq/. Hope this helps, |
@ilarischeinin, could you look into fixing this? |
Hopefully fixes #102 (untested)
Hi, I have also seen this behaviour, so it's great to see a fix has been issued - will this be released soon? |
We need a unit test for this one, in order to deploy it. Can someone please contribute a test that (currently) fails? |
Hello,
There is a problem when outputing seg and vcf file and the total CNV called is zero or one.
There is an example of seg file with one CNV:
And the vcf:
The code I used to get that (I use a unique BAM file of shallow WGS, and the GRCh38 dataset generated by asntech):
My sessionInfo
And I think I found the problem in the code :-)
In
exportBins.R
, here inexportSEG <- function(obj, fnames=NULL) {...}
The problem is that
out <- out[dsel[posI, 4] != 0, ]
generates a vector instead of a dataframe if the result has a size of 1 or 0. Thenwrite.table
outputs the vector as lines and not as columns.If I make some check on the size of
out
, then something likeout <- data.frame(matrix(out[dsel[posI, 4] != 0, ], ncol = 6, nrow = 1))
, it works.The text was updated successfully, but these errors were encountered: