Mouse-Imaging-Centre / RMINC

Statistics for MINC volumes: A library to integrate voxel-based statistics for MINC volumes into the R environment. Supports getting and writing of MINC volumes, running voxel-wise linear models, correlations, etc.; correcting for multiple comparisons using the False Discovery Rate, and more. With contributions from Jason Lerch, Chris Hammill, Jim Nikelski and Matthijs van Eede. Some additional information can be found here:
https://mouse-imaging-centre.github.io/RMINC
Other
23 stars 17 forks source link

R 4.x support #296

Closed bcdarwin closed 6 months ago

bcdarwin commented 3 years ago

RMINC builds with R 4.x without issues, but RMINC::runRMINCTestbed() (with R/4.0.5, hdf5/1.10.6, minc-toolkit/1.9.18.1) produces:

 | F W S  OK | Context
 |        23 | anatAnova [7.3s]                                                
 | 1       0 | anatApply [7.2s]                                                
Failure (test_anatApply.R:20:8): anatApply one output
ma[1] not equal to `mm`.
1/1 mismatches
[1] NA - 2.99 == NA

 |        46 | anatFDR [8.5s]                                                  
 |     2  21 | anatGet [0.9s]                                                  

Skip (test_anatGet.R:35:3): anatGetAll_old works
Reason: has_mincstuffs is not TRUE

Skip (test_anatGet.R:102:3): AnatGetAll works
Reason: has_mincstuffs is not TRUE

 | 1   2   0 | anatomy hierarchy summarization                                 

Skip (test_anatGet.R:295:3): Anatomy hierarchy works
Reason: has_mincstuffs is not TRUE

Skip (test_anatGet.R:310:3): anatomy hierarchy works
Reason: has_mincstuffs is not TRUE

Error (test_anatGet.R:319:3): Test anatToVolume works
Error in `data.frame(a = new_jacobians[, 1])`: object 'new_jacobians' not found
Backtrace:
 1. [ base::evalq(...) ] with 1 more call test_anatGet.R:319:2
 7. base::data.frame(a = new_jacobians[, 1])

 |        45 | anatLm [8.0s]                                                   
 |         6 | weighted anatLm [0.2s]                                          
 |         1 | Matrix mode                                                     
 | 2 2     5 | anatLmer [6.8s]                                                 

Warning (test_anatLmer.R:74:3): anatLmer exotic formulae work
NAs introduced by coercion
Backtrace:
  1. [ base::evalq(...) ] with 1 more call test_anatLmer.R:74:2
  7. RMINC::anatLmer(...)
 14. stats::model.frame.default(...)
 15. [ base::eval(...) ] with 1 more call
 19. base::factor(as.numeric(Pain.sensitivity) - 1)

Error (test_anatLmer.R:74:3): anatLmer exotic formulae work
Error in `lme4::lFormula(formula = RMINC_DUMMY_LHS ~ I(factor(as.numeric(Pain.sensitivity) - 
    1)) + (1 | Genotype), data = data)`: 0 (non-NA) cases
Backtrace:
  1. [ base::evalq(...) ] with 1 more call test_anatLmer.R:74:2
  7. RMINC::anatLmer(...)
 10. lme4::lFormula(...)

Warning (test_anatLmer.R:90:3): anatLmer exotic formulae work
NAs introduced by coercion
Backtrace:
  1. [ base::evalq(...) ] with 1 more call test_anatLmer.R:90:2
  7. RMINC::anatLmer(...)
 14. stats::model.frame.default(...)
 15. [ base::eval(...) ] with 1 more call
 19. base::factor(as.numeric(Pain.sensitivity) - 1)

Error (test_anatLmer.R:90:3): anatLmer exotic formulae work
Error in `lme4::lFormula(formula = RMINC_DUMMY_LHS ~ I(factor(as.numeric(Pain.sensitivity) - 
    1)) + (1 | Genotype), data = data)`: 0 (non-NA) cases
Backtrace:
  1. [ base::evalq(...) ] with 1 more call test_anatLmer.R:90:2
  7. RMINC::anatLmer(...)
 10. lme4::lFormula(...)

 | 1       0 | anatApply [6.8s]                                                

Failure (test_anatomy.R:19:3): anatApply one output
ma[1] not equal to `mm`.
1/1 mismatches
[1] NA - 2.99 == NA

 |         1 | anatMean                                                        
 |         1 | anatSum                                                         
 |         1 | anatVar                                                         
 |         1 | anatSd                                                          
 |         1 | civet.readAllCivetFiles [7.6s]                                  
 |         3 | mincApplyRCPP [0.7s]                                            
 |        24 | mincAnova [1.7s]                                                
 |         6 | mincApply [1.6s]                                                
 |        45 | mincFDR [2.2s]                                                  
 |         5 | mincLm - two group test [0.4s]                                  
 |         6 | mincFindPeaks - ensure we can find correct peaks [0.1s]         
 |         2 | vertexFindPeaks - ensure matches mincFindPeaks [0.3s]           
 |         2 | mincLm - two group test with interaction [0.2s]                 
 |         2 | mincLm - three group test [0.2s]                                
 |         2 | mincLm - three group test with interaction [0.2s]               
 |         2 | mincLm - Model Selection                                        
 |         1 | mincLm - Parallel [0.4s]                                        
 |         1 | mincLm - Randomize [3.1s]                                       
 |         2 | mincLmer - basic test [3.1s]                                    
 |         2 | mincLmer - maximum likelihood test [3.1s]                       
 |         3 | mincLmer - alternative summaries [15.8s]                        
 |         2 | mincLmer - log likelihood ratios [2.7s]                         
 | 1 1     7 | mincLmer - estimate DF [16.0s]                                  

Warning (???): Exotic formulae work
NAs introduced by coercion
Backtrace:
 1. stats::model.frame(...)
 2. stats::model.frame.default(...)
 3. [ base::eval(...) ] with 1 more call
 7. base::factor(as.numeric(Sex) - 1)

Error (???): Exotic formulae work
Error in `lme4::lFormula(formula = jacobians_fixed_2 ~ I(factor(as.numeric(Sex) - 
    1)) + (1 | coil), data = gf)`: 0 (non-NA) cases
Backtrace:
 1. lme4::lFormula(...)

|   1     0 | mincSummary (Mean, Sd, Var, Sum,t-test,correlation,wilcoxon)    
 *** caught segfault ***
address 0xfffffffe14d40930, cause 'memory not mapped'
bcdarwin commented 2 years ago

This is becoming increasingly important since the latest versions of many dependencies are dropping support for R 3.x and since R packaging has no dependency resolution a naive install of RMINC (or scanbaseTools) will fail.