gambergeance

This commit is contained in:
thaaoblues 2024-12-28 13:32:16 +01:00
parent 6b0c2acc30
commit b9bd95f4fa
4 changed files with 2733 additions and 10 deletions

View file

@ -1,6 +1,8 @@
---
title: "Projet"
output: html_document
output:
pdf_document: default
html_document: default
date: "2024-12-04"
---
@ -12,6 +14,8 @@ library(reshape2)
library(corrplot)
library(FactoMineR)
library(factoextra)
library(cluster)
library(mclust)
```
```{r}
@ -19,6 +23,7 @@ T = read.table("DataProjet3MIC-2425.txt",header=TRUE,sep=";")
T$ExpT1 = as.factor(T$ExpT1)
T$ExpT2 = as.factor(T$ExpT2)
T$ExpT3 = as.factor(T$ExpT3)
#centrer T
head(T)
summary(T)
str(T)
@ -281,9 +286,7 @@ Contexte : les relevés aux heures sont décrits par les gènes ( les gènes son
- les genes proches d'un axe sont très représentés par celui-ci
- les genes dont l'angle entre eux est petit sont corrélés entre eux
#### Dire : Ce coté on voit bien qu'on est plus ce type de gènes et vers le haut c'est plutot ce type là etc...
## ON EST SENSE VOIR UN TRUC IMPORTANT D'APRES LA PROF MAIS JE VOIS RIEN
### interprétation globale du couple de graphes
## Interprétation globale du couple de graphes
On voit que les genes se polarisent principalement sur l'axe 1 dans un sens ou l'autre. Les flèches sont d'une longueur presque du rayon du cercle, indiquant une participation très forte des genes dans la variance expliquée par ces dimensions.
Il n'y a pas de tendance particulière sur la direction selon l'axe 2 des flèches : Dans chaque "polarité" de fleches selon l'axe 1, il y a des fleches dont la direction est negative d'autres positive selon l'axe 2.
@ -291,7 +294,10 @@ Il n'y a pas de tendance particulière sur la direction selon l'axe 2 des flèch
Le traitement 1 est entièrement groupé sur des valeurs très negatives de l'axe 1. On remarque dans ce groupement la présence des T3 et T4 à la première heure de relevés d'expression des gènes.
axe 1: force du changement d'expression : si on sur-exprime/sous-exprime de beaucoup ( genre 0=>5) ou pas, polarisation ?
## ON EST SENSE VOIR UN TRUC IMPORTANT D'APRES LA PROF MAIS JE VOIS RIEN
### Les axes générés par l'ACP sont purement virtuels, mais on peut y préter un sens plus ou moins défini selon les variables qui y sont corrélées
axe 1: force du changement d'expression des gènes : si on sur-exprime/sous-exprime de beaucoup ( genre 0=>5) ou pas, polarisation ?
axe 2 : vers le haut => ça va changer d'expression bientot, vers le bas => ça se stabilise ( donc les genes pointant vers le haut changent d'expression, et ceux vers le bas ont tendance à rester plutot pareil )
@ -302,10 +308,6 @@ axe 2 : vers le haut => ça va changer d'expression bientot, vers le bas => ça
En ayant en tête les histogrammes de l'analyse descriptive, on pourrait y voir un axe représentant l'expression : les valeurs négatives portent les gènes dont l'expression relative est.
En regardant le graphe des individus (résultats aux heures de relevés), on a effectivement les heures groupées à des valeurs negatives de l'axe 1 correspondant aux relevés du traitement 1 qui, souvenons-nous toujours des histogrammes, ne change l'expression relative que de très peu de gènes.
Pour l'interprétation du second axe, les gènes semblent y être positivement et negativement corrélés quel que soit leur correlation avec l'axe 1.
@ -318,11 +320,91 @@ En regardant les individus, on observe que plus l'heure est tardive, plus ils te
### afin de visualiser les corrélations des variables intiales avec toutes les méta-variables (pas trs utile on a déjà le cercle)
```{r fig.height=18}
# que 50 gènes sinon c'est le bordel
corrplot(res_pca$var$cor[1:50,],method="ellipse", type="lower", bg = "lightgrey")
```
MAIS C'EST INBUVABLE
### plus ou moins inutile ici de regarder d'autres plans
```{r}
fviz_pca_ind(res_pca,axes = c(1,3),geom=c("point"))
fviz_pca_ind(res_pca,axes = c(1,4),geom=c("point"))
fviz_pca_ind(res_pca,axes = c(1,5),geom=c("point"))
```
## Clustering
Nous avons choisi d'effectuer un clustering de l'ACP réalisée plus haut grâce à la méthode des kmeans. Car à l'oeil nu, on dénote déjà très précisément 3 ou 4 clusters donc il sera aisé de trouver le nombre de classes, car normalement il sera de 3 ou 4.
```{r}
#centrage et réduction des données
s = scale(donnees_transposees)
Kmax<-15
reskmeanscl<-matrix(0,nrow=nrow(s),ncol=Kmax-1)
Iintra<-NULL
for (k in 2:Kmax){
resaux<-kmeans(s,k)
reskmeanscl[,k-1]<-resaux$cluster
Iintra<-c(Iintra,resaux$tot.withinss)
}
df<-data.frame(K=2:15,Iintra=Iintra)
ggplot(df,aes(x=K,y=Iintra))+
geom_line()+
geom_point()+
xlab("Nombre de classes")+
ylab("Inertie intraclasse")
```
On voit un coude à 4 clusters ?
```{r}
Silhou<-NULL
for (k in 2:Kmax){
aux<-silhouette(reskmeanscl[,k-1], daisy(s))
Silhou<-c(Silhou,mean(aux[,3]))
}
df<-data.frame(K=2:Kmax,Silhouette=Silhou)
ggplot(df,aes(x=K,y=Silhouette))+
geom_point()+
geom_line()+theme(legend.position = "bottom")
aux<-silhouette(reskmeanscl[,3-1], daisy(s))
fviz_silhouette(aux)+
theme(plot.title = element_text(size =9))
rm(df,Silhou,aux)
```
Silhouette fait un pic à 5 et pas 4 :/
### visualisation du clustering
```{r}
#graphes des clusters
res_kmeans = kmeans(s,3)
fviz_cluster(res_kmeans,data=donnees_transposees,
ellipse.type="norm",labelsize=8,
geom=c("point"))+ggtitle("")
table(wine$Type,wine$Qualite)
adjustedRandIndex(wine$Type,reskmeans$cluster) # fonction de similarité, on a 0,35 avec Type, ce n'est donc pas fou non plus
adjustedRandIndex(wine$Qualite,reskmeans$cluster) # on voit que la similarité avec la qualité donne 0 => cela n'a rien à voir
clust<-paste("Cl-K",res_kmeans$cluster,sep="")
Tab<-melt(table(clust,donnees_transposees[,1]))
ggplot(Tab,aes(y=value,axis1=clust,axis2=Var2))+
geom_alluvium(aes(fill=clust))+
geom_stratum(width = 1/12)+
geom_text(stat = "stratum", aes(label = after_stat(stratum)))+
theme(legend.position = "none")
chordDiagram(table(clust,donnees_transposees[,2]))
```

