Closed lavakin closed 1 year ago
Hi @lavakin
Thank you so much for adding this feature!!! :)
Regarding the checks, some of the myTAI unit tests require the DESeq2
and Seurat
packages to work. So if you don't have them installed on your machine the tests will fail. But this is no problem, since I will run the checks now.
I am super thrilled to see myTAI being speed up so elegantly :)
With many thanks and very best wishes, Hajk
Hi @lavakin
At least on my machine (Mac Mini M2Pro) with latest OS and OpenMP installed it now recognises only one thread.
@LotharukpongJS and @kullrich Does it work for you?
Many thanks, Hajk
Weird, do you have both openmp and libomp installed? Did you tried before to run the previous version without the check?
(you can also try to run the each of the conditions in the src/makevars and see if they output 1)
Dear @lavakin and @HajkD ,
Thanks so much to see these improvements to (my favourite package) myTAI. I got this with https://github.com/drostlab/myTAI/commit/46eb92798755ac2e9c1a80a40f3d3ab2fa19037d (latest commit). One thing to note is the position of the warning message - I am unsure why there isn't a line-break in my machine but it looks fine for yours. But it recognises 8 threads.
> data("PhyloExpressionSetExample")
> # transform absolute expression levels to log2 expression levels
> ExprExample <- tf(PhyloExpressionSetExample, log2)
>
> PlotSignature(ExprExample, permutations = 10000)
Plot signature: ' TAI ' and test statistic: ' FlatLineTest ' running 10000 permutations.
Computing permutations
[=========================================] 100%
Computing variances
Number of Eigen threads: 8
Computing permutations
[=========================================] 100%
Computing variances
Number of Eigen threads: 8
Time: 30.832768201828
We recommended using at least 20000 permutations to achieve a sufficient permutation test.
Significance status of signature: significant.
Now run 'FlatLineTest(..., permutations = 10000 , plotHistogram = TRUE)' to analyse the permutation test performance.Warning message:
In ks.test.default(filtered_vars, "pgamma", shape = shape, rate = rate) :
ties should not be present for the Kolmogorov-Smirnov test
It also works with the other tests
> PlotSignature(ExprExample, permutations = 1000, modules = list(early = 1:2, mid = 3:5, late = 6:7), TestStatistic = "ReductiveHourglassTest")
Plot signature: ' TAI ' and test statistic: ' ReductiveHourglassTest ' running 1000 permutations.
Computing permutations
[=========================================] 100%
Computing variances
Number of Eigen threads: 8
Computing permutations
[=========================================] 100%
Computing variances
Number of Eigen threads: 8
Modules:
early = { Zygote Quadrant }
mid = { Globular Heart Torpedo }
late = { Bent Mature }
Significance status of signature: not significant (= no evolutionary signature in the transcriptome).
and
> PlotSignature(ExprExample, permutations = 1000, modules = list(early = 1:2, mid = 3:5, late = 6:7), TestStatistic = "LateConservationTest")
Plot signature: ' TAI ' and test statistic: ' LateConservationTest ' running 1000 permutations.
Computing permutations
[=========================================] 100%
Computing variances
Number of Eigen threads: 8
The phylotranscriptomic pattern may not follow a late conservation pattern (high-mid-low or high-high-low).
Computing permutations
[=========================================] 100%
Computing variances
Number of Eigen threads: 8
Modules:
early = { Zygote Quadrant }
mid = { Globular Heart Torpedo }
late = { Bent Mature }
Significance status of signature: not significant (= no evolutionary signature in the transcriptome).
Out of curiosity @lavakin did you run roxygen2::roxygenise()
or devtools::document()
after your changes? Because when I do so, the src/cpp11.cpp
gets modified.
21 | | extern SEXP _myTAI_cpp_TAI(void *, void *);
-- | -- | --
22 | | extern SEXP _myTAI_cpp_bootMatrix(void *, void *, void *);
23 | | extern SEXP _myTAI_cpp_geom_mean(void *);
24 | | extern SEXP _myTAI_cpp_harmonic_mean(void *);
25 | | extern SEXP _myTAI_cpp_omitMatrix(void *, void *);
26 | | extern SEXP _myTAI_cpp_pMatrix(void *, void *);
27 | | extern SEXP _myTAI_cpp_std_error(void *);
28 | | extern SEXP _myTAI_rcpp_boottei_parallel(void *, void *, void *, void *);
29 | | extern SEXP _myTAI_rcpp_pMatrix_parallel(void *, void *, void *);
30 | | extern SEXP _myTAI_rcpp_pStrata_parallel(void *, void *, void *, void *);
31 | | extern SEXP _myTAI_rcpp_tei_parallel(void *, void *, void *);
| 21 | extern SEXP _myTAI_cpp_TAI(SEXP, SEXP);
| 22 | extern SEXP _myTAI_cpp_bootMatrix(SEXP, SEXP, SEXP);
| 23 | extern SEXP _myTAI_cpp_geom_mean(SEXP);
| 24 | extern SEXP _myTAI_cpp_harmonic_mean(SEXP);
| 25 | extern SEXP _myTAI_cpp_omitMatrix(SEXP, SEXP);
| 26 | extern SEXP _myTAI_cpp_pMatrix(SEXP, SEXP);
| 27 | extern SEXP _myTAI_cpp_std_error(SEXP);
| 28 | extern SEXP _myTAI_rcpp_boottei_parallel(SEXP, SEXP, SEXP, SEXP);
| 29 | extern SEXP _myTAI_rcpp_pMatrix_parallel(SEXP, SEXP, SEXP);
| 30 | extern SEXP _myTAI_rcpp_pStrata_parallel(SEXP, SEXP, SEXP, SEXP);
| 31 | extern SEXP _myTAI_rcpp_tei_parallel(SEXP, SEXP, SEXP);
Best, Sodai
Hi again,
On a separate note, would it be possible to suppress the specific warning from ks.test.default
?
I was running existing functions PlotStabilityTransformed()
and tfStability()
for TestStatistic = "FlatLineTest"
and the console is filled with the warning message (related to #26 ).
Warning in ks.test.default(filtered_vars, "pgamma", shape = shape, rate = rate) :
ties should not be present for the Kolmogorov-Smirnov test
Best, Sodai
Also @HajkD , do the checks run fine with you? It isn't passing with me. Thanks again to all for these improvements to (my favourite package) myTAI :)
── R CMD check results ─────────────────── myTAI 1.0.1.9000 ────
Duration: 5m 4.8s
❯ checking compilation flags in Makevars ... WARNING
Non-portable flags in variable 'PKG_CXXFLAGS':
-fopenmp
❯ checking for GNU extensions in Makefiles ... WARNING
Found the following file(s) containing GNU extensions:
src/Makevars
Portable Makefiles do not use GNU extensions such as +=, :=, $(shell),
$(wildcard), ifeq ... endif, .NOTPARALLEL See section ‘Writing portable
packages’ in the ‘Writing R Extensions’ manual.
❯ checking package dependencies ... NOTE
Packages suggested but not available for checking: 'taxize', 'Seurat'
❯ checking installed package size ... NOTE
installed size is 5.6Mb
sub-directories of 1Mb or more:
data 2.0Mb
doc 1.2Mb
help 1.6Mb
❯ checking top-level files ... NOTE
Non-standard file/directory found at top level:
‘pkgdown’
❯ checking compiled code ... NOTE
File ‘myTAI/libs/myTAI.so’:
Found ‘__ZNSt3__14coutE’, possibly from ‘std::cout’ (C++)
Object: ‘rcpp_funcs.o’
Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs.
See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual.
0 errors ✔ | 2 warnings ✖ | 4 notes ✖
Error: R CMD check found WARNINGs
Execution halted
Exited with status 1.
Hi @LotharukpongJS
Yes, I am getting the same check results other than the Packages suggested but not available for checking: 'taxize', 'Seurat'
NOTE.
Definitely the biggest issue we need to quickly resolve is
Found ‘__ZNSt3__14coutE’, possibly from ‘std::cout’ (C++)
Many thanks, Hajk
Dear @lavakin and @HajkD ,
Thanks so much to see these improvements to (my favourite package) myTAI. I got this with 46eb927 (latest commit). One thing to note is the position of the warning message - I am unsure why there isn't a line-break in my machine but it looks fine for yours. But it recognises 8 threads.
> data("PhyloExpressionSetExample") > # transform absolute expression levels to log2 expression levels > ExprExample <- tf(PhyloExpressionSetExample, log2) > > PlotSignature(ExprExample, permutations = 10000) Plot signature: ' TAI ' and test statistic: ' FlatLineTest ' running 10000 permutations. Computing permutations [=========================================] 100% Computing variances Number of Eigen threads: 8 Computing permutations [=========================================] 100% Computing variances Number of Eigen threads: 8 Time: 30.832768201828 We recommended using at least 20000 permutations to achieve a sufficient permutation test. Significance status of signature: significant. Now run 'FlatLineTest(..., permutations = 10000 , plotHistogram = TRUE)' to analyse the permutation test performance.Warning message: In ks.test.default(filtered_vars, "pgamma", shape = shape, rate = rate) : ties should not be present for the Kolmogorov-Smirnov test
It also works with the other tests
> PlotSignature(ExprExample, permutations = 1000, modules = list(early = 1:2, mid = 3:5, late = 6:7), TestStatistic = "ReductiveHourglassTest") Plot signature: ' TAI ' and test statistic: ' ReductiveHourglassTest ' running 1000 permutations. Computing permutations [=========================================] 100% Computing variances Number of Eigen threads: 8 Computing permutations [=========================================] 100% Computing variances Number of Eigen threads: 8 Modules: early = { Zygote Quadrant } mid = { Globular Heart Torpedo } late = { Bent Mature } Significance status of signature: not significant (= no evolutionary signature in the transcriptome).
and
> PlotSignature(ExprExample, permutations = 1000, modules = list(early = 1:2, mid = 3:5, late = 6:7), TestStatistic = "LateConservationTest") Plot signature: ' TAI ' and test statistic: ' LateConservationTest ' running 1000 permutations. Computing permutations [=========================================] 100% Computing variances Number of Eigen threads: 8 The phylotranscriptomic pattern may not follow a late conservation pattern (high-mid-low or high-high-low). Computing permutations [=========================================] 100% Computing variances Number of Eigen threads: 8 Modules: early = { Zygote Quadrant } mid = { Globular Heart Torpedo } late = { Bent Mature } Significance status of signature: not significant (= no evolutionary signature in the transcriptome).
Out of curiosity @lavakin did you run
roxygen2::roxygenise()
ordevtools::document()
after your changes? Because when I do so, thesrc/cpp11.cpp
gets modified.21 | | extern SEXP _myTAI_cpp_TAI(void *, void *); -- | -- | -- 22 | | extern SEXP _myTAI_cpp_bootMatrix(void *, void *, void *); 23 | | extern SEXP _myTAI_cpp_geom_mean(void *); 24 | | extern SEXP _myTAI_cpp_harmonic_mean(void *); 25 | | extern SEXP _myTAI_cpp_omitMatrix(void *, void *); 26 | | extern SEXP _myTAI_cpp_pMatrix(void *, void *); 27 | | extern SEXP _myTAI_cpp_std_error(void *); 28 | | extern SEXP _myTAI_rcpp_boottei_parallel(void *, void *, void *, void *); 29 | | extern SEXP _myTAI_rcpp_pMatrix_parallel(void *, void *, void *); 30 | | extern SEXP _myTAI_rcpp_pStrata_parallel(void *, void *, void *, void *); 31 | | extern SEXP _myTAI_rcpp_tei_parallel(void *, void *, void *); | 21 | extern SEXP _myTAI_cpp_TAI(SEXP, SEXP); | 22 | extern SEXP _myTAI_cpp_bootMatrix(SEXP, SEXP, SEXP); | 23 | extern SEXP _myTAI_cpp_geom_mean(SEXP); | 24 | extern SEXP _myTAI_cpp_harmonic_mean(SEXP); | 25 | extern SEXP _myTAI_cpp_omitMatrix(SEXP, SEXP); | 26 | extern SEXP _myTAI_cpp_pMatrix(SEXP, SEXP); | 27 | extern SEXP _myTAI_cpp_std_error(SEXP); | 28 | extern SEXP _myTAI_rcpp_boottei_parallel(SEXP, SEXP, SEXP, SEXP); | 29 | extern SEXP _myTAI_rcpp_pMatrix_parallel(SEXP, SEXP, SEXP); | 30 | extern SEXP _myTAI_rcpp_pStrata_parallel(SEXP, SEXP, SEXP, SEXP); | 31 | extern SEXP _myTAI_rcpp_tei_parallel(SEXP, SEXP, SEXP);
Best, Sodai
Nicee, seems like it indeed uses the multiple cores! Thanks so much for testing it ☺️
And yet, I run devtools::document(), because I need to update the CppExport, otherwise it wouldnt build.
So
Hi @LotharukpongJS
Yes, I am getting the same check results other than the
Packages suggested but not available for checking: 'taxize', 'Seurat'
NOTE.Definitely the biggest issue we need to quickly resolve is
Found ‘__ZNSt3__14coutE’, possibly from ‘std::cout’ (C++)
Many thanks, Hajk
So I tried to resolve this one earlier, it is highly probably caused by me using std::cout instead of rcpp::coutr (or sth like that, forgot how the rcpp funct is called). BUT oddly enough, when I use the rccp print function, it says the C stack is full and crashes almost imediately.
Didn’t have much time left yesterday, so didn’t look into it further.
Thanks for these very helpful comments!
Checking if openmp and libmop are installed, otherwise running a nonparallel version of myTAI.
Thought about implementing such a thing yesterday already, but seemed like too much pain.. and it indeed was. Please check if its working also for you.
Run the devtools::check and it outputs following error: Error in library(DESeq2) : there is no package called ‘DESeq2’. I am not aware of using such library. If you know what could be the problem, please fix it.