Commit 77f559a1 authored by mcariou's avatar mcariou
Browse files

add test : are PS genes enriched in pancorona

parent dc90673f
......@@ -119,6 +119,29 @@ points(pandginn[,3], 1:nrow(pandginn), col="blue", pch=4)
legend("bottomright", c("pancorona score", "dginn primate score", "dginn bats score"), pch=c(1,20,4), col=c("black", "blue", "blue"))
@
A-t-on un enrichissement en Pan-corona dans nos gènes sous PS?
<<>>=
pandginnall<-merge(pancorona, tablo, by="tmp.Gene.name", all.x=FALSE,all.y=TRUE)
dim(pandginnall)
# test indépendance: under PS / in the pancorona list
table(is.na(pandginnall$TOTAL)==FALSE)
table(pandginnall$nbats>=3)
chi<-table(is.na(pandginnall$TOTAL)==FALSE,pandginnall$nbats>=3)
chi
chisq.test(chi)
table(is.na(pandginnall$TOTAL)==FALSE)
table(pandginnall$nprimates>=3)
chi<-table(is.na(pandginnall$TOTAL)==FALSE,pandginnall$nprimates>=3)
chi
chisq.test(chi)
@
No enrichment in PanCORONA in our genes under PS.
\end{document}
......
......@@ -285,6 +285,98 @@ Output MAIC formatted by Léa. This table includes the DGINN "score".
\end{knitrout}
A-t-on un enrichissement en Pan-corona dans nos gènes sous PS?
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{pandginnall}\hlkwb{<-}\hlkwd{merge}\hlstd{(pancorona, tablo,} \hlkwc{by}\hlstd{=}\hlstr{"tmp.Gene.name"}\hlstd{,} \hlkwc{all.x}\hlstd{=}\hlnum{FALSE}\hlstd{,}\hlkwc{all.y}\hlstd{=}\hlnum{TRUE}\hlstd{)}
\hlkwd{dim}\hlstd{(pandginnall)}
\end{alltt}
\begin{verbatim}
## [1] 324 4
\end{verbatim}
\begin{alltt}
\hlcom{# test indépendance: under PS / in the pancorona list}
\hlkwd{table}\hlstd{(}\hlkwd{is.na}\hlstd{(pandginnall}\hlopt{$}\hlstd{TOTAL)}\hlopt{==}\hlnum{FALSE}\hlstd{)}
\end{alltt}
\begin{verbatim}
##
## FALSE TRUE
## 289 35
\end{verbatim}
\begin{alltt}
\hlkwd{table}\hlstd{(pandginnall}\hlopt{$}\hlstd{nbats}\hlopt{>=}\hlnum{3}\hlstd{)}
\end{alltt}
\begin{verbatim}
##
## FALSE TRUE
## 286 38
\end{verbatim}
\begin{alltt}
\hlstd{chi}\hlkwb{<-}\hlkwd{table}\hlstd{(}\hlkwd{is.na}\hlstd{(pandginnall}\hlopt{$}\hlstd{TOTAL)}\hlopt{==}\hlnum{FALSE}\hlstd{,pandginnall}\hlopt{$}\hlstd{nbats}\hlopt{>=}\hlnum{3}\hlstd{)}
\hlstd{chi}
\end{alltt}
\begin{verbatim}
##
## FALSE TRUE
## FALSE 255 34
## TRUE 31 4
\end{verbatim}
\begin{alltt}
\hlkwd{chisq.test}\hlstd{(chi)}
\end{alltt}
{\ttfamily\noindent\color{warningcolor}{\#\# Warning in chisq.test(chi): Chi-squared approximation may be incorrect}}\begin{verbatim}
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: chi
## X-squared = 7.6869e-31, df = 1, p-value = 1
\end{verbatim}
\begin{alltt}
\hlkwd{table}\hlstd{(}\hlkwd{is.na}\hlstd{(pandginnall}\hlopt{$}\hlstd{TOTAL)}\hlopt{==}\hlnum{FALSE}\hlstd{)}
\end{alltt}
\begin{verbatim}
##
## FALSE TRUE
## 289 35
\end{verbatim}
\begin{alltt}
\hlkwd{table}\hlstd{(pandginnall}\hlopt{$}\hlstd{nprimates}\hlopt{>=}\hlnum{3}\hlstd{)}
\end{alltt}
\begin{verbatim}
##
## FALSE TRUE
## 236 88
\end{verbatim}
\begin{alltt}
\hlstd{chi}\hlkwb{<-}\hlkwd{table}\hlstd{(}\hlkwd{is.na}\hlstd{(pandginnall}\hlopt{$}\hlstd{TOTAL)}\hlopt{==}\hlnum{FALSE}\hlstd{,pandginnall}\hlopt{$}\hlstd{nprimates}\hlopt{>=}\hlnum{3}\hlstd{)}
\hlstd{chi}
\end{alltt}
\begin{verbatim}
##
## FALSE TRUE
## FALSE 212 77
## TRUE 24 11
\end{verbatim}
\begin{alltt}
\hlkwd{chisq.test}\hlstd{(chi)}
\end{alltt}
\begin{verbatim}
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: chi
## X-squared = 0.15992, df = 1, p-value = 0.6892
\end{verbatim}
\end{kframe}
\end{knitrout}
No enrichment in PanCORONA in our genes under PS.
\end{document}
......
No preview for this file type
......@@ -167,70 +167,123 @@ Output MAIC formatted by Léa. This table includes the DGINN "score".
\end{knitrout}
\section{Tanglegram}
\section{Pan Corona}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlcom{#install.packages('dendextend') # stable CRAN version}
\hlkwd{library}\hlstd{(dendextend)} \hlcom{# load the package}
\hlcom{#install.packages("phytools") # stable CRAN version}
\hlkwd{library}\hlstd{(phytools)} \hlcom{# load the package}
\hlkwd{library}\hlstd{(ggraph)}
\hlkwd{library}\hlstd{(igraph)}
\hlkwd{library}\hlstd{(tidyverse)}
\hlstd{pancorona}\hlkwb{<-}\hlkwd{read.table}\hlstd{(}\hlkwd{paste0}\hlstd{(workdir,} \hlstr{"data/pancorona_S5.csv"}\hlstd{),}
\hlkwc{h}\hlstd{=T,} \hlkwc{fill} \hlstd{=} \hlnum{TRUE}\hlstd{,} \hlkwc{sep}\hlstd{=}\hlstr{"\textbackslash{}t"}\hlstd{)}
\hlkwd{names}\hlstd{(pancorona)}\hlkwb{<-}\hlkwd{c}\hlstd{(}\hlstr{"tmp.Gene.name"}\hlstd{,} \hlkwd{names}\hlstd{(pancorona)[}\hlopt{-}\hlnum{1}\hlstd{])}
\hlcom{##}
\hlstd{tmp}\hlkwb{<-}\hlstd{tablo[(tablo}\hlopt{$}\hlstd{nbats}\hlopt{!=}\hlnum{0} \hlopt{|} \hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlopt{!=}\hlnum{0}\hlstd{),]}
\hlstd{tmp}\hlkwb{<-}\hlkwd{head}\hlstd{(tablo,} \hlnum{20}\hlstd{)}
\hlcom{#tmp<-rbind(as.matrix(tmp), c("outgroup", 50, 50))}
\hlstd{tmp}\hlkwb{<-}\hlkwd{as.data.frame}\hlstd{(tmp)}
\hlstd{matbats}\hlkwb{<-}\hlkwd{hclust}\hlstd{(}\hlkwd{dist}\hlstd{(tmp}\hlopt{$}\hlstd{nbats))}
\hlstd{matpri}\hlkwb{<-}\hlkwd{hclust}\hlstd{(}\hlkwd{dist}\hlstd{(tmp}\hlopt{$}\hlstd{nprimates))}
\hlstd{tmp[}\hlkwd{order}\hlstd{(tmp}\hlopt{$}\hlstd{nbats),]}
\hlstd{dendpri}\hlkwb{<-}\hlkwd{as.dendrogram}\hlstd{(matpri)}
\hlstd{dendbats}\hlkwb{<-}\hlkwd{as.dendrogram}\hlstd{(matbats)}
\hlkwd{labels}\hlstd{(dendpri)}\hlkwb{<-}\hlkwd{as.character}\hlstd{(tmp}\hlopt{$}\hlstd{`tmp$Gene.name`[}\hlkwd{labels}\hlstd{(dendpri)])}
\hlkwd{labels}\hlstd{(dendbats)}\hlkwb{<-}\hlkwd{as.character}\hlstd{(tmp}\hlopt{$}\hlstd{`tmp$Gene.name`[}\hlkwd{labels}\hlstd{(dendbats)])}
\hlstd{tmp[}\hlkwd{order}\hlstd{(tmp}\hlopt{$}\hlstd{nprimates,} \hlkwc{decreasing}\hlstd{=}\hlnum{FALSE}\hlstd{),]}\hlopt{$}\hlstr{'tmp$Gene.name'}\hlkwb{->} \hlstd{order}
\hlstd{dendpri}\hlkwb{<-}\hlstd{dendextend}\hlopt{::}\hlkwd{rotate}\hlstd{(dendpri,} \hlkwc{order}\hlstd{=order)}
\hlstd{tmp[}\hlkwd{order}\hlstd{(tmp}\hlopt{$}\hlstd{nbats,} \hlkwc{decreasing}\hlstd{=}\hlnum{FALSE}\hlstd{),]}\hlopt{$}\hlstr{'tmp$Gene.name'}\hlkwb{->} \hlstd{order}
\hlstd{dendbats}\hlkwb{<-}\hlstd{dendextend}\hlopt{::}\hlkwd{rotate}\hlstd{(dendbats,} \hlkwc{order}\hlstd{=order)}
\hlcom{#### Il faut swapper certains neuds de l'arbres}
\hlkwd{class}\hlstd{(}\hlkwd{labels}\hlstd{(dendpri))}
\hlcom{# Genes en commun}
\hlstd{pancorona}\hlopt{$}\hlstd{tmp.Gene.name[pancorona}\hlopt{$}\hlstd{tmp.Gene.name} \hlopt{%in%} \hlstd{tablo}\hlopt{$}\hlstd{tmp.Gene.name]}
\end{alltt}
\begin{verbatim}
## [1] TBK1 MARK3 GIGYF2 MARK2 G3BP1 LARP1 ACE2 PABPC1
## [9] TMPRSS2 AP3B1 CLCC1 CSDE1 HECTD1 MARK1 MEPCE PDE4DIP
## [17] POR PRKAR2B RAB5C RTN4 SRP54 UBAP2 UBAP2L UBXN8
## [25] SPART BZW2 EIF4E2 SMOC1 STOML2 DDX21 FAM98A G3BP2
## [33] MOV10 PABPC4 UPF1
## 105 Levels: ACE2 ANPEP AP3B1 ATXN2L BTF3 BZW2 CKAP5 CLCC1 ... YTHDF2
\end{verbatim}
\begin{alltt}
\hlcom{# Uniquement dans le tableau pancorona}
\hlkwd{sort}\hlstd{(pancorona}\hlopt{$}\hlstd{tmp.Gene.name[(pancorona}\hlopt{$}\hlstd{tmp.Gene.name} \hlopt{%in%} \hlstd{tablo}\hlopt{$}\hlstd{tmp.Gene.name)}\hlopt{==}\hlnum{FALSE}\hlstd{])}
\end{alltt}
\begin{verbatim}
## [1] ANPEP ATXN2L BTF3 CKAP5 CTSB CTSL
## [7] CYB5R3 DDX1 DDX5 DDX58 DHX9 DNM1L
## [13] EEF1A1 EIF2A EIF3F EIF4B EZR FLNA
## [19] FURIN FUS GSK3A GSK3B HDLBP HNRNPA1
## [25] HNRNPD HNRNPF HNRNPU IFIH1 IGF2BP1 IKBKB
## [31] IKBKE IRF3 ISG15 KPNA3 KPNB1 MYH9
## [37] NCL POLD1 POLR2B PRKRA RBM14 RCHY1
## [43] RPL13A RPL26 RPS13 RPS17 RPS19 RPS9
## [49] SDCBP SERBP1 SGTA SLC1A5 SNAP47 SSB
## [55] STING1 SYNCRIP TANC1 TBCB TMPRSS11D TRAF3
## [61] TUBA4A TUBB2A TUBB4A TUBB6 USP10 VPS36
## [67] XRCC5 XRCC6 YBX1 YTHDF2
## 105 Levels: ACE2 ANPEP AP3B1 ATXN2L BTF3 BZW2 CKAP5 CLCC1 ... YTHDF2
\end{verbatim}
\begin{alltt}
\hlcom{## Uniquement dans tableau }
\hlkwd{sort}\hlstd{(tablo}\hlopt{$}\hlstd{tmp.Gene.name[(tablo}\hlopt{$}\hlstd{tmp.Gene.name} \hlopt{%in%} \hlstd{pancorona}\hlopt{$}\hlstd{tmp.Gene.name)}\hlopt{==}\hlnum{FALSE}\hlstd{])}
\end{alltt}
\begin{verbatim}
## [1] AAR2 AASS AATF ABCC1 ACAD9 ACADM
## [7] ACSL3 ADAM9 ADAMTS1 AGPS AKAP8 AKAP8L
## [13] AKAP9 ALG11 ALG5 ALG8 ANO6 AP2A2
## [19] AP2M1 ARF6 ATE1 ATP13A3 ATP1B1 ATP6AP1
## [25] ATP6V1A BAG5 BCKDK BRD2 BRD4 CCDC86
## [31] CDK5RAP2 CENPF CEP112 CEP135 CEP250 CEP350
## [37] CEP68 CHMP2A CHPF CHPF2 CISD3 CIT
## [43] CLIP4 CNTRL COL6A1 COLGALT1 COMT COQ8B
## [49] CRTC3 CSNK2A2 CSNK2B CUL2 CWC27 CYB5B
## [55] DCAF7 DCAKD DCTPP1 DDX10 DNAJC11 DNAJC19
## [61] DNMT1 DPH5 DPY19L1 ECSIT EDEM3 EIF4H
## [67] ELOC EMC1 ERC1 ERGIC1 ERLEC1 ERMP1
## [73] ERO1B ERP44 ETFA EXOSC2 EXOSC3 EXOSC5
## [79] EXOSC8 F2RL1 FAM162A FAM8A1 FAR2 FASTKD5
## [85] FBLN5 FBN1 FBN2 FBXL12 FKBP10 FKBP15
## [91] FKBP7 FOXRED2 FYCO1 GCC1 GCC2 GDF15
## [97] GFER GGCX GGH GHITM GLA GNB1
## [103] GNG5 GOLGA2 GOLGA3 GOLGA7 GOLGB1 GORASP1
## [109] GPAA1 GPX1 GRIPAP1 GRPEL1 GTF2F2 HDAC2
## [115] HEATR3 HMOX1 HOOK1 HS2ST1 HS6ST2 HSBP1
## [121] HYOU1 IDE IL17RA IMPDH2 INHBE INTS4
## [127] ITGB1 JAKMIP1 KDELC1 KDELC2 LARP4B LARP7
## [133] LMAN2 LOX MAP7D1 MARC1 MAT2B MDN1
## [139] MIB1 MIPOL1 MOGS MPHOSPH10 MRPS2 MRPS25
## [145] MRPS27 MRPS5 MTCH1 MYCBP2 NARS2 NAT14
## [151] NDFIP2 NDUFAF1 NDUFAF2 NDUFB9 NEK9 NEU1
## [157] NGDN NGLY1 NIN NINL NLRX1 NOL10
## [163] NPC2 NPTX1 NSD2 NUP210 NUP214 NUP54
## [169] NUP58 NUP62 NUP88 NUP98 NUTF2 OS9
## [175] PCNT PCSK5 PCSK6 PDZD11 PIGO PIGS
## [181] PITRM1 PKP2 PLAT PLD3 PLEKHA5 PLEKHF2
## [187] PLOD2 PMPCA PMPCB POFUT1 POLA1 POLA2
## [193] PPIL3 PPT1 PRIM1 PRIM2 PRKACA PRKAR2A
## [199] PRRC2B PSMD8 PTBP2 PTGES2 PUSL1 PVR
## [205] QSOX2 RAB10 RAB14 RAB18 RAB1A RAB2A
## [211] RAB7A RAB8A RAE1 RALA RAP1GDS1 RBM28
## [217] RBM41 RBX1 RDX REEP5 REEP6 RETREG3
## [223] RHOA RIPK1 RNF41 RPL36 RRP9 SAAL1
## [229] SBNO1 SCAP SCARB1 SCCPDH SDF2 SELENOS
## [235] SEPSECS SIL1 SIRT5 SLC25A21 SLC27A2 SLC30A6
## [241] SLC30A7 SLC30A9 SLC44A2 SLC9A3R1 SLU7 SNIP1
## [247] SRP19 SRP72 STC2 STOM SUN2 TAPT1
## [253] TARS2 TBCA TBKBP1 TCF12 THTPA TIMM10
## [259] TIMM10B TIMM29 TIMM8B TIMM9 TLE1 TLE3
## [265] TM2D3 TMED5 TMEM39B TMEM97 TOMM70 TOR1A
## [271] TOR1AIP1 TRIM59 TRMT1 TUBGCP2 TUBGCP3 TYSND1
## [277] UGGT2 USP54 VPS11 VPS39 WASHC4 WFS1
## [283] YIF1A ZC3H18 ZC3H7A ZDHHC5 ZNF318 ZNF503
## [289] ZYG11B
## 324 Levels: AAR2 AASS AATF ABCC1 ACAD9 ACADM ACE2 ACSL3 ... ZYG11B
\end{verbatim}
\end{kframe}
\end{knitrout}
\hlstd{dend12} \hlkwb{<-} \hlkwd{dendlist}\hlstd{(dendbats, dendpri)}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{pancorona}\hlkwb{<-}\hlstd{pancorona[,}\hlkwd{c}\hlstd{(}\hlstr{"tmp.Gene.name"}\hlstd{,} \hlstr{"TOTAL"}\hlstd{)]}
\hlopt{?}\hlstd{png}
\hlkwd{png}\hlstd{(}\hlstr{"tanglegramm.png"}\hlstd{,} \hlkwc{width} \hlstd{=} \hlnum{1800}\hlstd{,} \hlkwc{height} \hlstd{=} \hlnum{3000}\hlstd{)}
\hlkwd{tanglegram}\hlstd{(dend12,} \hlkwc{columns_width}\hlstd{=}\hlkwd{c}\hlstd{(}\hlnum{3}\hlstd{,} \hlnum{3}\hlstd{,}\hlnum{3}\hlstd{),} \hlkwc{axes}\hlstd{=}\hlnum{FALSE}\hlstd{,}
\hlkwc{edge.lwd}\hlstd{=}\hlnum{0}\hlstd{,} \hlkwc{margin_inner}\hlstd{=}\hlnum{6}\hlstd{,}
\hlkwc{margin_top}\hlstd{=}\hlnum{2}\hlstd{,}
\hlkwc{main_left}\hlstd{=}\hlstr{" bats"}\hlstd{,}
\hlkwc{main_right} \hlstd{=} \hlstr{"primates "}\hlstd{,}
\hlkwc{lwd}\hlstd{=}\hlnum{0.5}\hlstd{,}
\hlkwc{cex_main}\hlstd{=}\hlnum{1}\hlstd{,}
\hlkwc{lab.cex}\hlstd{=}\hlnum{1}\hlstd{,}
\hlkwc{k_labels}\hlstd{=}\hlnum{6}\hlstd{)}
\hlstd{pandginn}\hlkwb{<-}\hlkwd{na.omit}\hlstd{(}\hlkwd{merge}\hlstd{(pancorona, tablo,} \hlkwc{by}\hlstd{=}\hlstr{"tmp.Gene.name"}\hlstd{,} \hlkwc{all.x}\hlstd{=}\hlnum{TRUE}\hlstd{))}
\hlkwd{dev.off}\hlstd{()}
\hlstd{pandginn}\hlkwb{<-}\hlstd{pandginn[}\hlkwd{order}\hlstd{(pandginn}\hlopt{$}\hlstd{nprimates),]}
\hlstd{pandginn}\hlkwb{<-}\hlstd{pandginn[}\hlkwd{order}\hlstd{(pandginn}\hlopt{$}\hlstd{TOTAL),]}
\hlstd{tmp}
\hlopt{?}\hlstd{tanglegram}
\hlkwd{dotchart}\hlstd{(}\hlkwd{as.matrix}\hlstd{(pandginn[,}\hlnum{2}\hlstd{]),} \hlkwc{labels} \hlstd{= pandginn}\hlopt{$}\hlstd{tmp.Gene.name,} \hlkwc{xlim}\hlstd{=}\hlkwd{c}\hlstd{(}\hlnum{0}\hlstd{,}\hlnum{5}\hlstd{))}
\hlkwd{points}\hlstd{(pandginn[,}\hlnum{4}\hlstd{],} \hlnum{1}\hlopt{:}\hlkwd{nrow}\hlstd{(pandginn),} \hlkwc{col}\hlstd{=}\hlstr{"blue"}\hlstd{,} \hlkwc{pch}\hlstd{=}\hlnum{20}\hlstd{,} \hlkwc{cex}\hlstd{=}\hlnum{0.7}\hlstd{)}
\hlkwd{points}\hlstd{(pandginn[,}\hlnum{3}\hlstd{],} \hlnum{1}\hlopt{:}\hlkwd{nrow}\hlstd{(pandginn),} \hlkwc{col}\hlstd{=}\hlstr{"blue"}\hlstd{,} \hlkwc{pch}\hlstd{=}\hlnum{4}\hlstd{)}
\hlkwd{legend}\hlstd{(}\hlstr{"bottomright"}\hlstd{,} \hlkwd{c}\hlstd{(}\hlstr{"pancorona score"}\hlstd{,} \hlstr{"dginn primate score"}\hlstd{,} \hlstr{"dginn bats score"}\hlstd{),} \hlkwc{pch}\hlstd{=}\hlkwd{c}\hlstd{(}\hlnum{1}\hlstd{,}\hlnum{20}\hlstd{,}\hlnum{4}\hlstd{),} \hlkwc{col}\hlstd{=}\hlkwd{c}\hlstd{(}\hlstr{"black"}\hlstd{,} \hlstr{"blue"}\hlstd{,} \hlstr{"blue"}\hlstd{))}
\end{alltt}
\end{kframe}
\end{knitrout}
\includegraphics[width=\maxwidth]{figure/pancorona-1}
\end{knitrout}
\end{document}
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment