Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dissimilarity functions #609

Merged
merged 66 commits into from
Aug 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9ed9847
up
TuomasBorman Jul 9, 2024
eec738e
up
TuomasBorman Jul 9, 2024
b701bc1
small fix
thpral Jul 12, 2024
ea6cef7
addDissimilarity function
thpral Jul 12, 2024
4eadecb
fix addDissimilarity
thpral Jul 12, 2024
92fc388
rename JSD and overlap functions
thpral Jul 12, 2024
318501c
man page getDissimilarity
thpral Jul 12, 2024
023636a
rename unifrac functions
thpral Jul 16, 2024
b77acda
Merge branch 'devel' into getDissimilarity
thpral Jul 16, 2024
3d572fa
fix R check warnings
thpral Jul 16, 2024
3685b9b
Merge branch 'getDissimilarity' of https://github.com/microbiome/mia …
thpral Jul 16, 2024
94c13dd
fix getUnifrac SE method
thpral Jul 18, 2024
5af8d57
Merge branch 'devel' into getDissimilarity
antagomir Jul 22, 2024
e988335
fix naming .get_jsd
thpral Jul 22, 2024
ea73d22
remove generic methods for jsd, overlap and unifrac
thpral Jul 22, 2024
b36362c
Merge branch 'getDissimilarity' of https://github.com/microbiome/mia …
thpral Jul 23, 2024
0f84fbb
fix argument types in documentation
thpral Jul 23, 2024
3e1d774
merge devel
thpral Jul 24, 2024
0629c58
fix overlap tests with getDissimilarity
thpral Jul 24, 2024
faf0308
fix error in unifrac
thpral Jul 24, 2024
4dd452f
update pckgdown
thpral Jul 25, 2024
fef4dcd
modify inheritance in man pages
thpral Jul 29, 2024
272baa6
fix documentation
thpral Jul 29, 2024
888c3ee
try to fix unifrac node.label argument
thpral Jul 29, 2024
171354c
up
TuomasBorman Jul 30, 2024
a574a58
Merge branch 'devel' into getDissimilarity
thpral Aug 1, 2024
0db5240
add unifrac, overlap and jsd documentation in getDissimilarity manual…
thpral Aug 1, 2024
f3af07f
merge devel
thpral Aug 1, 2024
53f0d1b
update doc getDissimilarity
thpral Aug 1, 2024
ebfcaaf
deprecate dissimilarity functions
thpral Aug 1, 2024
7b1186e
add check to .add_values_to_reducedDims
thpral Aug 1, 2024
327fd4f
fix deprecated functions and .add_values_to_reducedDims
thpral Aug 2, 2024
01f7fd4
Merge branch 'devel' into getDissimilarity
antagomir Aug 5, 2024
fc05582
up
TuomasBorman Aug 6, 2024
043ffcc
up
TuomasBorman Aug 6, 2024
99fc8a4
Merge branch 'devel' into getDissimilarity
antagomir Aug 6, 2024
09f78cc
address review comments
thpral Aug 7, 2024
b1a67e8
up
thpral Aug 7, 2024
488ff09
add tests for getDissimililarity
thpral Aug 7, 2024
19b3d5f
fix braces in .add_values_to_reducedDims
thpral Aug 7, 2024
d13e17a
add missing argument to runDPCoA documentation
thpral Aug 7, 2024
3aa881d
up
TuomasBorman Aug 8, 2024
914ecae
Simplify. Add method for TreeSE.
TuomasBorman Aug 8, 2024
763cf8c
address review comments
thpral Aug 8, 2024
3038c6b
deprecate runUnifrac
thpral Aug 8, 2024
b04ebf7
add dis matrix to metadata instead of reducedDims
thpral Aug 8, 2024
d89377a
fix getDissimilarity examples and doc
thpral Aug 8, 2024
374c73a
Merge branch 'devel' into getDissimilarity
TuomasBorman Aug 9, 2024
fc44f98
up
TuomasBorman Aug 9, 2024
3d94de9
up
TuomasBorman Aug 9, 2024
c30bf17
up
TuomasBorman Aug 9, 2024
4f16e17
up
TuomasBorman Aug 9, 2024
a27259b
add rarefaction test
thpral Aug 9, 2024
fba150f
up
thpral Aug 9, 2024
cb373d8
Merge branch 'devel' into getDissimilarity
thpral Aug 10, 2024
90ef724
address review comment
thpral Aug 10, 2024
a72dbc2
Merge branch 'getDissimilarity' of https://github.com/microbiome/mia …
thpral Aug 10, 2024
5a2c0be
setting seed in rarefaction tests
thpral Aug 10, 2024
1937528
merge devel
thpral Aug 11, 2024
d6b348a
up
TuomasBorman Aug 13, 2024
376792d
up
TuomasBorman Aug 13, 2024
5c84f17
up
TuomasBorman Aug 13, 2024
dd6bd53
fix rarefaction tests
thpral Aug 13, 2024
ee1557e
up
thpral Aug 13, 2024
616bec2
up
thpral Aug 13, 2024
585cc9b
up
TuomasBorman Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
up
  • Loading branch information
thpral committed Aug 13, 2024
commit ee1557e073032e78a89ad7f1486d19c9aaf56465
22 changes: 2 additions & 20 deletions tests/testthat/test-5getDissimilarity.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,10 @@ test_that("Dissimilarity calculation", {
mat <- assay(tse, "counts")
expect_equal(as.matrix(vegan::vegdist(t(mat), "euclidean")),
as.matrix(getDissimilarity(tse, method = "euclidean")))
# Test rarefaction
ntop <- 5
tse_sub <- tse[head(rev(order(rowSds(assay(tse, "counts")))), ntop), ]
mat <- assay(tse_sub, "counts")
clr <- function (x) {
vegan::decostand(x, method="clr", pseudocount=1)
}
set.seed(123)
res1 <- vegan::avgdist(t(mat), distfun = vegdist, dmethod = "euclidean",
sample = min(colSums2(mat)), iterations = 10,
transf = clr)
set.seed(123)
res2 <- getDissimilarity(tse_sub, method = "euclidean", niter = 10,
transf = clr)
tse <- GlobalPatterns
# Test if Unifrac dissimilarity works with external tree
expect_equal(getDissimilarity(tse, method = "unifrac"),
getDissimilarity(tse, tree = rowTree(tse), method = "unifrac"))
# Test if results from vegan::vegdist are equal to getDissimilarity results
mat <- assay(tse, "counts")
expect_equal(as.matrix(vegan::vegdist(t(mat), "euclidean")),
as.matrix(getDissimilarity(tse, method = "euclidean")))
# Test rarefaction
ntop <- 5
tse_sub <- tse[head(rev(order(rowSds(assay(tse, "counts")))), ntop), ]
Expand All @@ -40,8 +22,8 @@ test_that("Dissimilarity calculation", {
}
set.seed(123)
res1 <- vegan::avgdist(t(mat), distfun = vegdist, dmethod = "euclidean",
sample = min(colSums2(mat)), iterations = 10,
transf = clr)
sample = as.integer(min(colSums2(mat))),
iterations = 10, transf = clr)
set.seed(123)
res2 <- getDissimilarity(tse_sub, method = "euclidean", niter = 10,
transf = clr)
Expand Down
Loading