From c051b515a05f4172c4421df5e519ee6cec8a0c63 Mon Sep 17 00:00:00 2001 From: aduvermy <arnaud.duvermy@ens-lyon.fr> Date: Wed, 17 Jan 2024 11:34:24 +0100 Subject: [PATCH] try relaunch CI --- dev/flat_full.Rmd | 12 ++++++------ vignettes/htrfit.Rmd | 23 +++++++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/dev/flat_full.Rmd b/dev/flat_full.Rmd index 738abec..94bb04c 100644 --- a/dev/flat_full.Rmd +++ b/dev/flat_full.Rmd @@ -9560,7 +9560,7 @@ l_tmb <- fitModelParallel(formula = kij ~ varA, As the model family can be customized, HTRfit is not exclusively tailored for RNA-seq data. -```{r example-fitModelParallel_nonRNA, warning=FALSE, message=FALSE, eval=FALSE} +```{r example-fitModelParallel_nonRNA, warning=FALSE, message=FALSE} data("iris") l_tmb_iris <- fitModelParallel(formula = Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width , data = iris, @@ -9571,7 +9571,7 @@ l_tmb_iris <- fitModelParallel(formula = Sepal.Length ~ Sepal.Width + Petal.Len ## Extracts a tidy result table from a list tmb object -The tidy_results function extracts a dataframe containing estimates of ln(fold changes), standard errors, test statistics, p-values, and adjusted p-values for fixed effects. Additionally, it provides access to correlation terms and standard deviations for random effects, offering a detailed view of HTRfit modeling results. +The tidy_results function extracts a data frame containing estimates of ln(fold changes), standard errors, test statistics, p-values, and adjusted p-values for fixed effects. Additionally, it provides access to correlation terms and standard deviations for random effects, offering a detailed view of HTRfit modeling results. ```{r example-tidyRes, warning=FALSE, message=FALSE} ## -- get tidy results @@ -9648,7 +9648,7 @@ l_anova <- anovaParallel(list_tmb = l_tmb, type = "III" ) In this section, we delve into the evaluation of your simulation results. The `evaluation_report()` function provide valuable insights into the performance of your simulated data and models. -```{r example-evaluation_report, warning = FALSE, message = FALSE, results='hide', fig.keep='none'} +```{r example-evaluation_report, warning = FALSE, message = FALSE} ## -- get simulation/fit evaluation resSimu <- evaluation_report(list_tmb = l_tmb, dds = NULL, @@ -9761,7 +9761,7 @@ resSimu$performances In this section, we showcase the assessment of model performance on a subset of genes. Specifically, we focus on evaluating genes with low expression levels, identified by their basal expression ($bexpr_i$) initialized below 0 during the simulation. -```{r example-subsetGenes, warning = FALSE, message = FALSE, results='hide', fig.keep='none'} +```{r example-subsetGenes, warning = FALSE, message = FALSE} ## -- Focus on low expressed genes low_expressed_df <- mock_data$groundTruth$effects[ mock_data$groundTruth$effects$basalExpr < 0, ] l_genes <- unique(low_expressed_df$geneID) @@ -9828,9 +9828,9 @@ resSimu$performances For certain experimental scenarios, such as those involving a high number of levels or longitudinal data, the utilization of mixed effects within your design formula can be beneficial. The **HTRfit** simulation framework also offers the capability to assess this type of design formula. -```{r example-evalMixed, warning = FALSE, message = FALSE, results='hide', fig.keep='none'} +```{r example-evalMixed, warning = FALSE, message = FALSE} ## -- init a design with a high number of levels -input_var_list <- init_variable( name = "varA", mu = 0, sd = 0.29, level = 60) %>% +input_var_list <- init_variable( name = "varA", mu = 0.2, sd = 0.74, level = 60) %>% init_variable( name = "varB", mu = 0.27, sd = 0.6, level = 2) %>% add_interaction( between_var = c("varA", "varB"), mu = 0.44, sd = 0.89) ## -- simulate RNAseq data diff --git a/vignettes/htrfit.Rmd b/vignettes/htrfit.Rmd index 12444de..cc567c0 100644 --- a/vignettes/htrfit.Rmd +++ b/vignettes/htrfit.Rmd @@ -15,7 +15,6 @@ knitr::opts_chunk$set( ``` ```{r setup} -devtools::load_all() library(HTRfit) ``` @@ -130,13 +129,13 @@ MIN_REPLICATES = 2 MAX_REPLICATES = 10 ######################## -## -- simulate RNAseq data based on input_var_list, minimum input required +## -- simulate RNAseq data based on list_var, minimum input required ## -- number of replicate randomly defined between MIN_REP and MAX_REP mock_data <- mock_rnaseq(list_var, N_GENES, min_replicates = MIN_REPLICATES, max_replicates = MAX_REPLICATES) -## -- simulate RNAseq data based on input_var_list, minimum input required +## -- simulate RNAseq data based on list_var, minimum input required ## -- Same number of replicates between conditions mock_data <- mock_rnaseq(list_var, N_GENES, min_replicates = MAX_REPLICATES, @@ -321,7 +320,7 @@ l_tmb <- fitModelParallel(formula = kij ~ varA, As the model family can be customized, HTRfit is not exclusively tailored for RNA-seq data. -```{r example-fitModelParallel_nonRNA, warning = FALSE, message = FALSE, eval = TRUE} +```{r example-fitModelParallel_nonRNA, warning = FALSE, message = FALSE} data("iris") l_tmb_iris <- fitModelParallel(formula = Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width , data = iris, @@ -332,7 +331,7 @@ l_tmb_iris <- fitModelParallel(formula = Sepal.Length ~ Sepal.Width + Petal.Len ## Extracts a tidy result table from a list tmb object -The tidy_results function extracts a dataframe containing estimates of ln(fold changes), standard errors, test statistics, p-values, and adjusted p-values for fixed effects. Additionally, it provides access to correlation terms and standard deviations for random effects, offering a detailed view of HTRfit modeling results. +The tidy_results function extracts a data frame containing estimates of ln(fold changes), standard errors, test statistics, p-values, and adjusted p-values for fixed effects. Additionally, it provides access to correlation terms and standard deviations for random effects, offering a detailed view of HTRfit modeling results. ```{r example-tidyRes, warning = FALSE, message = FALSE} @@ -408,7 +407,7 @@ l_anova <- anovaParallel(list_tmb = l_tmb, type = "III" ) In this section, we delve into the evaluation of your simulation results. The `evaluation_report()` function provide valuable insights into the performance of your simulated data and models. -```{r example-evaluation_report, warning = FALSE, message = FALSE, results = 'hide', fig.keep = 'none'} +```{r example-evaluation_report, warning = FALSE, message = FALSE} ## -- get simulation/fit evaluation resSimu <- evaluation_report(list_tmb = l_tmb, dds = NULL, @@ -523,7 +522,7 @@ resSimu$performances In this section, we showcase the assessment of model performance on a subset of genes. Specifically, we focus on evaluating genes with low expression levels, identified by their basal expression ($bexpr_i$) initialized below 0 during the simulation. -```{r example-subsetGenes, warning = FALSE, message = FALSE, results = 'hide', fig.keep = 'none'} +```{r example-subsetGenes, warning = FALSE, message = FALSE} ## -- Focus on low expressed genes low_expressed_df <- mock_data$groundTruth$effects[ mock_data$groundTruth$effects$basalExpr < 0, ] l_genes <- unique(low_expressed_df$geneID) @@ -589,9 +588,9 @@ resSimu$performances For certain experimental scenarios, such as those involving a high number of levels or longitudinal data, the utilization of mixed effects within your design formula can be beneficial. The **HTRfit** simulation framework also offers the capability to assess this type of design formula. -```{r example-evalMixed, warning = FALSE, message = FALSE, results = 'hide', fig.keep = 'none'} +```{r example-evalMixed, warning = FALSE, message = FALSE} ## -- init a design with a high number of levels -input_var_list <- init_variable( name = "varA", mu = 0, sd = 0.29, level = 60) %>% +input_var_list <- init_variable( name = "varA", mu = 0.2, sd = 0.74, level = 60) %>% init_variable( name = "varB", mu = 0.27, sd = 0.6, level = 2) %>% add_interaction( between_var = c("varA", "varB"), mu = 0.44, sd = 0.89) ## -- simulate RNAseq data @@ -643,7 +642,11 @@ str(resSimu, max.level = 1) ## About mixed model evaluation -**HTRfit** offers a versatile simulation framework capable of fitting various types of models involving mixed effects, thanks to its implementation of **glmmTMB**. By combining the functionalities of `init_variable()` and `add_interaction()`, **HTRfit** enables the simulation of even the most complex experimental designs. However, it's important to note that as of now, HTRfit supports the evaluation of only *Type I* mixed models. In this context, *Type I* models are defined as those that follow the structure: `~ varA + (1 | varB)` or `~ varA + (varA | varB)`. Models not conforming to this specific form cannot be evaluated using **HTRfit's** current implementation. Nonetheless, you are welcome to extend its capabilities by implementing support for additional model types. +**HTRfit** offers a versatile simulation framework capable of fitting various types of models involving mixed effects, thanks to its implementation of **glmmTMB**. By combining the functionalities of `init_variable()` and `add_interaction()`, **HTRfit** enables the simulation of complex experimental designs. As of now, HTRfit supports the evaluation of *Type I* mixed models. In this context, *Type I* models are defined as those that follow the structure: +- `~ varA + (1 | varB)` : where `varA` is defined as fixed effect and `varB` as random effect +- `~ varA + (varA | varB)`: where `varA` is defined as mixed effect (fixed + random) and `varB` as random effect. + +Models not conforming to this specific form cannot be evaluated using **HTRfit's** current implementation. Nonetheless, you are welcome to extend its capabilities by implementing support for additional model types. -- GitLab