From 6d412746f844265934a00d4de5e7761edf6868d7 Mon Sep 17 00:00:00 2001 From: aduvermy <arnaud.duvermy@ens-lyon.fr> Date: Thu, 18 Jan 2024 20:40:55 +0100 Subject: [PATCH] delete useless --- vignettes/tutorials/htrfit.Rmd | 602 -------------------------- vignettes/tutorials/test_vignette.Rmd | 20 - 2 files changed, 622 deletions(-) delete mode 100644 vignettes/tutorials/htrfit.Rmd delete mode 100644 vignettes/tutorials/test_vignette.Rmd diff --git a/vignettes/tutorials/htrfit.Rmd b/vignettes/tutorials/htrfit.Rmd deleted file mode 100644 index 25cd389..0000000 --- a/vignettes/tutorials/htrfit.Rmd +++ /dev/null @@ -1,602 +0,0 @@ ---- -title: "HTRfit" -output: rmarkdown::html_vignette -vignette: > - %\VignetteIndexEntry{htrfit} - %\VignetteEngine{knitr::rmarkdown} - %\VignetteEncoding{UTF-8} ---- - -```{r, include = FALSE} -knitr::opts_chunk$set( - collapse = TRUE, - comment = "#>" -) -``` - -```{r setup} -library(HTRfit) -``` - -<!-- WARNING - This vignette is generated by {fusen} from /dev/flat_full.Rmd: do not edit by hand --> - -<!-- Run this 'development' chunk --> -<!-- Store every call to library() that you need to explore your functions --> - - -<!-- - You need to run the 'description' chunk in the '0-dev_history.Rmd' file before continuing your code there. - -If it is the first time you use {fusen}, after 'description', you can directly run the last chunk of the present file with inflate() inside. ---> - - -# High-Throughput RNA-seq model fit - -In the realm of RNAseq analysis, various key experimental parameters play a crucial role in influencing the statistical power to detect expression changes. Parameters such as sequencing depth, the number of replicates, and others are expected to impact this statistical power. To help with the selection of optimal values for these experimental parameters, we introduce a comprehensive statistical framework known as **HTRfit**, underpinned by computational simulation. **HTRfit** serves as a versatile tool, not only for simulation but also for conducting differential expression analysis. It facilitates this analysis by fitting Generalized Linear Models (GLMs) with multiple variables, which could encompass genotypes, environmental factors, and more. These GLMs are highly adaptable, allowing the incorporation of fixed effects, mixed effects, and interactions between variables. - - - - -# Initializing variables for simulation - -The `init_variable()` function is used for defining the variables in your experimental design. Sizes of effects for each variable and interaction term can be defined in two different ways: 1) The user can manually sets values of all levels of a variable, in which case the effects are necessarily considered fixed in the model; 2) The effects can be randomly picked in a normal distribution with mean and standard deviation defined by the user, in which case the user can decide whether the effects are considered fixed or random in the model. - - - -## Manually init a single variable - -The `init_variable()` function allows for precise control over the variables in your experimental design. -In this example, we manually initialize **varA** with specific size effects (mu) for three levels. - - - -```{r example-init_variable_man, warning = FALSE, message = FALSE} -list_var <- init_variable( name = "varA", mu = c(0.2, 4, -3), level = 3) -``` - -## Randomly init a single variable - -Alternatively, you can randomly initialize **varA** by specifying a mean (mu) and standard deviation (sd). -This introduces variability into **varA**, making it either a fixed or random effect in your design. - - -```{r example-init_variable_rand, warning = FALSE, message = FALSE} -list_var <- init_variable( name = "varA", mu = 10, sd = 0.2, level = 5) -``` - -## Randomly init several variables - -You can also initialize multiple variables, such as **varA** and **varB**, with random values. -This flexibility allows you to create diverse experimental designs. - - - -```{r example-init_variable_mult, warning = FALSE, message = FALSE} -list_var <- init_variable( name = "varA", mu = 10, sd = 0.2, level = 5) %>% - init_variable( name = "varB", mu = -3, sd = 0.34, level = 2) -``` - -## Add interaction between variable - -Similarly to `init_variable()`, `add_interaction()` allows to define an interaction between variable. - -In this example, we initialize **varA** and **varB**, and create an interaction between **varA**, and **varB** using `add_interaction()`. - - - -```{r example-add_interaction, warning = FALSE, message = FALSE} -list_var <- init_variable( name = "varA", mu = 3, sd = 0.2, level = 2) %>% - init_variable( name = "varB", mu = 2, sd = 0.43, level = 2) %>% - add_interaction( between_var = c("varA", "varB"), mu = 0.44, sd = 0.2) -``` - -## Complex design - -Interactions can involve a maximum of three variables, such as **varA**, **varB**, and **varC**. - - - -```{r example-add_interaction_complex, eval = FALSE, message = FALSE, warning = FALSE, include = TRUE} -## /!\ not evaluated in Vignette -list_var <- init_variable( name = "varA", mu = 5, sd = 0.2, level = 2) %>% - init_variable( name = "varB", mu = 1, sd = 0.78, level = 2) %>% - init_variable( name = "varC", mu = c(2, 3), sd = NA, level = 2) %>% - add_interaction( between_var = c("varA", "varC"), mu = 0.44, sd = 0.2) %>% - add_interaction( between_var = c("varA", "varB"), mu = 0.43, sd = 0.37) %>% - add_interaction( between_var = c("varB", "varC"), mu = -0.33, sd = 0.12) %>% - add_interaction( between_var = c("varA", "varB" ,"varC"), mu = 0.87, sd = 0.18) -``` - -## Structure of list_var object - -```{r example-str_obj_init, warning = FALSE, message = FALSE} -str(list_var) -``` - -# Simulation of RNAseq data - -In this section, you will explore how to generate RNAseq data based on the previously defined input variables. The `mock_rnaseq()` function enables you to manage parameters in your RNAseq design, including number of genes, minimum and maximum number of replicates within your experimental setup, sequencing depth, basal expression of each gene, and dispersion of gene expression used for simulating counts. - - - -## Minimal example - -```{r example-mock_rnaseq_min, warning = FALSE, message = FALSE} -## -- Required parameters -N_GENES = 6000 -MIN_REPLICATES = 2 -MAX_REPLICATES = 10 -######################## - -## -- 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 list_var, minimum input required -## -- Same number of replicates between conditions -mock_data <- mock_rnaseq(list_var, N_GENES, - min_replicates = MAX_REPLICATES, - max_replicates = MAX_REPLICATES) -``` - -## Scaling genes counts based on sequencing depth - -Sequencing depth is a critical parameter affecting the statistical power of an RNAseq analysis. With the `sequencing_depth` option in the `mock_rnaseq()` function, you have the ability to control this parameter. - - -```{r example-mock_rnaseq_seqDepth, warning = FALSE, message = FALSE} -## -- Required parameters -N_GENES = 6000 -MIN_REPLICATES = 2 -MAX_REPLICATES = 10 -######################## - -SEQ_DEPTH = c(100000, 5000000, 10000000)## -- Possible number of reads/sample -SEQ_DEPTH = 10000000 ## -- all samples have same number of reads -mock_data <- mock_rnaseq(list_var, N_GENES, - min_replicates = MIN_REPLICATES, - max_replicates = MAX_REPLICATES, - sequencing_depth = SEQ_DEPTH) -``` - -## Set dispersion of gene expression - -The dispersion parameter ($dispersion_i$), characterizes the relationship between the variance of the observed read counts and its mean value. In simple terms, it quantifies how much we expect observed counts to deviate from the mean value. You can specify the dispersion for individual genes using the dispersion parameter. - - - -```{r example-mock_rnaseq_disp, warning = FALSE, message = FALSE} - -## -- Required parameters -N_GENES = 6000 -MIN_REPLICATES = 2 -MAX_REPLICATES = 4 -######################## - -DISP = 0.1 ## -- Same dispersion for each genes -DISP = 1000 ## -- Same dispersion for each genes -DISP = runif(N_GENES, 0, 1000) ## -- Dispersion can vary between genes -mock_data <- mock_rnaseq(list_var, N_GENES, - min_replicates = MIN_REPLICATES, - max_replicates = MAX_REPLICATES, - dispersion = DISP ) - -``` - -## Set basal gene expression - -The basal gene expression parameter, defined using the basal_expression option, allows you to control the fundamental baseline of expression level of genes. When a single value is specified, the basal expression of all genes is the same and the effects of variables defined in list_var are applied from this basal expression level. When several values are specified, the basal expression of each gene is picked randomly among these values (with replacement). The effects of variables are then applied from the basal expression of each gene. This represents the fact that expression levels can vary among genes even when not considering the effects of the defined variables (for example, some genes are constitutively more highly expressed than others because they have stronger basal promoters). - - -```{r example-mock_rnaseq_bexpr, warning = FALSE, message = FALSE} -## -- Required parameters -N_GENES = 6000 -MIN_REPLICATES = 10 -MAX_REPLICATES = 10 -######################## - -BASAL_EXPR = -3 ## -- Value can be negative to simulate low expressed gene -BASAL_EXPR = 2 ## -- Same basal gene expression for the N_GENES -BASAL_EXPR = c( -3, -1, 2, 8, 9, 10 ) ## -- Basal expression can vary between genes -mock_data <- mock_rnaseq(list_var, N_GENES, - min_replicates = MIN_REPLICATES, - max_replicates = MAX_REPLICATES, - basal_expression = BASAL_EXPR) - -``` - -## Mock RNAseq object - -```{r example-str_obj_mock, warning = FALSE, message = FALSE} -str(mock_data, max.level = 1) -``` - -# Theory behind HTRfit - -<div id="bg" align="center"> - <img src="./figs/htrfit_workflow.png" width="500" height="300"> -</div> - - -In this modeling framework, counts denoted as $K_{ij}$ for gene i and sample j are generated using a negative binomial distribution. The negative binomial distribution considers a fitted mean $\mu_{ij}$ and a gene-specific dispersion parameter $dispersion_i$. - -The fitted mean $\mu_{ij}$ is determined by a parameter, $q_{ij}$, which is proportionally related to the sum of all effects specified using `init_variable()` or `add_interaction()`. If basal gene expressions are provided, the $\mu_{ij}$ values are scaled accordingly using the gene-specific basal expression value ($bexpr_i$). - -Furthermore, the coefficients $\beta_i$ represent the natural logarithm fold changes for gene i across each column of the model matrix X. The dispersion parameter $dispersion_i$ plays a crucial role in defining the relationship between the variance of observed counts and their mean value. In simpler terms, it quantifies how far we expect observed counts to deviate from the mean value for each genes. - - - -# Fitting models - -## Prepare data for fitting - -The `prepareData2fit()` function serves the purpose of converting the counts matrix and sample metadata into a dataframe that is compatible with downstream **HTRfit** functions designed for model fitting. This function also includes an option to perform median ratio normalization on the data counts. - - - -```{r example-prepareData, warning = FALSE, message = FALSE} -## -- simulate small example to prevent excessively lengthy vignette construction -list_var <- init_variable( name = "varA", mu = 3, sd = 0.2, level = 2) %>% - init_variable( name = "varB", mu = 2, sd = 0.43, level = 2) %>% - add_interaction( between_var = c("varA", "varB"), mu = 0.44, sd = 0.2) -N_GENES = 30 -MIN_REPLICATES = 4 -MAX_REPLICATES = 4 -BASAL_EXPR = rnorm(N_GENES , 0 , 1 ) -mock_data <- mock_rnaseq(list_var, N_GENES, - min_replicates = MIN_REPLICATES, - max_replicates = MAX_REPLICATES, - basal_expression = BASAL_EXPR) -######################## - - -## -- data from simulation or real data -count_matrix <- mock_data$counts -metaData <- mock_data$metadata -############################## - -## -- convert counts matrix and samples metadatas in a data frame for fitting -data2fit = prepareData2fit(countMatrix = count_matrix, - metadata = metaData, - normalization = F, - response_name = "kij") - - -## -- median ratio normalization -data2fit = prepareData2fit(countMatrix = count_matrix, - metadata = metaData, - normalization = T, - response_name = "kij") -``` - -## Fit model from your data - -The `fitModelParallel()` function enables independent model fitting for each gene. The number of threads used for this process can be controlled by the `n.cores` parameter. - - -```{r example-fitModelParallel, warning = FALSE, message = FALSE} -l_tmb <- fitModelParallel(formula = kij ~ varA, - data = data2fit, - group_by = "geneID", - family = glmmTMB::nbinom2(link = "log"), - n.cores = 1) -``` - -## Use mixed effect in your model - -**HTRfit** uses the **glmmTMB** functions for model fitting algorithms. This choice allows for the utilization of random effects within your formula design. For further details on how to specify your model, please refer to the [mixed model documentation](https://rdrr.io/cran/glmmTMB/man/glmmTMBControl.html). - - - -```{r example-fitModelParallel_mixed, warning = FALSE, message = FALSE} -l_tmb <- fitModelParallel(formula = kij ~ varA + ( 1 | varB ), - data = data2fit, - group_by = "geneID", - family = glmmTMB::nbinom2(link = "log"), - n.cores = 1) -``` - -## Additional settings - -The function provides precise control over model settings for fitting optimization, including options for specifying the [model family](https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/family) and [model control setting](https://rdrr.io/cran/glmmTMB/man/glmmTMBControl.html). By default, a Gaussian family model is fitted, but for RNA-seq data, it is highly recommended to specify `family = glmmTMB::nbinom2(link = "log")`. - - - -```{r example-fitModelParallel_addSet, warning = FALSE, message = FALSE} -l_tmb <- fitModelParallel(formula = kij ~ varA, - data = data2fit, - group_by = "geneID", - n.cores = 1, - family = glmmTMB::nbinom2(link = "log"), - control = glmmTMB::glmmTMBControl(optCtrl=list(iter.max=1e5, - eval.max=1e5))) -``` - -## Not only RNAseq data - -As the model family can be customized, HTRfit is not exclusively tailored for RNA-seq data. - - -```{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, - group_by = "Species", - family = gaussian(), - n.cores = 1) -``` - -## Extracts a tidy result table from a list tmb object - -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 -tidy_results(l_tmb_iris, coeff_threshold = 0.1, alternative_hypothesis = "greaterAbs") -``` - -## Update fit - -The `updateParallel()` function updates and re-fits a model for each gene. It offers options similar to those in `fitModelParallel()`. - - -```{r example-update, warning = FALSE, message = FALSE} -## -- update your fit modifying the model family -l_tmb <- updateParallel(formula = kij ~ varA, - list_tmb = l_tmb , - family = gaussian(), - n.cores = 1) - -## -- update fit using additional model control settings -l_tmb <- updateParallel(formula = kij ~ varA , - list_tmb = l_tmb , - family = gaussian(), - n.cores = 1, - control = glmmTMB::glmmTMBControl(optCtrl=list(iter.max=1e3, - eval.max=1e3))) - - -## -- update your model formula and your family model -l_tmb <- updateParallel(formula = kij ~ varA + varB + varA:varB , - list_tmb = l_tmb , - family = glmmTMB::nbinom2(link = "log"), - n.cores = 1) -``` - -#### Struture of list tmb object - -```{r example-str_obj_l_tmb, warning = FALSE, message = FALSE} -str(l_tmb$gene1, max.level = 1) -``` - -## Plot fit metrics - -Visualizing fit metrics is essential for evaluating your models. Here, we show you how to generate various plots to assess the quality of your models. You can explore all metrics or focus on specific aspects like dispersion and log-likelihood. - - -```{r example-plotMetrics, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 8} -## -- plot all metrics -diagnostic_plot(list_tmb = l_tmb) -``` - -```{r example-plotMetricsFocus, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 3, fig.width = 8} -## -- Focus on metrics -diagnostic_plot(list_tmb = l_tmb, focus = c("dispersion", "logLik")) -``` - -## Anova to select the best model - -Utilizing the `anovaParallel()` function enables you to perform model selection by assessing the significance of the fixed effects. You can also include additional parameters like type. For more details, refer to [car::Anova](https://rdrr.io/cran/car/man/Anova.html). - - -```{r example-anova, warning = FALSE, message = FALSE} -## -- update your fit modifying the model family -l_anova <- anovaParallel(list_tmb = l_tmb) - -## -- additional settings -l_anova <- anovaParallel(list_tmb = l_tmb, type = "III" ) - -``` - -# Simulation evaluation report - -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} -## -- get simulation/fit evaluation -resSimu <- evaluation_report(list_tmb = l_tmb, - dds = NULL, - mock_obj = mock_data, - coeff_threshold = 0.4, - alpha_risk = 0.05, - alt_hypothesis = "greaterAbs") -``` - -## Identity plot - -The `evaluation_report()` function produces an identity plot, offering a visual tool to juxtapose the simulated effects (actual effects) with the model-inferred effects. This graphical representation simplifies assessing how well the model aligns with the values of the simulated effects, enabling a visual analysis of the model's goodness of fit to the simulated data. For a more quantitative evaluation of inference quality, the R-squared (R2) metric can be employed. - - -#### Model parameters - -```{r example-outputIdentity_params, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 5} -## -- Model params -resSimu$identity$params -``` - -#### Dispersion parameter - -```{r example-outputIdentity_disp, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 5} -## -- Dispersion params -resSimu$identity$dispersion -``` - -The dispersion plot, generated by the `evaluation_report()` function, offers a visual comparison of the dispersion parameters used in the simulation \(\alpha_i\) with those estimated by the model. This graphical representation provides an intuitive way to assess the alignment between the simulated dispersion values and the model-inferred values, enabling a visual evaluation of how well the model captures the underlying data characteristics. - - - -## ROC curve - -The Receiver Operating Characteristic (ROC) curve is a valuable tool for assessing the performance of classification models, particularly in the context of identifying differentially expressed genes. It provides a graphical representation of the model's ability to distinguish between genes that are differentially expressed and those that are not, by varying the `coeff_threshold` and the `alt_hypothesis` parameters. - - - -```{r example-outputROC, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 7} -## -- ROC curve -resSimu$roc$params -``` - -## Precision-recall curve - -The precision-recall curve (PR curve) illustrates the relationship between precision and recall at various classification thresholds. It is particularly valuable in the context of imbalanced data, where one class is significantly more prevalent than the other. Unlike the ROC curve, which can be influenced by class distribution, the PR curve focuses on the model's ability to correctly identify examples of the minority class while maintaining high precision. - - - -```{r example-outputPR, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 7} -## -- precision-recall curve -resSimu$precision_recall$params -``` - -## AUC and classification performance metrics - -The area under the ROC curve (AUC) provides a single metric that summarizes the model's overall performance in distinguishing between differentially expressed and non-differentially expressed genes. A higher AUC indicates better model performance. In the case of the ROC curve, this AUC should be compared to the value of 0.5, representing a random classifier. On the other hand, for the PR curve, we compute the pr_AUC_random, serving as a baseline for comparison. - - -In addition to evaluating model performance through the AUC for both ROC and PR curves, we provide access to key classification metrics, including Accuracy, Precision, Recall (or Sensitivity), and Specificity. These metrics offer a comprehensive view of the model's classification capabilities. These metrics are computed for each parameter (excluding the intercept when skip_eval_intercept = TRUE), providing detailed insights into individual parameter contributions. Furthermore, an aggregated assessment is performed, considering all parameters (except the intercept by default), offering a perspective on the model's overall classification effectiveness. - - - -```{r example-outputPerf, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 7} -## -- precision-recall curve -resSimu$performances -``` - -## Compare HTRfit with DESeq2 - -**HTRfit** offers a wrapper for **DESeq2** outputs. This functionality allows users to seamlessly integrate the results obtained from **DESeq2** into the **HTRfit** analysis pipeline. By doing so, you can readily compare the performance of **HTRfit** with **DESeq2** on your RNAseq data. This comparative analysis aids in determining which tool performs better for your specific research goals and dataset - - - -```{r example-ddsComparison, warning = FALSE, message = FALSE, results = 'hide', fig.keep = 'none'} -## -- DESeq2 -library(DESeq2) -dds <- DESeq2::DESeqDataSetFromMatrix( - countData = count_matrix, - colData = metaData, - design = ~ varA + varB + varA:varB ) -dds <- DESeq2::DESeq(dds, quiet = TRUE) - - -## -- get simulation/fit evaluation -resSimu <- evaluation_report(list_tmb = l_tmb, - dds = dds, - mock_obj = mock_data, - coeff_threshold = 0.4, - alt_hypothesis = "greaterAbs") -``` - -```{r example-outputResSimu_id, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 5} -## -- identity plot -###### 1) Model params -resSimu$identity$params -###### Dispersion params -resSimu$identity$dispersion -``` - -```{r example-outputResSimu_metric, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 7} -## -- precision-recall curve -resSimu$precision_recall$params -## -- ROC curve -resSimu$roc$params -## -- Performances metrics -resSimu$performances -``` - -## Focus evaluation on a subset of genes - -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} -## -- 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) -mock_lowExpressed <- subsetGenes(l_genes, mock_data) - - -## -- get simulation/fit evaluation -resSimu <- evaluation_report(list_tmb = l_tmb, - dds = dds, - mock_obj = mock_lowExpressed, - coeff_threshold = 0.4, - alt_hypothesis = "greaterAbs") -``` - -As we compare this evaluation to the previous one, we observe a reduction in performances for both **HTRfit** and **DESeq2** inferences. - - -```{r example-subsetGenes_id, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 5} -## -- identity plot -###### 1) Model params -resSimu$identity$params -###### Dispersion params -resSimu$identity$dispersion -``` - -```{r example-subsetGenes_metrics, warning = FALSE, message = FALSE, fig.align = 'center', fig.height = 4, fig.width = 7} -## -- precision-recall curve -resSimu$precision_recall$params -## -- ROC curve -resSimu$roc$params -## -- Performances metrics -resSimu$performances -``` - -## Modifying your alpha risk - -```{r example-alphaRisk_1, warning = FALSE, message = FALSE} -## -- get simulation/fit evaluation -resSimu <- evaluation_report(list_tmb = l_tmb, - dds = dds, - mock_obj = mock_data, - coeff_threshold = 0.4, - alpha_risk = 0.05, ## -- default - alt_hypothesis = "greaterAbs") -## -- Performances metrics -resSimu$performances -``` - -```{r example-alphaRiskk_2, warning = FALSE, message = FALSE} -## -- get simulation/fit evaluation -resSimu <- evaluation_report(list_tmb = l_tmb, - dds = dds, - mock_obj = mock_data, - coeff_threshold = 0.4, - alpha_risk = 0.01, - alt_hypothesis = "greaterAbs") -## -- Performances metrics -resSimu$performances -``` - -## Structure of evaluation report object - -```{r example-str_eval_report, warning = FALSE, message = FALSE} -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 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. - - - - diff --git a/vignettes/tutorials/test_vignette.Rmd b/vignettes/tutorials/test_vignette.Rmd deleted file mode 100644 index 2844c08..0000000 --- a/vignettes/tutorials/test_vignette.Rmd +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Test vignette" -output: rmarkdown::html_vignette -vignette: > - %\VignetteIndexEntry{Test vignette} - %\VignetteEngine{knitr::rmarkdown} - %\VignetteEncoding{UTF-8} ---- - -```{r, include = FALSE} -knitr::opts_chunk$set( - collapse = TRUE, - comment = "#>" -) -``` - -```{r setup} -library(HTRfit) -print("oui") -``` -- GitLab