-
Notifications
You must be signed in to change notification settings - Fork 1
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
sparse bw error in rsamtools summary #100
Comments
The method ( There are two other methods also can do the job after importing the bw coverage. First, bw needs to be in The second way is fairly simple, These two methods can deal with the empty coverages without any error. |
I put my function here .countBW <- function(bw_files, intervals, .summary = F) |
So just to be clear, the error behavior you mention is that you get NAs when there are no reads instead of zeros, right? I haven't spotted errors in the actual counts, but it would be good to know if that was the case. I was aware of both things, that empty intervals are filled with NAs and that a warning is thrown for each. Note that this is a warning, not an error, an can probably be silenced with something like Also, it is my understanding that it's not RPK what I get from |
Just to make sure, I have checked |
Also the igv browser profile comparing by eyes, in favours of the the |
Oh I see! Thanks that's very helpful. You have observed this only when data is sparse, right? I'm looking into it. |
Yes, only sparse bw files have this issue. Histone coverages aligned well between methods. The sparsity introduced extremely large values from rtracklayer::summary, I think you also can find these abnormal values in processing the example bw file. |
rtracklayer::summary(BigWigFile(file)) is convenient for extracting interval density, but it's not bullet proof.
It gives error counts when there is empty coverage in the bw file.
For example, if load these intervals:
gene_mm9_chr1_bed <- "gene.mm9.chr1.bed"
toy_bw_file <- "GSE48895_V6.5_untreated_Plus.chr1.bw"
gene_res <- bw_bed(bwfiles = toy_bw_file, bedfile = gene_mm9_chr1_bed)
There are errors
Failed to summarize range 194 (chr1:145487827-145497067)Failed to summarize range 231 (chr1:173144101-173149324)Failed to summarize range 265 (chr1:182981368-182990798)Failed to summarize range 303 (chr1:18241059-18255219)Failed to summarize range 311 (chr1:32600391-32604138)Failed to summarize range 368 (chr1:65146963-65149937)Failed to summarize range 431 (chr1:121804478-121809745)
The most trickiest is that it doesn't fill the empty intervals with 0s, but NAs. And half empty intervals also have wrong density counts.
example.zip
The text was updated successfully, but these errors were encountered: