adw96 / DivNet

diversity estimation under ecological networks
83 stars 18 forks source link

Add and test formula implementation #54

Closed bryandmartin closed 4 years ago

adw96 commented 4 years ago

Hi @bryandmartin -- good job. A couple of outstanding things:

  1. I would really like to have the user not to provide an argument X and the inputs to formula can come from the phyloseq object. Here's an example:
data(Lee)
lee_phylum <- speedyseq::tax_glom(Lee, taxrank="Phylum") 
lee_phylum %>% 
  divnet(X="type", ncores = 4) ## currently working
lee_phylum %>% 
  divnet(formula = ~type, ncores = 4) ## what I would like to have work

Essentially I don't want to make a user have to make a data frame containing their covariates if the covariates are already in sample_data. Can you add this functionality? Thanks!

  1. Can you look into why the Travis checks are failing and resolve? Identified and believe I fixed an issue with missing n_taxa and n in test_formula.R but there may be other issues

Many thanks, and I'm happy to do another review!

bryandmartin commented 4 years ago

@adw96 Ready for review. Tests are now passing on Travis as well.

codecov-commenter commented 4 years ago

Codecov Report

Merging #54 into master will increase coverage by 0.32%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   67.10%   67.42%   +0.32%     
==========================================
  Files          13       13              
  Lines         608      614       +6     
==========================================
+ Hits          408      414       +6     
  Misses        200      200              
Impacted Files Coverage Δ
R/MCmat.R 50.94% <100.00%> (ø)
R/conversions.R 76.92% <100.00%> (ø)
R/divnet_main.R 94.62% <100.00%> (+0.37%) :arrow_up:
R/utility.R 66.66% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1f3c3d3...08f4237. Read the comment docs.