From 8b26e40c2a3d6a384744a6a0407d00c72e97f733 Mon Sep 17 00:00:00 2001 From: June Choe Date: Tue, 19 Mar 2024 11:45:22 -0400 Subject: [PATCH] show animation in readme --- README.Rmd | 10 +++++- README.md | 2 +- docs/index.html | 34 +++++++++---------- .../reference/figures/README-/CPA-io-dark.svg | 2 +- docs/reference/figures/README-/CPA-io.svg | 2 +- .../figures/README-/reCPA-io-dark.svg | 2 +- docs/reference/figures/README-/reCPA-io.svg | 2 +- .../figures/README-/setup-io-dark.svg | 2 +- docs/reference/figures/README-/setup-io.svg | 2 +- man/figures/README-/CPA-io-dark.svg | 2 +- man/figures/README-/CPA-io.svg | 2 +- man/figures/README-/reCPA-io-dark.svg | 2 +- man/figures/README-/reCPA-io.svg | 2 +- man/figures/README-/setup-io-dark.svg | 2 +- man/figures/README-/setup-io.svg | 2 +- 15 files changed, 39 insertions(+), 31 deletions(-) diff --git a/README.Rmd b/README.Rmd index 487fedb..c3b67dd 100644 --- a/README.Rmd +++ b/README.Rmd @@ -33,7 +33,15 @@ asciicast::init_knitr_engine( Julia [GLM.jl](https://github.com/JuliaStats/GLM.jl) and [MixedModels.jl](https://github.com/JuliaStats/MixedModels.jl) based implementation of the cluster-based permutation test for time series data, powered by [JuliaConnectoR](https://github.com/stefan-m-lenz/JuliaConnectoR). -![](man/figures/clusterpermute_slice.png) +```{r, echo = FALSE} +is_markdown_output <- grepl("markdown", knitr::opts_knit$get("out.format")) +fig <- if (is_markdown_output) { + "man/figures/clusterpermute_animation.gif" +} else { + "man/figures/clusterpermute_slice.png" +} +knitr::include_graphics(fig, error = FALSE) +``` ## Installation and usage diff --git a/README.md b/README.md index e249aef..35fe633 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ implementation of the cluster-based permutation test for time series data, powered by [JuliaConnectoR](https://github.com/stefan-m-lenz/JuliaConnectoR). -![](man/figures/clusterpermute_slice.png) + ## Installation and usage diff --git a/docs/index.html b/docs/index.html index 16abb59..a010a94 100644 --- a/docs/index.html +++ b/docs/index.html @@ -29,15 +29,15 @@ Skip to contents - +

Julia GLM.jl and MixedModels.jl based implementation of the cluster-based permutation test for time series data, powered by JuliaConnectoR.

-

+

Installation and usage

@@ -115,7 +115,7 @@

Installation and usage# Both lines must be run at the start of each new session library(jlmerclusterperm) jlmerclusterperm_setup()

-

+

See the Get Started page on the package website for background and tutorials.

@@ -142,7 +142,7 @@

Wholesale CPA with clusterpermu subject = "Chick", time = "Time" ) chickweights_spec

-

+

Cluster-based permutation test with clusterpermute():

 set_rng_state(123L)
@@ -151,7 +151,7 @@ 

Wholesale CPA with clusterpermu threshold = 2.5, nsim = 100 )

-

+

Including random effects:

 chickweights_re_spec <- make_jlmer_spec(
@@ -165,7 +165,7 @@ 

Wholesale CPA with clusterpermu threshold = 2.5, nsim = 100 )$empirical_clusters

-

+

Piecemeal approach to CPA @@ -180,22 +180,22 @@

Piecemeal approach to CPA
 empirical_clusters <- extract_empirical_clusters(empirical_statistics, threshold = 2.5)
 empirical_clusters

-

+

Simulating the null distribution:

 set_rng_state(123L)
 null_statistics <- permute_timewise_statistics(chickweights_spec, nsim = 100)
 null_cluster_dists <- extract_null_cluster_dists(null_statistics, threshold = 2.5)
 null_cluster_dists
