Comments (2)
Hi Shao,
Thanks for your concern.
Depending on whether there is a separate magnitude esimate for each cell (ie. magnitudes is a matrix) or if there is a common magnitude estimate for all cells (ie. magnitudes is a vector), we perform either matrix based operations or vector based operations.
Please see the full function below. The if("conc.a2" %in% names(models))
checks are nested in the is.matrix(magnitudes)
check and are needed.
scde.failure.probability <- function(models, magnitudes = NULL, counts = NULL) {
if(is.null(magnitudes)) {
if(!is.null(counts)) {
magnitudes <- scde.expression.magnitude(models, counts)
} else {
stop("ERROR: either magnitudes or counts should be provided")
}
}
if(is.matrix(magnitudes)) { # a different vector for every cell
if(!all(rownames(models) %in% colnames(magnitudes))) { stop("ERROR: provided magnitude data does not cover all of the cells specified in the model matrix") }
if("conc.a2" %in% names(models)) {
x <- t(1/(exp(t(magnitudes)*models$conc.a +t(magnitudes^2)*models$conc.a2 + models$conc.b)+1))
} else {
x <- t(1/(exp(t(magnitudes)*models$conc.a + models$conc.b)+1))
}
} else { # a common vector of magnitudes for all cells
if("conc.a2" %in% names(models)) {
x <- t(1/(exp((models$conc.a %*% t(magnitudes)) + (models$conc.a2 %*% t(magnitudes^2)) + models$conc.b)+1))
} else {
x <- t(1/(exp((models$conc.a %*% t(magnitudes)) + models$conc.b)+1))
}
}
x[is.nan(x)] <- 0
colnames(x) <- rownames(models)
x
}
Hope this addresses your question.
Best,
Jean
from scde.
Thanks for the quick reply! It is clear.
from scde.
Related Issues (20)
- incredible difficulty in installing 'scde' on R3.4.3 and R3.5.1 HOT 2
- Error in checkSlotAssignment(object, name, value) HOT 2
- Computing the statistical significance of overdispersion
- scde bioconductor version 2.10.0 still has flexmix problem! HOT 2
- Fail to run scde.error.models using example dataset HOT 3
- scDE is too slow when running large scale datasets. HOT 1
- What is the meaning of zscore in the results of differentially expressed analysis? HOT 4
- i could not install scde HOT 1
- Is there an equivalent pagoda.show.pathways() function for looking at clusters and not pathways
- last biocoductor version HOT 4
- Naive questions
- How to get the baseMeanA and baseMeanB in result of scde.expression.difference()
- Question regarding line 138 in jpmatLogBoot.cpp
- fisher.test error
- ES/MEF cell dataset published by Islam et al
- scde issue HOT 3
- error in calculating models
- ERROR encountered in building a model
- Trouble installing scde
- could scde use in differencial expression transcripts analysis?
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 scde.