waldronlab / lefser

R implementation of the LEfSe method
https://waldronlab.io/lefser/
38 stars 6 forks source link

Append and created a testthat unit test of the fix #34

Closed Peacesandy closed 4 months ago

Peacesandy commented 5 months ago
  1. Appended * 1e6 to line 28 and made some modifications to the code base
  2. create a testthat unit test of the fix on the file testthat.R

Console output after running the code

Warning (test-lefser.R:14:3): lefser and lefserPlot work Convert counts to relative abundances with 'relativeAb()' Backtrace: ▆

  1. ├─testthat::expect_error(lefser(zellersub, groupCol = NULL, blockCol = NULL)) at test-lefser.R:14:3
  2. │ └─testthat:::quasi_capture(...)
  3. │ ├─testthat (local) .capture(...)
  4. │ │ └─base::withCallingHandlers(...)
  5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  6. └─lefser::lefser(zellersub, groupCol = NULL, blockCol = NULL)

Warning (test-lefser.R:15:3): lefser and lefserPlot work Convert counts to relative abundances with 'relativeAb()' Backtrace: ▆

  1. ├─withr::with_seed(...) at test-lefser.R:15:3
  2. │ └─withr::with_preserve_seed(...)
  3. └─lefser::lefser(zellersub, groupCol = "study_condition", blockCol = NULL)

Warning (test-lefser.R:26:3): lefser and lefserPlot work Convert counts to relative abundances with 'relativeAb()' Backtrace: ▆

  1. ├─withr::with_seed(...) at test-lefser.R:26:3
  2. │ └─withr::with_preserve_seed(...)
  3. └─lefser::lefser(zellersub, groupCol = "study_condition", blockCol = "age_category") ───────────────────────────────────────────────────────────────────────────────────

══ Results ════════════════════════════════════════════════════════════════════════ Duration: 5.9 s

[ FAIL 0 | WARN 3 | SKIP 0 | PASS 15 ]

1.For the append task

I'm open to corrections and feedbacks and possibility to restructure the code if it's not correct

lwaldron commented 5 months ago

(note I just updated my comments)

Peacesandy commented 5 months ago

Okay, I'll make the changes and get back

Peacesandy commented 4 months ago
Peacesandy commented 4 months ago

Resolved all comments - I just pushed a commit

lwaldron commented 4 months ago

Great! Are test and check passing?

Peacesandy commented 4 months ago

Great! Are test and check passing?

Yes they are

The output on the console

``` [ FAIL 0 | WARN 0 | SKIP 0 | PASS 0 ][ FAIL 0 | WARN 0 | SKIP 1 | PASS 0 ]

══ Skipped tests (1) ══════════════════════════════════════════════════════════════════ • identical(Sys.getlocale("LC_COLLATE"), "en_US.UTF-8") is not TRUE (1): test-lefser.R:6:3

[ FAIL 0 | WARN 0 | SKIP 1 | PASS 0 ] [ FAIL 0 | WARN 0 | SKIP 0 | PASS 4 ]> ```

lwaldron commented 4 months ago

I made 2 final changes:

  1. deleted again the documentation of assay that I told you to add! It was actually covered by @inheritParams
  2. fixed the unit tests that were only done on US locale, since results change now that we use CPM instead of fraction. The numeric tests should ideally be changed to be done on any locale.
lwaldron commented 4 months ago

Great work @Peacesandy !!!

Peacesandy commented 4 months ago

Thank you so much @lwaldron I really learnt a lot