genesofeve / projectr Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
For example, if you learn gene-level coefficients for 'Disease vs Normal' differential test, use these values in projectR to project into a new model system or context instead of using de novo learned features such as NMF patterns or PCA components.
In ref to:
projectR/vignettes/projectR.Rmd
Line 205 in d6ad9fd
aes(x='X1', y='X2')
not found -- perhaps meant to be PC1 and PC2?On install of the newest version I'm getting this warning:
in method for ‘projectR’ with signature ‘data="matrix",loadings="LinearEmbeddingMatrix"’: no definition for class “LinearEmbeddingMatrix”
Which I think has to do with the recent removal of CoGAPS as a dependency
Pattern visualizations
Projection visualizations
Add function(s) to empirically test for confidence in projected values by shuffling A weights and bootstrapping projections. This can/should be done independently of the Wald test and should be a separate workflow that can dump into a final projectR projection object.
Error in parse(outFile) :
/private/var/folders/w9/jnjcsn7d4s5gmzrgvzwdnnsc0000gn/T/RtmpqamsIo/devtools8bb269d6461/genesofeve-projectR-252df70/R/project:26:83: unexpected ','
25:
26: setGeneric("projectR", function(data,AnnotionObj,IDcol,Patterns,NP,full, model=NA),
^
ERROR: unable to collate and parse R files for package ‘projectR’
githubinstall("projectR")
Select a number or, hit 0 to cancel.
Hi, i'm the maintainer of {ggalluvial} and about to release a new patch to CRAN. Running revdepcheck::revdep_check()
identified a problem with (i think) the development version of {projectR}, but i have not been able to parse the problem. I've copied the report below.
Would you be able to check {projectR} after installing the current development version of {ggalluvial}? You can use remotes::install_github("corybrunson/ggalluvial")
with no additional arguments.
Thank you! Please let me know if i've missed something.
Report generated by {revdepcheck} and output to 'problems.md':
# projectR
<details>
* Version: 1.14.0
* GitHub: https://github.com/genesofeve/projectR
* Source code: https://github.com/cran/projectR
* Date/Publication: 2022-11-02
* Number of recursive dependencies: 173
Run `revdepcheck::revdep_details(, "projectR")` for more info
</details>
## Newly broken
* checking examples ...sh: line 1: 42932 Illegal instruction: 4 LANGUAGE=en _R_CHECK_INTERNALS2_=1 '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla > 'projectR-Ex.Rout' 2>&1 < 'projectR-Ex.R'
```
ERROR
Running examples in ‘projectR-Ex.R’ failed
The error most likely occurred in:
> ### Name: projectR
> ### Title: Generic projectR function
> ### Aliases: projectR projectR,matrix,matrix-method
> ### projectR,matrix,LinearEmbeddingMatrix-method
> ### projectR,matrix,prcomp-method projectR,matrix,rotatoR-method
> ### projectR,matrix,correlateR-method projectR,matrix,hclust-method
...
maxGibbsMass 100
*** caught illegal operation ***
address 0x109c8bc9b, cause 'illegal opcode'
Traceback:
1: dispatchFunc(data, allParams, uncertainty)
2: CoGAPS(p.RNAseq6l3c3t, params = new("CogapsParams", nPatterns = 5))
An irrecoverable exception occurred. R is aborting now ...
```
## Newly fixed
* checking examples ...sh: line 1: 42543 Illegal instruction: 4 LANGUAGE=en _R_CHECK_INTERNALS2_=1 '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla > 'projectR-Ex.Rout' 2>&1 < 'projectR-Ex.R'
```
ERROR
Running examples in ‘projectR-Ex.R’ failed
The error most likely occurred in:
> ### Name: projectR
> ### Title: Generic projectR function
> ### Aliases: projectR projectR,matrix,matrix-method
> ### projectR,matrix,LinearEmbeddingMatrix-method
> ### projectR,matrix,prcomp-method projectR,matrix,rotatoR-method
> ### projectR,matrix,correlateR-method projectR,matrix,hclust-method
...
maxGibbsMass 100
*** caught illegal operation ***
address 0x10e91fc9b, cause 'illegal opcode'
Traceback:
1: dispatchFunc(data, allParams, uncertainty)
2: CoGAPS(p.RNAseq6l3c3t, params = new("CogapsParams", nPatterns = 5))
An irrecoverable exception occurred. R is aborting now ...
```
## In both
* checking tests ...
```
Running ‘testthat.R’/Library/Frameworks/R.framework/Resources/bin/BATCH: line 60: 42957 Illegal instruction: 4 ${R_HOME}/bin/R -f ${in} ${opts} ${R_BATCH_OPTIONS} > ${out} 2>&1
ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
24: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
25: test_code(NULL, exprs, env)
26: source_file(path, child_env(env), wrap = wrap)
27: FUN(X[[i]], ...)
28: lapply(test_paths, test_one_file, env = env, wrap = wrap)
...
29: doTryCatch(return(expr), name, parentenv, handler)
30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
31: tryCatchList(expr, classes, parentenv, handlers)
32: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL})
33: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, wrap = wrap))
34: test_files_serial(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap, load_package = load_package)
35: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap, load_package = load_package, parallel = parallel)
36: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
37: test_check("projectR")
An irrecoverable exception occurred. R is aborting now ...
```
* checking for hidden files and directories ... NOTE
```
Found the following hidden files and directories:
.travis.yml
These were most likely included in error. See section ‘Package
structure’ in the ‘Writing R Extensions’ manual.
```
* checking top-level files ... NOTE
```
File
LICENSE
is not mentioned in the DESCRIPTION file.
```
* checking R code for possible problems ... NOTE
```
alluvialMat: no visible binding for global variable ‘celltype’
alluvialMat: no visible binding for global variable ‘variable’
alluvialMat: no visible binding for global variable ‘value’
alluvialMat: no visible binding for global variable ‘nCells’
alluvialMat: no visible binding for global variable ‘nCells_per_type’
alluvialMat: no visible binding for global variable
‘nCells_per_pattern’
alluvialMat: no visible binding for global variable ‘prop’
Undefined global functions or variables:
celltype nCells nCells_per_pattern nCells_per_type prop value
variable
```
* checking for unstated dependencies in vignettes ... NOTE
```
'library' or 'require' call not declared from: ‘gplots’
```
As the bioc requirements progress in time, older packages become noncompliant with the additional checks. This issue is for making it compliant. The BiocCheck::BiocCheck() output at the moment of creation is attached. It looks like the following items need to be addressed:
In several cases (e.g. ATAC seq) we want to minimize the ability of patterns to 'interact' with each other in the projection analysis. This can lead to negative P-weights that should may not be appropriately inferred as negative correlations. The solution most likely involves parallelizing projection over individual patterns instead of learning all coefficients simultaneously.
...with links to scCoGaps and rest of suite.
Check that group means and variances are appropriately adjusted by pattern normalization. Different numbers of genes are returned as significant when normalize_pattern is False.
Congrats on the preprint! It caught my interest and I was having a look through the vignette and noticed some small typos/spelling etc. that I thought, since I was having a read through anyway, I would add here.
Section 2.2
1.1 The first equation ends in [?]. Looks like this may be a Latex error. You may also want to define the symbols in the equation.
1.2 "reguardless" in last sentence from section 2.2 should be "regardless".
Section 2.3.1
2.1 This phrase "will throw errors and, subsequently, should be checked before running." from section 2.3.1 seems a bit off grammatically since "checked" cannot be both "subsequently" and "before". I think you want either a) "will throw errors and should be checked before running" or b) "will throw errors and, subsequently, should be checked". b) is better to my ears.
2.2 There are several examples of using ... object where it is unclear what class the object is which might be more informative to the user. Looking at the class definition, it would appear that these are regular base R object classes (matrix, data.frame, etc.), so it might be better to just call them this e.g. "AnnotionObj a data frame with annotation for the data" or "AnnotionObj: data frame; includes data annotation".
2.3 "Annotion" should be "Annotation"
2.4 In the IDcol explanation it says "AnnotionData object" although this is previously referred to as "AnnotionObj" not "AnnotionData object". Would be better to adopt a consistent term. This may be rectified "automatically" by addressing a.
2.5 "arguement" should be "argument"
2.6 "whose rows annotation links", I believe "rows" should be singular.
Section 2.3.2.
3.1 "For the the the base" should probably be "For the base" in addition this sentence would seem to be incomplete "For the the the base projectR function, Projection is the full lmFit model from the ."
Section 3.
4.1 "maximized" should be "maximise"
4.2 "and uncorrelated to previous components" should probably be "and uncorrelated to the previous components"
4.3 "The projectR function has S3 method for class prcomp." should probably be "The projectR function has S3 method for the prcomp class."
Section 3.1 - 3.2. The code is running outside of the code box or page in several places. Bioconductor (I am assuming you are planning on submitting here since you are using BiocStyle) has a 80 character per line regulation so I am sure BiocCheck is already complaining about this but, at least in one instance, the entirety of the code cannot be seen making it difficult for a user to reproduce the example. When the code overruns the box it is also difficult to copy and paste it, which is what many of the people using the vignette are going to be doing. A tip from me is, if you use Rstudio as a code editor, you can go to Preferences -> Code -> Display and check "Show margin" and set "Margin column" to 80. The editor will now show a vertical line at 80 characters making it much easier to identify places where your code will overrun the code boxes (and where BiocCheck will complain).
It seems like you are still actively working on the package and I am sure you would have found many of these things on your own. I would really like to have a closer look at the package once the documentation has progressed a bit so, if you would like, you can update the issue when this has happened and I can have another look and help out as an additional "pair of eyes".
p.s. You may also want to add temporary installation instructions to the README (devtools::install_github('genesofeve/projectR')
) until Bioconductor acceptance for people like me who are interested in trying out the package earlier.
To identify features outside of the feature map that are associated with projected weights, we want to implement a version of patternDrivers (or call it another test) where we do a DE gene test in the target gene expression space (after projection from source) using VGAM with appropriate family (negbinomial). This would be a 'standard' DE gene test using estimated P-weights from a projection as an explanatory variable. The goal is to identify genes in the target space whose expression is a function of P-weights for interesting/significant patterns.
There is a method to run projectR on sparse data, but it fails with an error.
Line 88 in 39b3b0f
To reproduce:
load("data/p.RNAseq6l3c3t.RData")
load("data/CR.RNAseq6l3c3t.RData")
data <- as(p.RNAseq6l3c3t, "sparseMatrix")
loadings <- CR.RNAseq6l3c3t@featureLoadings
class(data)
class(loadings)
projectR(data, loadings)
[1] "108 row names matched between data and loadings"
[1] "Updated dimension of data: 108 54"
Error in t.default(dataM[[2]]) : argument is not a matrix
It looks like the first bug is that t.default
is called instead of Matrix::t
on dataM[[2]]
. But even if using the correct t
, the result still produces an error:
dataNames <- rownames(data)
loadingsNames <- rownames(loadings)
dataM <- geneMatchR(data1=data, data2=loadings, data1Names=dataNames, data2Names=loadingsNames, merge=FALSE)
projection <- MatrixModels:::lm.fit.sparse(Matrix::t(dataM[[2]]), dataM[[1]])
Error in MatrixModels:::lm.fit.sparse(Matrix::t(dataM[[2]]), dataM[[1]]) :
incompatible dimensions of (x,y)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.