1086
Projet.html Normal file

File diff suppressed because one or more lines are too long

244
Projet.log Normal file
View file

@ -0,0 +1,244 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) (preloaded format=pdflatex 2024.12.28) 28 DEC 2024 12:03
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**Projet.tex
(./Projet.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option)
)
\c@part=\count187
\c@section=\count188
\c@subsection=\count189
\c@subsubsection=\count190
\c@paragraph=\count191
\c@subparagraph=\count192
\c@figure=\count193
\c@table=\count194
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen140
) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2023/05/13 v2.17o AMS math features
\@mathmargin=\skip50
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks17
\ex@=\dimen141
)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen142
) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2022/04/08 v2.04 operator names
)
\inf@bad=\count195
LaTeX Info: Redefining \frac on input line 234.
\uproot@=\count196
\leftroot@=\count197
LaTeX Info: Redefining \overline on input line 399.
LaTeX Info: Redefining \colon on input line 410.
\classnum@=\count198
\DOTSCASE@=\count199
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox@=\box51
\strutbox@=\box52
LaTeX Info: Redefining \big on input line 722.
LaTeX Info: Redefining \Big on input line 723.
LaTeX Info: Redefining \bigg on input line 724.
LaTeX Info: Redefining \Bigg on input line 725.
\big@size=\dimen143
LaTeX Font Info: Redeclaring font encoding OML on input line 743.
LaTeX Font Info: Redeclaring font encoding OMS on input line 744.
\macc@depth=\count266
LaTeX Info: Redefining \bmod on input line 905.
LaTeX Info: Redefining \pmod on input line 910.
LaTeX Info: Redefining \smash on input line 940.
LaTeX Info: Redefining \relbar on input line 970.
LaTeX Info: Redefining \Relbar on input line 971.
\c@MaxMatrixCols=\count267
\dotsspace@=\muskip16
\c@parentequation=\count268
\dspbrk@lvl=\count269
\tag@help=\toks18
\row@=\count270
\column@=\count271
\maxfields@=\count272
\andhelp@=\toks19
\eqnshift@=\dimen144
\alignsep@=\dimen145
\tagshift@=\dimen146
\tagwidth@=\dimen147
\totwidth@=\dimen148
\lineht@=\dimen149
\@envbody=\toks20
\multlinegap=\skip51
\multlinetaggap=\skip52
\mathdisplay@stack=\toks21
LaTeX Info: Redefining \[ on input line 2953.
LaTeX Info: Redefining \] on input line 2954.
) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
)) (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2021/02/14 v1.3d Input encoding file
\inpenc@prehook=\toks22
\inpenc@posthook=\toks23
) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty
Package: textcomp 2020/02/02 v2.0n Standard LaTeX package
) (/usr/share/texmf/tex/latex/lm/lmodern.sty
Package: lmodern 2015/05/01 v1.6.1 Latin Modern Fonts
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
) (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty
Package: microtype 2023/03/13 v3.1a Micro-typographical refinements (RS)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks24
) (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count273
)
\MT@toks=\toks25
\MT@tempbox=\box53
\MT@count=\count274
LaTeX Info: Redefining \noprotrusionifhmode on input line 1059.
LaTeX Info: Redefining \leftprotrusion on input line 1060.
\MT@prot@toks=\toks26
LaTeX Info: Redefining \rightprotrusion on input line 1078.
LaTeX Info: Redefining \textls on input line 1368.
\MT@outer@kern=\dimen150
LaTeX Info: Redefining \textmicrotypecontext on input line 1988.
\MT@listname@count=\count275
(/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype-pdftex.def
File: microtype-pdftex.def 2023/03/13 v3.1a Definitions specific to pdftex (RS)
LaTeX Info: Redefining \lsstyle on input line 902.
LaTeX Info: Redefining \lslig on input line 902.
\MT@outer@space=\skip53
)
Package microtype Info: Loading configuration file microtype.cfg.
(/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.cfg
File: microtype.cfg 2023/03/13 v3.1a microtype main configuration file (RS)
)) (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty
Package: parskip 2021-03-14 v2.0h non-zero parskip adjustments
(/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO)
(/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO)
) (/usr/share/texlive/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO)
))) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
Package: xcolor 2023/11/15 v3.01 LaTeX color extensions (UK)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: pdftex.def on input line 274.
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2022/09/22 v1.2b Graphics/color driver for pdftex
) (/usr/share/texlive/texmf-dist/tex/latex/graphics/mathcolor.ltx)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1350.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1354.
Package xcolor Info: Model `RGB' extended on input line 1366.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1368.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1370.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1371.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1372.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1373.
) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
Package: geometry 2020/01/02 v5.9 Page Geometry
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty
Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
)
\Gm@cnth=\count276
\Gm@cntv=\count277
\c@Gm@tempcnt=\count278
\Gm@bindingoffset=\dimen151
\Gm@wd@mp=\dimen152
\Gm@odd@mp=\dimen153
\Gm@even@mp=\dimen154
\Gm@layoutwidth=\dimen155
\Gm@layoutheight=\dimen156
\Gm@layouthoffset=\dimen157
\Gm@layoutvoffset=\dimen158
\Gm@dimlist=\toks27
) (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Package: fancyvrb 2024/01/20 4.5c verbatim text (tvz,hv)
\FV@CodeLineNo=\count279
\FV@InFile=\read2
\FV@TabBox=\box54
\c@FancyVerbLine=\count280
\FV@StepNumber=\count281
\FV@OutFile=\write3
)
! LaTeX Error: File `framed.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.47 \definecolor
{shadecolor}{RGB}{248,248,248}^^M
Here is how much of TeX's memory you used:
5738 strings out of 476182
84709 string characters out of 5795594
1922975 words of memory out of 5000000
27732 multiletter control sequences out of 15000+600000
558832 words of font info for 37 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
56i,0n,65p,511b,102s stack positions out of 10000i,1000n,20000p,200000b,200000s
! ==> Fatal error occurred, no output PDF file produced!

1311
Projet.tex Normal file

File diff suppressed because it is too large Load diff