-

+

Significance testing the cluster-mass statistic:

 calculate_clusters_pvalues(empirical_clusters, null_cluster_dists, add1 = TRUE)
-

+

Iterating over a range of threshold values:

 walk_threshold_steps(empirical_statistics, null_statistics, steps = c(2, 2.5, 3))
-

+

@@ -301,9 +301,9 @@

Dev status

- - + + diff --git a/docs/reference/figures/README-/CPA-io-dark.svg b/docs/reference/figures/README-/CPA-io-dark.svg index d253d7a..d844887 100644 --- a/docs/reference/figures/README-/CPA-io-dark.svg +++ b/docs/reference/figures/README-/CPA-io-dark.svg @@ -1 +1 @@ -────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[23ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.18ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[955mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file +────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[27ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[934mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[21ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file diff --git a/docs/reference/figures/README-/CPA-io.svg b/docs/reference/figures/README-/CPA-io.svg index 6e728bd..6c24ac2 100644 --- a/docs/reference/figures/README-/CPA-io.svg +++ b/docs/reference/figures/README-/CPA-io.svg @@ -1 +1 @@ -────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[23ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.18ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[955mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file +────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[27ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[934mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[21ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file diff --git a/docs/reference/figures/README-/reCPA-io-dark.svg b/docs/reference/figures/README-/reCPA-io-dark.svg index 627feb7..1806cf5 100644 --- a/docs/reference/figures/README-/reCPA-io-dark.svg +++ b/docs/reference/figures/README-/reCPA-io-dark.svg @@ -1 +1 @@ -Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.5s]Progress:100%|████████████████████████████████████|Time:0:00:00(7.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[958mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[18ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file +Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.4s]Progress:100%|████████████████████████████████████|Time:0:00:00(6.37ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[869mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file diff --git a/docs/reference/figures/README-/reCPA-io.svg b/docs/reference/figures/README-/reCPA-io.svg index b161f77..3af4fb7 100644 --- a/docs/reference/figures/README-/reCPA-io.svg +++ b/docs/reference/figures/README-/reCPA-io.svg @@ -1 +1 @@ -Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.5s]Progress:100%|████████████████████████████████████|Time:0:00:00(7.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[958mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[18ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file +Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.4s]Progress:100%|████████████████████████████████████|Time:0:00:00(6.37ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[869mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file diff --git a/docs/reference/figures/README-/setup-io-dark.svg b/docs/reference/figures/README-/setup-io-dark.svg index 809916b..1ea6e4a 100644 --- a/docs/reference/figures/README-/setup-io-dark.svg +++ b/docs/reference/figures/README-/setup-io-dark.svg @@ -1 +1 @@ -StartingJuliawith7threads[2.9s]Activatingpackageenvironment[9.2s]Runningpackagesetupscripts(11/11)[8.8s] \ No newline at end of file +StartingJuliawith7threads[2.9s]Activatingpackageenvironment[8.1s]Runningpackagesetupscripts(11/11)[7.4s] \ No newline at end of file diff --git a/docs/reference/figures/README-/setup-io.svg b/docs/reference/figures/README-/setup-io.svg index 3f47962..b26f78a 100644 --- a/docs/reference/figures/README-/setup-io.svg +++ b/docs/reference/figures/README-/setup-io.svg @@ -1 +1 @@ -StartingJuliawith7threads[2.9s]Activatingpackageenvironment[9.2s]Runningpackagesetupscripts(11/11)[8.8s] \ No newline at end of file +StartingJuliawith7threads[2.9s]Activatingpackageenvironment[8.1s]Runningpackagesetupscripts(11/11)[7.4s] \ No newline at end of file diff --git a/man/figures/README-/CPA-io-dark.svg b/man/figures/README-/CPA-io-dark.svg index d253d7a..d844887 100644 --- a/man/figures/README-/CPA-io-dark.svg +++ b/man/figures/README-/CPA-io-dark.svg @@ -1 +1 @@ -────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[23ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.18ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[955mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file +────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[27ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[934mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[21ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file diff --git a/man/figures/README-/CPA-io.svg b/man/figures/README-/CPA-io.svg index 6e728bd..6c24ac2 100644 --- a/man/figures/README-/CPA-io.svg +++ b/man/figures/README-/CPA-io.svg @@ -1 +1 @@ -────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[23ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.18ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[955mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file +────────────────────────────────────────────────────────────────────────────────Detectingempiricalclustersandcalculatingcluster-massstatistics.[27ms]Progress:100%|████████████████████████████████████|Time:0:00:00(5.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[934mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[21ms]$null_cluster_dists──Nullcluster-massdistribution(t>2.5)────────────<null_cluster_dists>──Diet2(n=100)Mean(SD):-0.039(1.89)Coverageintervals:95%[-2.862,0.000]Diet3(n=100)Mean(SD):-0.129(2.02)Coverageintervals:95%[0.000,0.000]Diet4(n=100)Mean(SD):0.296(3.21)Coverageintervals:95%[0.000,5.797]$empirical_clusters──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.121(p=0.0495)Diet3[3,12]:35.769(p=0.0099)Diet4[2,8]:32.442(p=0.0099) \ No newline at end of file diff --git a/man/figures/README-/reCPA-io-dark.svg b/man/figures/README-/reCPA-io-dark.svg index 627feb7..1806cf5 100644 --- a/man/figures/README-/reCPA-io-dark.svg +++ b/man/figures/README-/reCPA-io-dark.svg @@ -1 +1 @@ -Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.5s]Progress:100%|████████████████████████████████████|Time:0:00:00(7.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[958mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[18ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file +Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.4s]Progress:100%|████████████████████████████████████|Time:0:00:00(6.37ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[869mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file diff --git a/man/figures/README-/reCPA-io.svg b/man/figures/README-/reCPA-io.svg index b161f77..3af4fb7 100644 --- a/man/figures/README-/reCPA-io.svg +++ b/man/figures/README-/reCPA-io.svg @@ -1 +1 @@ -Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.5s]Progress:100%|████████████████████████████████████|Time:0:00:00(7.05ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[958mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[18ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file +Detectingempiricalclustersandcalculatingcluster-massstatistics.[5.4s]Progress:100%|████████████████████████████████████|Time:0:00:00(6.37ms/it)Samplingcluster-massstatisticsfromabootstrappednulldistribution.[869mCalculatingtheprobabilityoftheobservedcluster-massstatistics.[12ms]──Empiricalclusters(t>2.5)────────────────────────<empirical_clusters>──Diet2[3,4]:6.387(p=0.0594)Diet3[2,12]:39.919(p=0.0099)Diet4[2,8]:33.853(p=0.0099)──────────────────────────────────────────────────────────────────────────────── \ No newline at end of file diff --git a/man/figures/README-/setup-io-dark.svg b/man/figures/README-/setup-io-dark.svg index 809916b..1ea6e4a 100644 --- a/man/figures/README-/setup-io-dark.svg +++ b/man/figures/README-/setup-io-dark.svg @@ -1 +1 @@ -StartingJuliawith7threads[2.9s]Activatingpackageenvironment[9.2s]Runningpackagesetupscripts(11/11)[8.8s] \ No newline at end of file +StartingJuliawith7threads[2.9s]Activatingpackageenvironment[8.1s]Runningpackagesetupscripts(11/11)[7.4s] \ No newline at end of file diff --git a/man/figures/README-/setup-io.svg b/man/figures/README-/setup-io.svg index 3f47962..b26f78a 100644 --- a/man/figures/README-/setup-io.svg +++ b/man/figures/README-/setup-io.svg @@ -1 +1 @@ -StartingJuliawith7threads[2.9s]Activatingpackageenvironment[9.2s]Runningpackagesetupscripts(11/11)[8.8s] \ No newline at end of file +StartingJuliawith7threads[2.9s]Activatingpackageenvironment[8.1s]Runningpackagesetupscripts(11/11)[7.4s] \ No newline at end of file