griffithdan / cooccur

Probabilistic Species Co-occurrence Analysis in R
3 stars 6 forks source link

Effect size matrix error #3

Open theo-llewellyn opened 4 years ago

theo-llewellyn commented 4 years ago

Hi Daniel,

I'm currently running into an error when trying to make the effect size matrix with the cooccur package. I have tried two ways:

1. my_cooccur <- cooccur(mat = my_matrix, type = "spp_site", thresh = TRUE, spp_names = TRUE) effect.sizes(my_cooccur, standardized = TRUE, matrix = TRUE)

2. my_cooccur<- cooccur(mat = my_matrix, type = "spp_site", thresh = TRUE, spp_names = TRUE, only_effects = TRUE, eff_standard = TRUE, eff_matrix = TRUE)

Which both give the following error: Error in effs[mod$spp.names, mod$spp.names] : subscript out of bounds

It seems to not like the thresh=TRUE argument as when I remove it the code works perfectly. I am able to run and produce the heatmap using thresh=TRUE and would like to use the threshold for the effect size matrix too so the species pairs match the ones shown in the heatmap.

Any idea what might be going on?

Thanks for the package, its really great!

Best, Theo

Version info

version _
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 6.2
year 2019
month 12
day 12
svn rev 77560
language R
version.string R version 3.6.2 (2019-12-12) nickname Dark and Stormy Night

griffithdan commented 4 years ago

Hi Theo,

Thanks for your email. Would you be able to provide me a data subset and code that reproduces the error?

Best, Dan

On Mon, Feb 3, 2020, 9:03 AM theo-llewellyn notifications@github.com wrote:

Hi Daniel,

I'm currently running into an error when trying to make the effect size matrix with the cooccur package. I have tried two ways:

1.

my_cooccur <- cooccur(mat = my_matrix, type = "spp_site", thresh = TRUE, spp_names = TRUE) effect.sizes(my_cooccur, standardized = TRUE, matrix = TRUE)

1.

my_cooccur<- cooccur(mat = my_matrix, type = "spp_site", thresh = TRUE, spp_names = TRUE, only_effects = TRUE, eff_standard = TRUE, eff_matrix = TRUE)

Which both give the following error: Error in effs[mod$spp.names, mod$spp.names] : subscript out of bounds

It seems to not like the thresh=TRUE argument as when I remove it the code works perfectly. I am able to run and produce the heatmap using thresh=TRUE and would like to use the threshold for the effect size matrix too so the species pairs match the ones shown in the heatmap.

Any idea what might be going on?

Thanks for the package, its really great!

Best, Theo

Version info

version _ platform x86_64-apple-darwin15.6.0 arch x86_64 os darwin15.6.0 system x86_64, darwin15.6.0 status major 3 minor 6.2 year 2019 month 12 day 12 svn rev 77560 language R version.string R version 3.6.2 (2019-12-12) nickname Dark and Stormy Night

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/griffithdan/cooccur/issues/3?email_source=notifications&email_token=AAKUC474XU6TQ7M2UAR4MO3RBBE6ZA5CNFSM4KPIWILKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IKU5L6Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKUC47E6VAEDAHK6I6VQTTRBBE6ZANCNFSM4KPIWILA .

theo-llewellyn commented 4 years ago

Yes of course, can I send them to you privately?

Thanks, Theo

griffithdan commented 4 years ago

Sure thing. My email is on this chain and I'll write it here as well: griffith.dan@gmail.com

Daniel Griffith, Ph.D. Research Ecologist NASA-USGS Postdoctoral Program 350 N. Akron Rd. Moffett Field, CA, 94035 650-439-2449 griffithdan.github.io

On Tue, Feb 4, 2020 at 7:20 AM theo-llewellyn notifications@github.com wrote:

Yes of course, can I send them to you privately?

Thanks, Theo

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/griffithdan/cooccur/issues/3?email_source=notifications&email_token=AAKUC47HG5N2BWWE34E563DRBGBUPA5CNFSM4KPIWILKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKYAB3Y#issuecomment-581959919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKUC43PW7WCFXVOOP75A7TRBGBUPANCNFSM4KPIWILA .

nick-youngblut commented 4 years ago

I'm getting a similar error:

Error in obs_cooccur[row, 1]: subscript out of bounds
cooccur(mat = otu, type = "spp_site", thresh = TRUE, spp_names = TRUE)   # at line 8-11 of file <text>

...which doesn't occur if I set thresh=FALSE.

sessionInfo:

R version 3.6.2 (2019-12-12)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS/LAPACK: /ebio/abt3_projects/Georg_animal_feces/envs/phyloseq-eco/lib/libopenblasp-r0.3.7.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] LeyLabRMisc_0.1.6 doParallel_1.0.15 iterators_1.0.12  foreach_1.4.7    
 [5] clustermq_0.8.9   ggraph_2.0.3      tidygraph_1.2.0   cooccur_1.3      
 [9] phyloseq_1.30.0   ape_5.3           tidytable_0.4.1   ggplot2_3.2.1    
[13] tidyr_1.0.0       dplyr_0.8.5      

loaded via a namespace (and not attached):
 [1] viridis_0.5.1        Biobase_2.46.0       viridisLite_0.3.0   
 [4] jsonlite_1.6         splines_3.6.2        RhpcBLASctl_0.20-137
 [7] assertthat_0.2.1     stats4_3.6.2         ggrepel_0.8.2       
[10] pillar_1.4.3         lattice_0.20-38      glue_1.3.1          
[13] uuid_0.1-2           digest_0.6.23        XVector_0.26.0      
[16] polyclip_1.10-0      colorspace_1.4-1     htmltools_0.4.0     
[19] Matrix_1.2-18        plyr_1.8.5           pkgconfig_2.0.3     
[22] zlibbioc_1.32.0      purrr_0.3.3          scales_1.1.0        
[25] tweenr_1.0.1         ggforce_0.3.1        tibble_2.1.3        
[28] mgcv_1.8-31          gmp_0.6-0            farver_2.0.2        
[31] IRanges_2.20.0       withr_2.1.2          repr_1.0.2          
[34] BiocGenerics_0.32.0  lazyeval_0.2.2       survival_3.1-8      
[37] magrittr_1.5         crayon_1.3.4         evaluate_0.14       
[40] nlme_3.1-143         MASS_7.3-51.5        vegan_2.5-6         
[43] tools_3.6.2          data.table_1.12.8    lifecycle_0.1.0     
[46] stringr_1.4.0        Rhdf5lib_1.8.0       S4Vectors_0.24.0    
[49] munsell_0.5.0        cluster_2.1.0        Biostrings_2.54.0   
[52] ade4_1.7-13          compiler_3.6.2       rlang_0.4.6         
[55] rhdf5_2.30.0         grid_3.6.2           pbdZMQ_0.3-3        
[58] IRkernel_1.1         biomformat_1.14.0    igraph_1.2.4.2      
[61] base64enc_0.1-3      gtable_0.3.0         codetools_0.2-16    
[64] multtest_2.42.0      graphlayouts_0.7.0   reshape2_1.4.3      
[67] R6_2.4.1             gridExtra_2.3        permute_0.9-5       
[70] stringi_1.4.5        IRdisplay_0.7.0      Rcpp_1.0.3          
[73] vctrs_0.3.0          tidyselect_1.1.0