Comments (4)
Hi Erin,
Thanks for the excellent debugging.
retestBoundSnps is a boolean parameter that is passed in the built-in function and by default set to TRUE, along with retestBoundGenes. You can just create a new object called retestBoundSnps=TRUE to fix the not found error. The purpose for both of these parameters is to distinguish between retesting CNVs identified by the allele and expression-based models for comparison purposes.
One possibility is that some of your identified CNVs are too small, on the order of 1 SNP or 1 gene. These would in theory get removed upon retesting. But I think there is an R-related bug with coercing the length 1 list into a 1 row matrix rather than a vector. For example:
> foo = matrix(1:6, 2,3)
> foo
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
> foo = matrix(1:9,3,3)
> foo
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
> vi = c(TRUE, TRUE, FALSE)
> class(foo[vi,]) ## note still matrix
[1] "matrix"
> vi = c(TRUE, FALSE, FALSE) ## since only 1 passed, now not matrix
> class(foo[vi,])
[1] "integer"
Can you please check how large are your identified CNVs? Likewise, how many genes and how many SNPs did you begin with; it is possible that the default filtering is too stringent and you began with very few genes or SNPs for example.
- Jean
from honeybadger.
Hi Akdes,
The only use of as.vector()
is in coercing a table
of either snps or genes frequencies into a vector
. I've seen similar errors thrown with as.data.frame()
before when GenomicRanges
wasn't loaded properly, but your session info looks fine on that front.
Can you double check that the bound.genes.final
and bound.snps.final
slots in your hb
object are not empty? These would be the candidate CNVs that HoneyBADGER
identified from the allele or gene expression models alone and is trying to go back and reassess again using the combined model. Since both retestBoundGenes
and retestBoundSnps
are set to TRUE
the following code should execute:
if(retestBoundSnps & retestBoundGenes) {
if(verbose) {
cat('Retesting bound snps and genes using joint model')
}
if(length(bound.genes.final)==0) {
cat('ERROR NO GENES AFFECTED BY CNVS IDENTIFIED! Run calcGexpCnvBoundaries()? ')
return();
}
if(length(bound.snps.final)==0) {
cat('ERROR NO SNPS AFFECTED BY CNVS IDENTIFIED! Run calcAlleleCnvBoundaries()? ')
return();
}
gr <- range(genes[unlist(bound.genes.final),])
sr <- range(snps[unlist(bound.snps.final),])
if(intersect) {
rgs <- intersect(gr, sr)
} else {
rgs <- union(gr, sr)
}
retest <- lapply(seq_len(length(rgs)), function(i) {
x <- calcCombCnvProb(region=rgs[i], m=dev, verbose=verbose, ...)
list(x[[1]], x[[2]])
})
cnvs[['combine-based']] <<- list()
cnvs[['combine-based']][['all']] <<- rgs
results[['combine-based']] <<- retest
}
It should catch if either of those slots are empty, but maybe you have a unique case that isn't being caught properly.
from honeybadger.
Hi @JEFworks, I too am having issues with the command in the tutorial returning an error.
hb$retestIdentifiedCnvs(retestBoundGenes=TRUE, retestBoundSnps=TRUE, verbose=FALSE)
Error in as.vector(x) : no method for coercing this S4 class to a vector
I have the genomic ranges library, and ran the test code you suggested above4, but I just got another error.
Error: object 'retestBoundSnps' not found
I also made sure to check that the bound.genes.final and bound.snps.final slots in your hb object are not empty.
Do you have any other suggestions or things I should check?
Thanks!
from honeybadger.
Hi Jean,
I tried your test case code again, and after
retest <- lapply(seq_len(length(rgs)), function(i) {
x <- calcCombCnvProb(region=rgs[i], m=dev, verbose=verbose, ...)
list(x[[1]], x[[2]])
The following error resulted
Error in FUN(X[[i]], ...) : '...' used in an incorrect context
Also, I began with 9 genes and 4 snps
I think you may be right about it having to do with coercing the length 1 list into a 1 row matrix rather than a vector.
Thank You!
Erin
from honeybadger.
Related Issues (20)
- lt$setGexpDev HOT 1
- Warning in setGeneFactors and error in retestIdentifiedCnvs
- Allele-mode for selecting normal cells HOT 2
- 10X + Honeybadger question HOT 2
- Error in summarizeResults HOT 3
- Error in calcGexpCnvBoundaries when running with numeric chromosome names HOT 1
- Error: subscript contains invalid names HOT 9
- read bam files HOT 4
- Filtering of identified CNVs HOT 2
- speed of running setAlleleMats step
- What is the reason for only including snps in HoneyBADGER? HOT 2
- gene filtering different in HoneyBADGER object HOT 3
- Error: Failed to install 'HoneyBADGER' from GitHub HOT 2
- Showing error when trying Getting_Started.Rmd
- no method for coercing this S4 class to a vector HOT 3
- showing NULL in the step of calcGexpCnvBoundaries - getting started tutorial HOT 12
- Applying bayesian hierarchical model in integrating analyses tutorial
- error in hb$summarizeResults
- Error in summarizeResults for the allele-based approach
- Error in calcCombCnvProb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from honeybadger.