Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Visu_cor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anta Diop
Visu_cor
Commits
e5de9c83
Commit
e5de9c83
authored
1 month ago
by
Antaaa28
Browse files
Options
Downloads
Patches
Plain Diff
maj
parent
68016fda
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Module_correlation.Rmd
+33
-49
33 additions, 49 deletions
Module_correlation.Rmd
with
33 additions
and
49 deletions
Module_correlation.Rmd
+
33
−
49
View file @
e5de9c83
...
...
@@ -3,32 +3,6 @@ title: '"Module d''analyse des corrélations des annotations des échantillons"'
output: html_document
---
```{r input_parameters, include=FALSE}
# Chemin vers le fichier de design
design_file <- "C:/Users/User/Desktop/projet_visualisation/design_WS3.csv"
# Liste des noms de variables à considérer comme catégorielles.
categorical_vars <- c("sample", "condition", "animal", "experiment", "extraction")
# Liste des noms de variables à considérer comme quantitatives.
quantitative_vars <- c( "volume", "quantity")
# Liste des noms de variables à afficher pour la figure "matrice de plots" (advanced pairs plot).
# Ici, on exclut par exemple 'sample' pour ne pas surcharger la visualisation.
display_vars <- c("condition", "animal", "experiment", "extraction")
```
```{r setup, include=FALSE}
# Global options: hide code, warnings and messages in the final report.
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
```{r load_packages, include=FALSE}
# Installer et charger les packages nécessaires
if(!require(GGally)) install.packages("GGally")
...
...
@@ -60,50 +34,60 @@ library(DT)
library(plotly)
library(lsr)
library(knitr)
```
```{r setup, include=FALSE}
# Global options: hide code, warnings and messages in the final report.
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
1. Data Import and Exploration
```{r}
# Import the design file (CSV)
## 1. Data Import and Interactive Overview
```{r data_import, echo=FALSE}
# Import the design file (CSV) using the path specified in the input parameters.
annotations <- read.csv(design_file, sep = ",", stringsAsFactors = FALSE)
# Convert specified categorical variables to factors.
annotations <- annotations %>%
mutate(across(all_of(categorical_vars), as.factor))
# Display an interactive table to review all variables in the dataset.
DT::datatable(annotations,
options = list(pageLength = 10, autoWidth = TRUE),
caption = "Interactive Data Table: Review the design file")
# Overview of data structure and summary.
glimpse(annotations)
summary(annotations)
# Check missing values per column.
missing_values <- colSums(is.na(annotations))
print(missing_values)
```
```
2. Variable Separ
ation and
Convers
ion
### Manual Data Classific
ation and
Modificat
ion
## 2. Manual Data Classification and Modification
```{r}
# Variables numériques d'origine (pour certaines analyses)
num_data <- annotations %>% select(where(is.numeric))
```{r data_classification, echo=TRUE}
# After reviewing the dataset via the interactive table, you can decide which variables
# should be treated as categorical, which as quantitative, and which ones to display
# in the advanced pairs plot.
# Variables catégorielles d'origine (caractère ou facteur)
cat_data <- annotations %>% select(where(~ is.character(.) | is.factor(.)))
cat("Variables numériques détectées : ", paste(colnames(num_data), collapse = ", "), "\n")
cat("Variables catégorielles détectées : ", paste(colnames(cat_data), collapse = ", "), "\n")
# Print the default classification lists defined in the input parameters:
cat("Default Categorical Variables: ", paste(categorical_vars, collapse = ", "), "\n")
cat("Default Quantitative Variables: ", paste(quantitative_vars, collapse = ", "), "\n")
cat("Default Variables for Advanced Pairs Plot: ", paste(display_vars, collapse = ", "), "\n")
# If needed, manually modify the classification lists below:
# (For example, if you decide that a variable should be reclassified, update the lists here.)
# categorical_vars <- c("sample", "condition", "animal", "experiment", "extraction")
# quantitative_vars <- c("volume", "quantity")
# display_vars <- c("condition", "animal", "experiment", "extraction")
```
2.1 Automated Conversion for Correlation Analysis
```{r}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment