Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
\documentclass[11pt, oneside]{article}\usepackage[]{graphicx}\usepackage[]{color}
% maxwidth is the original width if it is less than linewidth
% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\makeatother
\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%
\let\hlipl\hlkwb
\usepackage{framed}
\makeatletter
\newenvironment{kframe}{%
\def\at@end@of@kframe{}%
\ifinner\ifhmode%
\def\at@end@of@kframe{\end{minipage}}%
\begin{minipage}{\columnwidth}%
\fi\fi%
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
\colorbox{shadecolor}{##1}\hskip-\fboxsep
% There is no \\@totalrightmargin, so:
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
\MakeFramed {\advance\hsize-\width
\@totalleftmargin\z@ \linewidth\hsize
\@setminipage}}%
{\par\unskip\endMakeFramed%
\at@end@of@kframe}
\makeatother
\definecolor{shadecolor}{rgb}{.97, .97, .97}
\definecolor{messagecolor}{rgb}{0, 0, 0}
\definecolor{warningcolor}{rgb}{1, 0, 1}
\definecolor{errorcolor}{rgb}{1, 0, 0}
\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX
\usepackage{alltt} % use "amsart" instead of "article" for AMSLaTeX format
%\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
%\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
%\usepackage{graphicx} % Use pdf, png, jpg, or eps with pdflatex; use eps in DVI mode
% TeX will automatically convert eps --> pdf in pdflatex
%\usepackage{amssymb}
\usepackage[utf8]{inputenc}
%\usepackage[cyr]{aeguill}
%\usepackage[francais]{babel}
%\usepackage{hyperref}
\title{Positive selection on genes interacting with SARS-Cov2, comparison of different analysis}
\author{Marie Cariou}
\date{Janvier 2021} % Activate to display a given date or no date
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\begin{document}
\maketitle
\tableofcontents
\newpage
\section{Data}
Analysis were formatted by the script covid\_comp\_script0\_table.Rnw.
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{workdir}\hlkwb{<-}\hlstr{"/home/adminmarie/Documents/CIRI_BIBS_projects/2020_05_Etienne_covid/"}
\hlstd{tab}\hlkwb{<-}\hlkwd{read.delim}\hlstd{(}\hlkwd{paste0}\hlstd{(workdir,}
\hlstr{"covid_comp/covid_comp_complete.txt"}\hlstd{),} \hlkwc{h}\hlstd{=T,} \hlkwc{sep}\hlstd{=}\hlstr{"\textbackslash{}t"}\hlstd{)}
\hlkwd{dim}\hlstd{(tab)}
\end{alltt}
\begin{verbatim}
## [1] 333 161
\end{verbatim}
\end{kframe}
\end{knitrout}
\section{Comparison of dataset}
\subsection{Data}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{tmp}\hlkwb{<-}\hlkwd{na.omit}\hlstd{(tab[,}\hlkwd{c}\hlstd{(}\hlstr{"Gene.name"}\hlstd{,} \hlstr{"bats_BUSTED"}\hlstd{,} \hlstr{"bats_BppM1M2"}\hlstd{,} \hlstr{"bats_BppM7M8"}\hlstd{,}
\hlstr{"bats_codemlM1M2"}\hlstd{,} \hlstr{"bats_codemlM7M8"}\hlstd{,} \hlstr{"dginn.primate_codemlM1M2"}\hlstd{,}
\hlstr{"dginn.primate_codemlM7M8"}\hlstd{,} \hlstr{"dginn.primate_BppM1M2"}\hlstd{,}
\hlstr{"dginn.primate_BppM7M8"}\hlstd{,} \hlstr{"dginn.primate_BUSTED"}\hlstd{)])}
\hlkwd{dim}\hlstd{(tmp)}
\end{alltt}
\begin{verbatim}
## [1] 206 11
\end{verbatim}
\end{kframe}
\end{knitrout}
\subsection{Mondrian}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlkwd{library}\hlstd{(Mondrian)}
\hlstd{monddata}\hlkwb{<-}\hlkwd{as.data.frame}\hlstd{(tmp}\hlopt{$}\hlstd{Gene.name)}
\hlstd{batstmp}\hlkwb{<-}\hlkwd{rowSums}\hlstd{(}\hlkwd{cbind}\hlstd{(tmp}\hlopt{$}\hlstd{bats_codemlM1M2}\hlopt{==}\hlstr{"Y"}\hlstd{, tmp}\hlopt{$}\hlstd{bats_codemlM7M8}\hlopt{==}\hlstr{"Y"}\hlstd{,}
\hlstd{tmp}\hlopt{$}\hlstd{bats_BppM1M2}\hlopt{==}\hlstr{"Y"}\hlstd{, tmp}\hlopt{$}\hlstd{bats_BppM7M8}\hlopt{==}\hlstr{"Y"}\hlstd{, tmp}\hlopt{$}\hlstd{bats_BUSTED}\hlopt{==}\hlstr{"Y"}\hlstd{))}
\hlstd{primatetmp}\hlkwb{<-}\hlkwd{rowSums}\hlstd{(}\hlkwd{cbind}\hlstd{(tmp}\hlopt{$}\hlstr{"dginn.primate_codemlM1M2"}\hlopt{==}\hlstr{"Y"}\hlstd{,}
\hlstd{tmp}\hlopt{$}\hlstr{"dginn.primate_codemlM7M8"}\hlopt{==}\hlstr{"Y"}\hlstd{, tmp}\hlopt{$}\hlstr{"dginn.primate_BppM1M2"}\hlopt{==}\hlstr{"Y"}\hlstd{,}
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
\hlstd{tmp}\hlopt{$}\hlstr{"dginn.primate_BppM7M8"}\hlopt{==}\hlstr{"Y"}\hlstd{, tmp}\hlopt{$}\hlstr{"dginn.primate_BUSTED"}\hlopt{==}\hlstr{"Y"}\hlstd{))}
\hlstd{monddata}\hlopt{$}\hlstd{bats_dginn3}\hlkwb{<-}\hlkwd{ifelse}\hlstd{(batstmp}\hlopt{>=}\hlnum{3}\hlstd{,} \hlnum{1}\hlstd{,}\hlnum{0}\hlstd{)}
\hlstd{monddata}\hlopt{$}\hlstd{primate_dginn3}\hlkwb{<-}\hlkwd{ifelse}\hlstd{(primatetmp}\hlopt{>=}\hlnum{3}\hlstd{,} \hlnum{1}\hlstd{,}\hlnum{0}\hlstd{)}
\hlstd{monddata}\hlopt{$}\hlstd{bats_dginn4}\hlkwb{<-}\hlkwd{ifelse}\hlstd{(batstmp}\hlopt{>=}\hlnum{4}\hlstd{,} \hlnum{1}\hlstd{,}\hlnum{0}\hlstd{)}
\hlstd{monddata}\hlopt{$}\hlstd{primate_dginn4}\hlkwb{<-}\hlkwd{ifelse}\hlstd{(primatetmp}\hlopt{>=}\hlnum{4}\hlstd{,} \hlnum{1}\hlstd{,}\hlnum{0}\hlstd{)}
\hlkwd{mondrian}\hlstd{(monddata[,}\hlnum{2}\hlopt{:}\hlnum{3}\hlstd{],} \hlkwc{labels}\hlstd{=}\hlkwd{c}\hlstd{(}\hlstr{"DGINN bats >3"}\hlstd{,} \hlstr{"DGINN primate >3"}\hlstd{))}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/mondrianbats-1}
\begin{kframe}\begin{alltt}
\hlkwd{mondrian}\hlstd{(monddata[,}\hlnum{4}\hlopt{:}\hlnum{5}\hlstd{],} \hlkwc{labels}\hlstd{=}\hlkwd{c}\hlstd{(}\hlstr{"DGINN bats >4"}\hlstd{,} \hlstr{"DGINN primate >4"}\hlstd{))}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/mondrianbats-2}
\end{knitrout}
\subsection{subsetR}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlkwd{library}\hlstd{(UpSetR)}
\hlkwd{upset}\hlstd{(monddata,} \hlkwc{nsets} \hlstd{=} \hlnum{4}\hlstd{,} \hlkwc{matrix.color} \hlstd{=} \hlstr{"#DC267F"}\hlstd{,}
\hlkwc{main.bar.color} \hlstd{=} \hlstr{"#648FFF"}\hlstd{,} \hlkwc{sets.bar.color} \hlstd{=} \hlstr{"#FE6100"}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/subsetbats-1}
\begin{kframe}\begin{alltt}
\hlkwd{upset}\hlstd{(monddata[,}\hlnum{1}\hlopt{:}\hlnum{3}\hlstd{],} \hlkwc{nsets} \hlstd{=} \hlnum{2}\hlstd{,} \hlkwc{matrix.color} \hlstd{=} \hlstr{"#DC267F"}\hlstd{,}
\hlkwc{main.bar.color} \hlstd{=} \hlstr{"#648FFF"}\hlstd{,} \hlkwc{sets.bar.color} \hlstd{=} \hlstr{"#FE6100"}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/subsetbats-2}
\begin{kframe}\begin{alltt}
\hlkwd{upset}\hlstd{(monddata[,}\hlkwd{c}\hlstd{(}\hlnum{1}\hlstd{,}\hlnum{4}\hlstd{,}\hlnum{5}\hlstd{)],} \hlkwc{nsets} \hlstd{=} \hlnum{2}\hlstd{,} \hlkwc{matrix.color} \hlstd{=} \hlstr{"#DC267F"}\hlstd{,}
\hlkwc{main.bar.color} \hlstd{=} \hlstr{"#648FFF"}\hlstd{,} \hlkwc{sets.bar.color} \hlstd{=} \hlstr{"#FE6100"}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/subsetbats-3}
\end{knitrout}
\section{Which are these genes?}
\subsection{Gene under positive selection in both bats and primates}
4 methods:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{monddata[monddata}\hlopt{$}\hlstd{bats_dginn4}\hlopt{==}\hlnum{1} \hlopt{&} \hlstd{monddata}\hlopt{$}\hlstd{primate_dginn4}\hlopt{==}\hlnum{1}\hlstd{,]}
\end{alltt}
\begin{verbatim}
## tmp$Gene.name bats_dginn3 primate_dginn3 bats_dginn4 primate_dginn4
## 4 ACADM 1 1 1 1
## 73 GGH 1 1 1 1
## 78 GOLGA7 1 1 1 1
## 89 IDE 1 1 1 1
## 94 ITGB1 1 1 1 1
## 188 TOR1AIP1 1 1 1 1
## 201 VPS39 1 1 1 1
\end{verbatim}
\end{kframe}
\end{knitrout}
3 methods:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{monddata[monddata}\hlopt{$}\hlstd{bats_dginn3}\hlopt{==}\hlnum{1} \hlopt{&} \hlstd{monddata}\hlopt{$}\hlstd{primate_dginn3}\hlopt{==}\hlnum{1}\hlstd{,]}
\end{alltt}
\begin{verbatim}
## tmp$Gene.name bats_dginn3 primate_dginn3 bats_dginn4 primate_dginn4
## 4 ACADM 1 1 1 1
## 20 CDK5RAP2 1 1 0 1
## 48 EDEM3 1 1 1 0
## 73 GGH 1 1 1 1
## 78 GOLGA7 1 1 1 1
## 89 IDE 1 1 1 1
## 94 ITGB1 1 1 1 1
## 97 LMAN2 1 1 1 1
## 104 MOV10 1 1 0 0
## 188 TOR1AIP1 1 1 1 1
## 201 VPS39 1 1 1 1
\end{verbatim}
\end{kframe}
\end{knitrout}
\subsection{Gene under positive selection only in primates}
4 methods:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{monddata[monddata}\hlopt{$}\hlstd{bats_dginn4}\hlopt{==}\hlnum{0} \hlopt{&} \hlstd{monddata}\hlopt{$}\hlstd{primate_dginn4}\hlopt{==}\hlnum{1}\hlstd{,]}
\end{alltt}
\begin{verbatim}
## tmp$Gene.name bats_dginn3 primate_dginn3 bats_dginn4 primate_dginn4
## 20 CDK5RAP2 1 1 0 1
## 32 CLIP4 0 1 0 1
## 45 DPH5 0 1 0 1
## 50 EMC1 0 1 0 1
## 68 FYCO1 0 1 0 1
## 74 GIGYF2 0 1 0 1
## 75 GLA 0 1 0 1
## 111 NDUFB9 0 1 0 1
## 138 PRKAR2A 0 1 0 1
## 153 RIPK1 0 1 0 1
## 156 SAAL1 0 1 0 1
## 162 SIRT5 0 1 0 1
## 163 SLC25A21 0 1 0 1
## 185 TMEM39B 0 1 0 1
## 191 TUBGCP2 0 1 0 1
## 194 UBAP2 0 1 0 1
## 197 UGGT2 0 1 0 1
## 204 ZNF318 0 1 0 1
\end{verbatim}
\end{kframe}
\end{knitrout}
3 methods:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{monddata[monddata}\hlopt{$}\hlstd{bats_dginn3}\hlopt{==}\hlnum{0} \hlopt{&} \hlstd{monddata}\hlopt{$}\hlstd{primate_dginn3}\hlopt{==}\hlnum{1}\hlstd{,]}
\end{alltt}
\begin{verbatim}
## tmp$Gene.name bats_dginn3 primate_dginn3 bats_dginn4 primate_dginn4
## 74 GIGYF2 0 1 0 1
## 75 GLA 0 1 0 1
## 95 LARP1 0 1 0 1
## 96 LARP7 0 1 0 0
## 100 MDN1 0 1 0 0
## 107 MRPS5 0 1 0 0
## 111 NDUFB9 0 1 0 1
## 115 NGLY1 0 1 0 0
## 118 NPC2 0 1 0 0
## 127 PITRM1 0 1 0 0
## 128 PLAT 0 1 0 0
## 134 POR 0 1 0 0
## 138 PRKAR2A 0 1 0 1
## 144 RAB14 0 1 0 0
## 145 RAB2A 0 1 0 0
## 153 RIPK1 0 1 0 1
## 156 SAAL1 0 1 0 1
## 162 SIRT5 0 1 0 1
## 163 SLC25A21 0 1 0 1
## 172 STOM 0 1 0 0
## 181 TIMM8B 0 1 0 0
## 185 TMEM39B 0 1 0 1
## 189 TRIM59 0 1 0 0
## 190 TRMT1 0 1 0 0
## 191 TUBGCP2 0 1 0 1
## 194 UBAP2 0 1 0 1
## 197 UGGT2 0 1 0 1
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
## 199 USP54 0 1 0 0
## 204 ZNF318 0 1 0 1
\end{verbatim}
\end{kframe}
\end{knitrout}
\subsection{Gene under positive selection only in bats}
4 methods:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{monddata[monddata}\hlopt{$}\hlstd{bats_dginn4}\hlopt{==}\hlnum{1} \hlopt{&} \hlstd{monddata}\hlopt{$}\hlstd{primate_dginn4}\hlopt{==}\hlnum{0}\hlstd{,]}
\end{alltt}
\begin{verbatim}
## tmp$Gene.name bats_dginn3 primate_dginn3 bats_dginn4 primate_dginn4
## 48 EDEM3 1 1 1 0
## 52 ERGIC1 1 0 1 0
## 91 IMPDH2 1 0 1 0
## 92 INHBE 1 0 1 0
## 166 SLC44A2 1 0 1 0
## 177 TBK1 1 0 1 0
\end{verbatim}
\end{kframe}
\end{knitrout}
3 methods:
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{monddata[monddata}\hlopt{$}\hlstd{bats_dginn3}\hlopt{==}\hlnum{1} \hlopt{&} \hlstd{monddata}\hlopt{$}\hlstd{primate_dginn3}\hlopt{==}\hlnum{0}\hlstd{,]}
\end{alltt}
\begin{verbatim}
## tmp$Gene.name bats_dginn3 primate_dginn3 bats_dginn4 primate_dginn4
## 7 AGPS 1 0 0 0
## 52 ERGIC1 1 0 1 0
## 81 GRIPAP1 1 0 0 0
## 82 GRPEL1 1 0 0 0
## 91 IMPDH2 1 0 1 0
## 92 INHBE 1 0 1 0
## 120 NUP214 1 0 0 0
## 136 PRIM1 1 0 0 0
## 165 SLC30A9 1 0 0 0
## 166 SLC44A2 1 0 1 0
## 177 TBK1 1 0 1 0
\end{verbatim}
\end{kframe}
\end{knitrout}
\subsection{Figure tableau}
\begin{knitrout}
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
\begin{alltt}
\hlstd{tablo}\hlkwb{<-}\hlkwd{as.data.frame}\hlstd{(tmp}\hlopt{$}\hlstd{Gene.name)}
\hlstd{tablo}\hlopt{$}\hlstd{nbats}\hlkwb{<-}\hlstd{batstmp}
\hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlkwb{<-}\hlstd{primatetmp}
\hlkwd{plot}\hlstd{(}\hlkwa{NULL}\hlstd{,} \hlkwc{xlim}\hlstd{=}\hlkwd{c}\hlstd{(}\hlopt{-}\hlnum{0.5}\hlstd{,}\hlnum{5.5}\hlstd{),} \hlkwc{ylim}\hlstd{=}\hlkwd{c}\hlstd{(}\hlopt{-}\hlnum{3}\hlstd{,}\hlnum{5.5}\hlstd{),} \hlkwc{xlab}\hlstd{=}\hlstr{"bats"}\hlstd{,} \hlkwc{ylab}\hlstd{=}\hlstr{"primates"}\hlstd{,} \hlkwc{main}\hlstd{=}\hlstr{"Genes supported by x,y methods in bats and primates"}\hlstd{,} \hlkwc{bty}\hlstd{=}\hlstr{"n"}\hlstd{,} \hlkwc{xaxt}\hlstd{=}\hlstr{"n"}\hlstd{,} \hlkwc{yaxt}\hlstd{=}\hlstr{"n"}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwc{x}\hlstd{=}\hlkwd{rep}\hlstd{(}\hlopt{-}\hlnum{0.6}\hlstd{,} \hlnum{6}\hlstd{),} \hlkwc{y}\hlstd{=}\hlnum{0}\hlopt{:}\hlnum{5}\hlstd{,} \hlnum{0}\hlopt{:}\hlnum{5}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwc{y}\hlstd{=}\hlkwd{rep}\hlstd{(}\hlopt{-}\hlnum{0.65}\hlstd{,} \hlnum{6}\hlstd{),} \hlkwc{x}\hlstd{=}\hlnum{0}\hlopt{:}\hlnum{5}\hlstd{,} \hlnum{0}\hlopt{:}\hlnum{5}\hlstd{)}
\hlkwd{sapply}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlopt{-}\hlnum{0.5}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{by}\hlstd{=}\hlnum{1}\hlstd{),} \hlkwa{function}\hlstd{(}\hlkwc{x}\hlstd{)\{}
\hlkwd{segments}\hlstd{(}\hlkwc{x0}\hlstd{=x,} \hlkwc{x1}\hlstd{=x,} \hlkwc{y0}\hlstd{=}\hlopt{-}\hlnum{0.5}\hlstd{,} \hlkwc{y1}\hlstd{=}\hlnum{5.5}\hlstd{)}
\hlstd{\})}
\end{alltt}
\begin{verbatim}
## [[1]]
## NULL
##
## [[2]]
## NULL
##
## [[3]]
## NULL
##
## [[4]]
## NULL
##
## [[5]]
## NULL
##
## [[6]]
## NULL
##
## [[7]]
## NULL
\end{verbatim}
\begin{alltt}
\hlkwd{sapply}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlopt{-}\hlnum{0.5}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{by}\hlstd{=}\hlnum{1}\hlstd{),} \hlkwa{function}\hlstd{(}\hlkwc{x}\hlstd{)\{}
\hlkwd{segments}\hlstd{(}\hlkwc{x0}\hlstd{=}\hlopt{-}\hlnum{0.5}\hlstd{,} \hlkwc{x1}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{y0}\hlstd{=x,} \hlkwc{y1}\hlstd{=x)}
\hlstd{\})}
\end{alltt}
\begin{verbatim}
## [[1]]
## NULL
##
## [[2]]
## NULL
##
## [[3]]
## NULL
##
## [[4]]
## NULL
##
## [[5]]
## NULL
##
## [[6]]
## NULL
##
## [[7]]
## NULL
\end{verbatim}
\begin{alltt}
\hlkwa{for} \hlstd{(p} \hlkwa{in} \hlnum{0}\hlopt{:}\hlnum{5}\hlstd{)\{}
\hlkwa{for} \hlstd{(b} \hlkwa{in} \hlnum{0}\hlopt{:}\hlnum{5}\hlstd{)\{}
\hlstd{tmp}\hlkwb{<-}\hlstd{tablo}\hlopt{$}\hlstd{`tmp$Gene.name`[tablo}\hlopt{$}\hlstd{nbats}\hlopt{==}\hlstd{b} \hlopt{&} \hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlopt{==}\hlstd{p]}
\hlkwa{if}\hlstd{(}\hlkwd{length}\hlstd{(tmp)}\hlopt{>}\hlnum{0} \hlopt{&} \hlkwd{length}\hlstd{(tmp)}\hlopt{<=}\hlnum{8}\hlstd{)\{}
\hlkwd{text}\hlstd{(b,}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=(p}\hlopt{-}\hlnum{0.4}\hlstd{),} \hlkwc{to}\hlstd{=(p}\hlopt{+}\hlnum{0.4}\hlstd{),} \hlkwc{length.out} \hlstd{=} \hlkwd{length}\hlstd{(tmp)), tmp,} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlstd{\}}\hlkwa{else if} \hlstd{(}\hlkwd{length}\hlstd{(tmp)}\hlopt{>}\hlnum{8} \hlopt{&} \hlkwd{length}\hlstd{(tmp)}\hlopt{<=}\hlnum{16}\hlstd{)\{}
\hlkwd{print}\hlstd{(}\hlkwd{c}\hlstd{(p, b))}
\hlkwd{text}\hlstd{((b}\hlopt{-}\hlnum{0.3}\hlstd{),}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=(p}\hlopt{-}\hlnum{0.4}\hlstd{),} \hlkwc{to}\hlstd{=(p}\hlopt{+}\hlnum{0.4}\hlstd{),} \hlkwc{length.out} \hlstd{=} \hlnum{8}\hlstd{), tmp[}\hlnum{1}\hlopt{:}\hlnum{8}\hlstd{],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlkwd{text}\hlstd{((b}\hlopt{+}\hlnum{0.3}\hlstd{),}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=(p}\hlopt{-}\hlnum{0.4}\hlstd{),} \hlkwc{to}\hlstd{=(p}\hlopt{+}\hlnum{0.4}\hlstd{),} \hlkwc{length.out} \hlstd{= (}\hlkwd{length}\hlstd{(tmp)}\hlopt{-}\hlnum{8}\hlstd{)), tmp[}\hlnum{9}\hlopt{:}\hlkwd{length}\hlstd{(tmp)],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlstd{\}}\hlkwa{else if} \hlstd{(}\hlkwd{length}\hlstd{(tmp)}\hlopt{>}\hlnum{16}\hlstd{)\{}
\hlkwd{text}\hlstd{(b,p,} \hlkwd{paste0}\hlstd{(}\hlkwd{length}\hlstd{(tmp),} \hlstr{" values"}\hlstd{))}
\hlstd{\}}
\hlstd{\}}
\hlstd{\}}
\end{alltt}
\begin{verbatim}
## [1] 0 1
## [1] 2 0
## [1] 2 1
\end{verbatim}
\begin{alltt}
\hlstd{tmp}\hlkwb{<-}\hlstd{tablo}\hlopt{$}\hlstd{`tmp$Gene.name`[tablo}\hlopt{$}\hlstd{nbats}\hlopt{==}\hlnum{0} \hlopt{&} \hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlopt{==}\hlnum{1}\hlstd{]}
\hlkwd{text}\hlstd{(}\hlopt{-}\hlnum{0.4}\hlstd{,}\hlopt{-}\hlnum{1.2}\hlstd{,} \hlstr{"p=1/n=0"}\hlstd{,} \hlkwc{cex}\hlstd{=}\hlnum{0.6}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlnum{18}\hlstd{),}\hlopt{-}\hlnum{1.1}\hlstd{, tmp[}\hlnum{1}\hlopt{:}\hlnum{18}\hlstd{],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{3}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlkwd{length}\hlstd{(tmp)}\hlopt{-}\hlnum{18}\hlstd{),}\hlopt{-}\hlnum{1.3}\hlstd{, tmp[}\hlnum{19}\hlopt{:}\hlkwd{length}\hlstd{(tmp)],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlstd{tmp}\hlkwb{<-}\hlstd{tablo}\hlopt{$}\hlstd{`tmp$Gene.name`[tablo}\hlopt{$}\hlstd{nbats}\hlopt{==}\hlnum{1} \hlopt{&} \hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlopt{==}\hlnum{1}\hlstd{]}
\hlkwd{text}\hlstd{(}\hlopt{-}\hlnum{0.4}\hlstd{,}\hlopt{-}\hlnum{1.7}\hlstd{,} \hlstr{"p=1/n=1"}\hlstd{,} \hlkwc{cex}\hlstd{=}\hlnum{0.6}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlnum{18}\hlstd{),}\hlopt{-}\hlnum{1.6}\hlstd{, tmp[}\hlnum{1}\hlopt{:}\hlnum{18}\hlstd{],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{2}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlkwd{length}\hlstd{(tmp)}\hlopt{-}\hlnum{18}\hlstd{),}\hlopt{-}\hlnum{1.8}\hlstd{, tmp[}\hlnum{19}\hlopt{:}\hlkwd{length}\hlstd{(tmp)],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
{\ttfamily\noindent\bfseries\color{errorcolor}{\#\# Error in seq.default(from = 0.1, to = 2, length.out = length(tmp) - 18): 'length.out' must be a non-negative number}}\begin{alltt}
\hlstd{tmp}\hlkwb{<-}\hlstd{tablo}\hlopt{$}\hlstd{`tmp$Gene.name`[tablo}\hlopt{$}\hlstd{nbats}\hlopt{==}\hlnum{0} \hlopt{&} \hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlopt{==}\hlnum{0}\hlstd{]}
\hlkwd{text}\hlstd{(}\hlopt{-}\hlnum{0.4}\hlstd{,}\hlopt{-}\hlnum{2.2}\hlstd{,} \hlstr{"p=0/n=0"}\hlstd{,} \hlkwc{cex}\hlstd{=}\hlnum{0.6}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlnum{17}\hlstd{),}\hlopt{-}\hlnum{2.1}\hlstd{, tmp[}\hlnum{1}\hlopt{:}\hlnum{17}\hlstd{],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{4.4}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlkwd{length}\hlstd{(tmp)}\hlopt{-}\hlnum{17}\hlstd{),}\hlopt{-}\hlnum{2.3}\hlstd{, tmp[}\hlnum{18}\hlopt{:}\hlkwd{length}\hlstd{(tmp)],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\hlstd{tmp}\hlkwb{<-}\hlstd{tablo}\hlopt{$}\hlstd{`tmp$Gene.name`[tablo}\hlopt{$}\hlstd{nbats}\hlopt{==}\hlnum{2} \hlopt{&} \hlstd{tablo}\hlopt{$}\hlstd{nprimates}\hlopt{==}\hlnum{0}\hlstd{]}
\hlkwd{text}\hlstd{(}\hlopt{-}\hlnum{0.4}\hlstd{,}\hlopt{-}\hlnum{2.7}\hlstd{,} \hlstr{"p=0/n=2"}\hlstd{,} \hlkwc{cex}\hlstd{=}\hlnum{0.6}\hlstd{)}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{5.5}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlnum{18}\hlstd{),}\hlopt{-}\hlnum{2.6}\hlstd{, tmp[}\hlnum{1}\hlopt{:}\hlnum{18}\hlstd{],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/tablo-1}
\begin{kframe}\begin{alltt}
\hlkwd{text}\hlstd{(}\hlkwd{seq}\hlstd{(}\hlkwc{from}\hlstd{=}\hlnum{0.1}\hlstd{,} \hlkwc{to}\hlstd{=}\hlnum{1}\hlstd{,} \hlkwc{length.out} \hlstd{=} \hlkwd{length}\hlstd{(tmp)}\hlopt{-}\hlnum{18}\hlstd{),}\hlopt{-}\hlnum{2.8}\hlstd{, tmp[}\hlnum{19}\hlopt{:}\hlkwd{length}\hlstd{(tmp)],} \hlkwc{cex}\hlstd{=}\hlnum{0.4}\hlstd{)}
\end{alltt}
{\ttfamily\noindent\bfseries\color{errorcolor}{\#\# Error in seq.default(from = 0.1, to = 1, length.out = length(tmp) - 18): 'length.out' must be a non-negative number}}\end{kframe}