Révision abfc14b8

b/doc/Chuffart_NM2_sweave/.Rhistory
1
Stangle("Chuffart_NM2_sweave.Rnw"); source("Chuffart_NM2_sweave.R")
b/doc/Chuffart_NM2_sweave/Chuffart_NM2_sweave.Rnw
1
\documentclass[a4paper]{article}
2
\usepackage{a4wide}
3
% \usepackage[top=2in, bottom=1.5in, left=1in, right=1in]{geometry}
4
\usepackage{subfigure}
5
\title{NucleoMiner 2.0: Detecting quantitative epigenomic variation at single-nucleosome resolution.} \author{Florent Chuffart}
6
\begin{document} 
7
  \maketitle
8
<<dir-and-date, echo = FALSE, eval=FALSE >>=
9
date();
10
R.Version()$version.string;
11
tmplyxdir <- getwd();
12
setwd(".")
13
getwd();
14
@
15
\tableofcontents{}
16

  
17
\section{Context}
18
  
19
<<dir-and-date, echo=FALSE, results=verbatim>>=
20
getwd()
21
date()
22
R.Version()$version.string
23
@
24

  
25
% \section{Workflow description}
26
%
27
% See Figure~\ref{fig:dataflow}.
28
% \begin{figure}
29
% \mbox{\includegraphics[trim = 0mm 0mm 0mm 0mm, width=.99\linewidth]{figs/NM2_fig1}}
30
% \caption{\label{fig:dataflow}Bowtie, TemplateFilter, intra-strain LOD of positions, inter-strain LOD of positions, Well-positioned, Fuzzy Regions, DESeq, FDR.}
31
% \end{figure}
32

  
33
\section{Dataset description}
34

  
35
<< load_config, echo=FALSE, results=hide , eval=TRUE >>=
36
  library(rjson)
37
  library(nucleominer)
38

  
39
  # Read config file
40
  json_conf_file = "nucleo_miner_config.json"
41
  config = fromJSON(paste(readLines(json_conf_file), collapse=""))
42

  
43
  # Read sample file
44
  all_samples = get_content(config$CSV_SAMPLE_FILE, "cvs", sep=";", head=TRUE, stringsAsFactors=FALSE)  
45
  
46
  # Remove samples that seems to be eronous for some manipulation efficency reasons e.g. PCR
47
  all_samples = all_samples[!(all_samples$id %in% c(33,45,48,55)), ]
48

  
49
  combis = list(c("BY", "RM"))
50
  combi = combis[[1]]
51
  strains =  combis[[1]]
52
  marker = "H3K14ac"
53
  manips = c("Mnase_Seq", marker)
54
  all_samples = all_samples [
55
         (all_samples$marker == "Mnase_Seq" | all_samples$marker == marker) 
56
       & (all_samples$strain == "BY" | all_samples$strain == "RM"),]
57
@
58

  
59
{\footnotesize
60
<<echo=TRUE, eval=TRUE>>= 
61
all_samples
62
@
63
}
64

  
65

  
66

  
67

  
68
\section{Genome alignments and fragmentation}
69

  
70
\subsection{Customize Function "translate"}
71

  
72
Customize function "translate" which allows to use the alignments when performing various tasks.
73

  
74
Several possibilities:
75
\begin{itemize}
76
  \item All in same strain: regions are whole chromosomes and use the default translate function which is neutral.
77
  \item Two or more strains: Edit a list of regions and customize the translate function which performs the correspondence between the different genomes. How we did it: Explain how to obtain .c2c with NM1.0, then use it to produce the list of regions and customize "translate".
78
\end{itemize}
79

  
80
\subsection{Computing Common Uninterrupted Regions (CUR) Between Strains}
81

  
82

  
83
<< compute_cur, echo=FALSE, eval=TRUE, results=hide>>= 
84
  cur_filename = paste(config$RESULTS_DIR, "/all_curs.tab", sep="")
85
  if (!file.exists(config$RESULTS_DIR)) {
86
    dir.create(file.path(".", config$RESULTS_DIR), recursive=TRUE)
87
  }
88
  if (!file.exists(cur_filename)) {
89
    print("Computing and caching common uninterrupted regions...")
90
    write.table(compute_inter_all_strain_curs(config=config), file=cur_filename, row.names=FALSE, quote=FALSE)  
91
    print("done.")
92
  }
93
  curs = get_content(cur_filename, "table", stringsAsFactors=FALSE, head=TRUE)	
94
  curs$chr = as.character(curs$chr)
95
  curs = curs[curs$chr==1, ]
96
  # Filtering CURs of the 1st chromosome
97
  curs = curs[curs$chr==1, ]
98
  cur_indexes = 1:length(curs[,1])
99
@
100

  
101
{\footnotesize
102
<<echo=TRUE, eval=TRUE>>= 
103
head(curs)
104
@
105
}
106

  
107
\section{Inference of well-positioned nucleosomes in each strain}
108

  
109
\subsection{Run TemplateFilter on Mnase Samples}
110

  
111
For each sample we perform TemplateFilter analysis. TemplateFilter is launched for each entire chromosome (Not only CUR).
112

  
113
{\footnotesize
114
<<template_filter, echo=FALSE, eval=TRUE >>= 
115
  for (id in 1:6) {
116
    cmd = paste("TemplateFilter data/TF/sample_", id, "_TF.txt data/Templates_7.1.txt -out_prefix data/TF/sample_", id, "_all_nucs -corr_bound 0.5 -min_width 100 -max_width 160 -overlap 3", sep="")
117
    print(paste(cmd))      
118
    if (!file.exists(paste("data/TF/sample_", id, "_all_nucs.tab", sep=""))) {
119
      system(cmd)
120
    }
121
  }
122
@
123
}
124

  
125
\subsection{Extracting Maps for Well Positionned and Fuzzy Nucleosomes}
126

  
127
\setkeys{Gin}{width=.99\linewidth}
128
\begin{figure}
129
\begin{center}
130
  \subfigure{
131
<< intra_strain_alignment1, echo=FALSE, results=hide, fig=TRUE, height=5, width=16, eval=TRUE >>= 
132
cur_index = 2
133
cur = as.list(curs[cur_index,])
134
cur$begin = 168850
135
cur$end =   170200
136
expes = list(c(1,2,3))
137
replicates = build_replicates(expes, cur, all_samples= all_samples, config=config)
138
out = watch_samples(replicates, config$READ_LENGTH, 
139
      plot_coverage = FALSE, 
140
      plot_squared_reads = TRUE, 
141
      plot_ref_genome = FALSE, 
142
      plot_arrow_raw_reads = FALSE, 
143
      plot_arrow_nuc_reads = FALSE, 
144
      plot_gaussian_reads = FALSE, 
145
      plot_gaussian_unified_reads = FALSE, 
146
      plot_ellipse_nucs = FALSE, 
147
      plot_wp_nucs = FALSE, 
148
      plot_fuzzy_nucs = FALSE, 
149
      plot_wp_nuc_model = FALSE, 
150
      plot_common_nucs = FALSE, 
151
      height = 300,
152
      xlab = "",
153
      config = config
154
)
155
@
156
}
157
  \subfigure{
158
<< intra_strain_alignment2, echo=FALSE, results=hide, fig=TRUE, height=5, width=16, eval=TRUE >>= 
159
out = watch_samples(replicates, config$READ_LENGTH, 
160
      plot_coverage = FALSE, 
161
      change_col = FALSE,
162
      plot_squared_reads = TRUE, 
163
      plot_ref_genome = FALSE, 
164
      plot_arrow_raw_reads = FALSE, 
165
      plot_arrow_nuc_reads = FALSE, 
166
      plot_gaussian_reads = FALSE, 
167
      plot_gaussian_unified_reads = FALSE, 
168
      plot_ellipse_nucs = TRUE, 
169
      plot_wp_nucs = FALSE, 
170
      plot_fuzzy_nucs = FALSE, 
171
      plot_wp_nuc_model = FALSE, 
172
      plot_common_nucs = FALSE, 
173
      plot_chain = FALSE, 
174
      height = 300,
175
      xlab = "",
176
      config = config
177
)
178
@
179
}
180
  \subfigure{
181
<< intra_strain_alignment3, echo=FALSE, results=hide, fig=TRUE, height=5, width=16, eval=TRUE >>= 
182
 config$TRACK_LOD_OFFSET = c(0,0,0,0,0,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0)
183
 config$LEGEND_LOD_POS = c(2,2,2,2,2,2,2,4,2,2,4,3,2,4,4,2,4,2,2,2,4)
184
 out = watch_samples(replicates, config$READ_LENGTH, 
185
      plot_coverage = FALSE, 
186
      change_col = FALSE,
187
      plot_squared_reads = TRUE, 
188
      plot_ref_genome = FALSE, 
189
      plot_arrow_raw_reads = FALSE, 
190
      plot_arrow_nuc_reads = FALSE, 
191
      plot_gaussian_reads = FALSE, 
192
      plot_gaussian_unified_reads = TRUE, 
193
      plot_ellipse_nucs = FALSE, 
194
      plot_wp_nucs = FALSE, 
195
      plot_fuzzy_nucs = FALSE, 
196
      plot_wp_nuc_model = FALSE, 
197
      plot_common_nucs = FALSE, 
198
      plot_chain = TRUE, 
199
      height = 300,
200
      xlab = "",
201
      config = config
202
)
203
@
204
}
205
  \subfigure{
206
<< intra_strain_alignment4, echo=FALSE, results=hide, fig=TRUE, height=5, width=16, eval=TRUE >>= 
207
out = watch_samples(replicates, config$READ_LENGTH, 
208
      plot_coverage = FALSE, 
209
      change_col = FALSE,
210
      plot_squared_reads = TRUE, 
211
      plot_ref_genome = FALSE, 
212
      plot_arrow_raw_reads = FALSE, 
213
      plot_arrow_nuc_reads = FALSE, 
214
      plot_gaussian_reads = FALSE, 
215
      plot_gaussian_unified_reads = FALSE, 
216
      plot_ellipse_nucs = TRUE, 
217
      plot_wp_nucs = TRUE, 
218
      plot_fuzzy_nucs = FALSE, 
219
      plot_wp_nuc_model = FALSE, 
220
      plot_common_nucs = FALSE, 
221
      height = 300,
222
      xlab = "",
223
      config = config
224
)
225
@
226
}
227
  \subfigure{
228
<< intra_strain_alignment_fuzzy, echo=FALSE, results=hide, fig=TRUE, height=5, width=16, eval=TRUE >>= 
229
out = watch_samples(replicates, config$READ_LENGTH, 
230
      plot_coverage = FALSE, 
231
      change_col = FALSE,
232
      plot_squared_reads = TRUE, 
233
      plot_ref_genome = FALSE, 
234
      plot_arrow_raw_reads = FALSE, 
235
      plot_arrow_nuc_reads = FALSE, 
236
      plot_gaussian_reads = FALSE, 
237
      plot_gaussian_unified_reads = FALSE, 
238
      plot_ellipse_nucs = FALSE, 
239
      plot_wp_nucs = TRUE, 
240
      plot_fuzzy_nucs = TRUE, 
241
      plot_wp_nuc_model = FALSE, 
242
      plot_common_nucs = FALSE, 
243
      height = 300,
244
      xlab = "",
245
      config = config
246
)
247
@
248
}
249
\end{center}
250
\caption{Extracting Maps for Well Positionned and Fuzzy Nucleosomes}
251
\label{fig:inf}
252
\end{figure}
253

  
254

  
255

  
256
\section{Alignment of nucleosomes for each pair of strains}
257

  
258
\setkeys{Gin}{width=.99\linewidth}
259
\begin{figure}
260
\begin{center}
261
  \subfigure{
262
<< inter_strain_alignment_wp, echo=FALSE, results=hide, fig=TRUE, height=6, width=16, eval=TRUE >>=
263
expes = list(c(1,2,3), c(4,5,6))
264
replicates = build_replicates(expes, cur, all_samples= all_samples, config=config)
265
out = watch_samples(replicates, config$READ_LENGTH, 
266
      plot_coverage = FALSE, 
267
      plot_squared_reads = TRUE, 
268
      plot_ref_genome = FALSE, 
269
      plot_arrow_raw_reads = FALSE, 
270
      plot_arrow_nuc_reads = FALSE, 
271
      plot_gaussian_reads = FALSE, 
272
      plot_gaussian_unified_reads = FALSE, 
273
      plot_ellipse_nucs = FALSE, 
274
      plot_wp_nucs = TRUE, 
275
      plot_wp_nuc_model = TRUE, 
276
      plot_common_nucs = TRUE, 
277
      height = 300,
278
      config = config
279
)
280
@
281
}
282
  \subfigure{
283
<< inter_strain_alignment_unrs, echo=FALSE, results=hide, fig=TRUE, height=6, width=16, eval=TRUE >>= 
284
out = watch_samples(replicates, config$READ_LENGTH, 
285
      plot_coverage = FALSE, 
286
      plot_squared_reads = TRUE, 
287
      plot_ref_genome = FALSE, 
288
      plot_arrow_raw_reads = FALSE, 
289
      plot_arrow_nuc_reads = FALSE, 
290
      plot_gaussian_reads = FALSE, 
291
      plot_gaussian_unified_reads = FALSE, 
292
      plot_ellipse_nucs = FALSE, 
293
      plot_wp_nucs = TRUE, 
294
      plot_wp_nuc_model = FALSE, 
295
      plot_common_nucs = TRUE, 
296
      plot_common_unrs = TRUE, 
297
      height = 300,
298
      config = config
299
)
300
@
301
}
302
\setkeys{Gin}{width=.49\linewidth}
303
  \subfigure{
304
<< inter_strain_alignment_unrs_1, echo=FALSE, results=hide, fig=TRUE, height=6, width=8, eval=TRUE >>= 
305
cur_index = 3
306
cur = as.list(curs[cur_index,])
307
cur$begin = 193500
308
cur$end = 194000
309
replicates = build_replicates(expes, cur, all_samples= all_samples, config=config)
310
out = watch_samples(replicates, config$READ_LENGTH, 
311
  plot_coverage = FALSE, 
312
  plot_squared_reads = TRUE, 
313
  plot_ref_genome = FALSE, 
314
  plot_arrow_raw_reads = FALSE, 
315
  plot_arrow_nuc_reads = FALSE, 
316
  plot_gaussian_reads = FALSE, 
317
  plot_gaussian_unified_reads = FALSE, 
318
  plot_ellipse_nucs = FALSE, 
319
  plot_wp_nucs = TRUE, 
320
  plot_wp_nuc_model = FALSE, 
321
  plot_common_nucs = TRUE, 
322
  plot_common_unrs = TRUE, 
323
  height = 300,
324
  config = config
325
)
326
@
327
}%
328
\subfigure{
329
<< inter_strain_alignment_unrs_3, echo=FALSE, results=hide, fig=TRUE, height=6, width=8, eval=TRUE >>= 
330
cur$begin = 196758
331
cur$end = 197425
332
replicates = build_replicates(expes, cur, all_samples= all_samples, config=config)
333
out = watch_samples(replicates, config$READ_LENGTH, 
334
  plot_coverage = FALSE, 
335
  plot_squared_reads = TRUE, 
336
  plot_ref_genome = FALSE, 
337
  plot_arrow_raw_reads = FALSE, 
338
  plot_arrow_nuc_reads = FALSE, 
339
  plot_gaussian_reads = FALSE, 
340
  plot_gaussian_unified_reads = FALSE, 
341
  plot_ellipse_nucs = FALSE, 
342
  plot_wp_nucs = TRUE, 
343
  plot_wp_nuc_model = FALSE, 
344
  plot_common_nucs = TRUE, 
345
  plot_common_unrs = TRUE, 
346
  height = 300,
347
  config = config
348
)
349
@
350
}
351
\end{center}
352
\caption{Alignment of nucleosomes for each pair of strains}
353
\end{figure}
354

  
355

  
356

  
357

  
358

  
359

  
360

  
361

  
362

  
363
<< distrib_wp_size_precossesing, echo=FALSE, eval=TRUE >>= 
364
# if (!file.exists(unr_map_filename) & !file.exists(wp_map_filename) & !file.exists(fuzzy_map_filename)) {
365
#   source("extract_maps.R")
366
# }
367

  
368
BY_wp = read.table( paste(config$RESULTS_DIR, "/full/BY_wp.tab", sep=""), header=TRUE)
369
BY_wp = BY_wp[BY_wp$wp == 1,]
370
BY_wp$length = BY_wp$upper_bound - BY_wp$lower_bound
371

  
372
RM_wp = read.table(paste(config$RESULTS_DIR, "/full/RM_wp.tab", sep=""), header=TRUE)
373
RM_wp = RM_wp[RM_wp$wp == 1,]
374
RM_wp$length = RM_wp$upper_bound - RM_wp$lower_bound
375

  
376
BY_fuzzy = read.table(paste(config$RESULTS_DIR, "/full/BY_fuzzy.tab", sep=""), header=TRUE)
377
BY_fuzzy$length = BY_fuzzy$upper_bound - BY_fuzzy$lower_bound
378
BY_fuzzy = BY_fuzzy[BY_fuzzy$length >= 75, ]
379

  
380
RM_fuzzy = read.table(paste(config$RESULTS_DIR, "/full/RM_fuzzy.tab", sep=""), header=TRUE)
381
RM_fuzzy$length = RM_fuzzy$upper_bound - RM_fuzzy$lower_bound
382
RM_fuzzy = RM_fuzzy[RM_fuzzy$length >= 75, ]
383

  
384
BY_unr = read.table(paste(config$RESULTS_DIR, "/full/BY_in_BY_RM_unr.tab", sep=""), header=TRUE)
385
BY_unr$length = BY_unr$upper_bound - BY_unr$lower_bound
386
BY_unr = BY_unr[BY_unr$length >= 75, ]
387

  
388
common_wp_filename = paste(config$RESULTS_DIR, "/full/BY_RM_common_wp.tab", sep="")
389
common_wp = read.table(common_wp_filename, header=TRUE)
390

  
391
@
392

  
393
{\footnotesize
394
<<echo=TRUE, eval=TRUE>>= 
395
head(BY_wp)
396
head(BY_fuzzy)
397
head(BY_unr)
398
@
399
}
400

  
401
\setkeys{Gin}{width=.33\linewidth}
402
\begin{figure}
403
\begin{center}
404
  \subfigure{
405
<< distrib_wp_size, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
406
hist(BY_wp$length, nclass=90, main = paste("Well positioned in BY"), xlab = "size (bp)")
407
@
408
}%
409
  \subfigure{
410
<< distrib_fuzzy_size, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
411
hist(BY_fuzzy$length, nclass=150, main = paste("Fuzzy in BY"), xlab = "size (bp)")
412
abline(v=1:10 * 150, lty=2, col="grey")
413
@
414
}%
415
  \subfigure{
416
<< distrib_unr_size, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
417
hist(BY_unr$length, nclass=200, main = paste("UNR in BY-RM"), xlab = "size (bp)")
418
abline(v=1:30 * 150, lty=2, col="grey")
419
@
420
}
421
\end{center}
422
\caption{Distribution of nucleosome size}
423
\end{figure}
424

  
425

  
426

  
427

  
428

  
429

  
430
<< distrib_llr_tails, echo=FALSE, eval=TRUE >>= 
431
by_llrs_filename = paste(config$RESULTS_DIR, "/full/BY_llrs.tab", sep="")
432
rm_llrs_filename = paste(config$RESULTS_DIR, "/full/RM_llrs.tab", sep="")
433
by_rm_llrs_filename = paste(config$RESULTS_DIR, "/full/BY_RM_llrs.tab", sep="")
434

  
435
BY_llrs = read.table(by_llrs_filename, header=TRUE)
436
RM_llrs = read.table(rm_llrs_filename, header=TRUE)
437
BY_RM_llrs = read.table(by_rm_llrs_filename, header=TRUE)
438
@
439

  
440

  
441

  
442
\setkeys{Gin}{width=.33\linewidth}
443
\begin{figure}
444
\begin{center}
445
  \subfigure{
446
<< distrib_llr1_by, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
447
hist(BY_llrs[[1]], nclass=200, main="BY LLR1", xlim=c(0,500))
448
abline(v=20, lty=2, col="grey")
449
@
450
}%
451
  \subfigure{
452
<< distrib_llr1_rm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
453
hist(RM_llrs[[1]], nclass=200, main="RM LLR1", xlim=c(0,500))
454
abline(v=20, lty=2, col="grey")
455
@
456
}%
457
  \subfigure{
458
<< distrib_all_llr3_byrm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
459
hist(BY_RM_llrs[[1]], nclass=200, main="All BY RM LLR3", xlim=c(0,1500))
460
abline(v=100, lty=2, col="grey")
461
@
462
}%
463

  
464
  \subfigure{
465
<< distrib_llr2_by, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
466
hist(BY_wp$wp_llr,nclass=100, xlab = "BY LLR3", main = "BY replicates")
467
@
468
}%
469
  \subfigure{
470
<< distrib_llr2_rm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
471
hist(RM_wp$wp_llr,nclass=100, xlab = "RM LLR2", main = "RM replicates")
472
@
473
}%
474
  \subfigure{
475
<< distrib_filtred_llr3_byrm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
476
hist(common_wp$llr_score,nclass=100, xlab = "BY RM LLR3 for paired wp", main = "BY-RM comparisons")
477
@
478
}%
479

  
480
\end{center}
481
\caption{Distribution of LLRs}
482
\end{figure}
483

  
484

  
485
\setkeys{Gin}{width=.33\linewidth}
486

  
487
\begin{figure}
488
\begin{center}
489
  \subfigure{
490
<< distrib_llrpval_by, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
491
by_pv = BY_wp$wp_pval
492
hist(-log10(by_pv),nclass=100, xlab = "-log10(pvalue)", main = "BY replicates")
493
thres_pval = FDR(by_pv, 0.005)
494
abline(v=-log10(thres_pval), lty=2, col="grey")
495
@
496
}%
497
  \subfigure{
498
<< distrib_llrpval_rm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
499
rm_pv = RM_wp$wp_pval
500
hist(-log10(rm_pv),nclass=100, xlab = "-log10(pvalue)", main = "RM replicates")
501
thres_pval = FDR(rm_pv, 0.005)
502
abline(v=-log10(thres_pval), lty=2, col="grey")
503
@
504
}%
505
  \subfigure{
506
<< distrib_llrpval_byrm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
507
cpv = common_wp$common_wp_pval
508
hist(-log10(cpv),nclass=100, xlab = "-log10(pvalue)", main = "BY-RM comparisons")
509
thres_pval = FDR(cpv, 0.005)
510
abline(v=-log10(thres_pval), lty=2, col="grey")
511
@
512
}%
513
\end{center}
514
\caption{Distribution of LLR2 and LLR3 p-values}
515
\end{figure}
516

  
517

  
518

  
519

  
520
{\footnotesize
521
<< stat_about, echo=TRUE , eval=TRUE >>= 
522
by_pv = na.omit(BY_wp$wp_pval)
523
length(by_pv)
524
print(sum(by_pv > FDR(by_pv, 0.005)))
525

  
526
rm_pv = na.omit(RM_wp$wp_pval)
527
length(rm_pv)
528
print(sum(rm_pv > FDR(rm_pv, 0.005)))
529

  
530
dim(common_wp)
531
cpv = common_wp$common_wp_pval
532
thres_pval = FDR(cpv, 0.005)
533
sum(cpv  < thres_pval)
534
length(cpv)
535
thres_pval
536
sum(cpv  < thres_pval)
537
sum(cpv  > 0.05)
538
sum(cpv  > 0.01)
539
@
540
}
541

  
542
<< stat_about2, echo=FALSE, eval=FALSE >>= 
543
foo = density(BY_wp$length)
544
print(foo$x[which(foo$y == max(foo$y))])
545

  
546
foo = density(RM_wp$length)
547
print(foo$x[which(foo$y == max(foo$y))])
548

  
549
print(sum(BY_fuzzy$length <= 200)/nrow(BY_fuzzy))
550

  
551
print(sum(RM_fuzzy$length <= 200)/nrow(RM_fuzzy))
552

  
553
print(sum(BY_fuzzy$length > 400)/nrow(BY_fuzzy))
554

  
555
print(sum(RM_fuzzy$length > 400)/nrow(RM_fuzzy))
556

  
557
print(sum(BY_unr$length > 600))
558

  
559
print(sum(BY_unr$length <= 200)/nrow(BY_unr))
560

  
561
print(sum(wpunr_mnase$mnase_l2fc_pval < FDR(wpunr_mnase$mnase_l2fc_pval , 0.05)))
562
@
563

  
564

  
565

  
566

  
567

  
568

  
569
\section{About Dyads Shifts}
570

  
571
<< dyad_shift, echo=FALSE, results=hide , eval=TRUE >>= 
572
common_wp_with_dyad_shift_filename = "cache/common_wp_with_dyad_shift.tab"
573
if (!file.exists(common_wp_with_dyad_shift_filename)) {
574
  tmp_trs_filename = paste(config$RESULTS_DIR, "/full/RM_wp_tr_2_BY.tab", sep="")
575
  trs_RM_to_BY = read.table(tmp_trs_filename, header=TRUE, stringsAsFactors=FALSE)
576
  diffs = apply(t(1:length(common_wp[,1])), 2, function(i) {
577
    if (i %% 100 == 1) {print(paste(i, "/", length(common_wp[,1])))}
578
    tmp_common_wp = common_wp[i,]
579
    tmp_BY_wp = BY_wp[BY_wp$cur_index == tmp_common_wp$cur_index & BY_wp$index_nuc == tmp_common_wp[[paste("index_nuc_", "BY", sep="")]],]   
580
    tmp_RM_wp = RM_wp[RM_wp$cur_index == tmp_common_wp$cur_index & RM_wp$index_nuc == tmp_common_wp[[paste("index_nuc_", "RM", sep="")]],]   
581
    tr = trs_RM_to_BY[trs_RM_to_BY$cur_index == tmp_RM_wp$cur_index & trs_RM_to_BY$index_nuc == tmp_RM_wp$index_nuc, ]
582
    dyad_rm = (tr$end + tr$begin) / 2
583
    dyad_by = (tmp_BY_wp$upper_bound + tmp_BY_wp$lower_bound) / 2
584
    diff = abs(dyad_by - dyad_rm)
585
    tr$diff = diff
586
    return(tr)
587
  })
588
  foo = do.call(rbind, diffs) 
589
  common_wp_with_dyad_shift = common_wp
590
  common_wp_with_dyad_shift$dyad_shift = unlist(foo$diff)
591
  save(common_wp_with_dyad_shift, diffs, file=common_wp_with_dyad_shift_filename)
592
}
593
load(common_wp_with_dyad_shift_filename)
594
common_wp = common_wp_with_dyad_shift
595
# layout(1:3)
596
# hist(common_wp_with_dyad_shift$dyad_shift, nclass=100)
597
# hist(common_wp_with_dyad_shift$dyad_shift[cpv < thres_pval], nclass=100)
598
# hist(common_wp_with_dyad_shift$dyad_shift[cpv >= thres_pval], nclass=50)
599
@
600

  
601
{ \footnotesize
602
<< >>= 
603
by_pv = BY_wp$wp_pval
604
thres_pval = FDR(by_pv, 0.005)
605
ds = BY_wp[BY_wp$wp_pval < thres_pval, ]$dyad_shift
606
quantile(ds, probs=((1:20)/20))
607

  
608
rm_pv = RM_wp$wp_pval
609
thres_pval = FDR(rm_pv, 0.005)
610
ds = RM_wp[RM_wp$wp_pval < thres_pval, ]$dyad_shift
611
quantile(ds, probs=((1:20)/20))
612

  
613
cpv = common_wp$common_wp_pval
614
thres_pval = FDR(cpv, 0.005)
615
quantile(common_wp$dyad_shift, probs=((1:20)/20))
616
quantile(common_wp$dyad_shift[cpv < thres_pval], probs=((1:20)/20))
617
quantile(common_wp$dyad_shift[cpv >= thres_pval], probs=((1:20)/20))
618
@
619
}
620

  
621

  
622
\setkeys{Gin}{width=.33\linewidth}
623

  
624
\begin{figure}
625
\begin{center}
626
  \subfigure{
627
<< distrib_dyad_shift_by, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
628
hist(ds, nclass=100, xlab = "dyad shift", main = "BY replicates")
629
@
630
}%
631
  \subfigure{
632
<< distrib_dyad_shift_rm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
633
hist(RM_wp$dyad_shift, nclass=100, xlab = "dyad_shift", main = "RM replicates")
634
@
635
}%
636
  \subfigure{
637
<< distrib_dyad_shift_byrm, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>= 
638
hist(common_wp_with_dyad_shift$dyad_shift, nclass=100, main="BY-RM common wp")
639
@
640
}%
641
\end{center}
642
\caption{Distribution of dyad shifts}
643
\end{figure}
644

  
645

  
646
% \section{Counting coverage for each nucleosome}
647
%
648
% << count_reads, echo=FALSE, eval=TRUE>>=
649
% wp_count_filename = paste(config$RESULTS_DIR, "/full/",combi[1],"_",combi[2],"_",marker,"_wp_and_nbreads.tab",sep="")
650
% unr_count_filename = paste(config$RESULTS_DIR, "/full/",combi[1],"_",combi[2],"_",marker,"_unr_and_nbreads.tab",sep="")
651
% if (!file.exists(wp_count_filename) | !file.exists(unr_count_filename)) {
652
%   source("count_reads.R")
653
% }
654
% wp_count = read.table(wp_count_filename, header=TRUE)
655
% unr_count = read.table(unr_count_filename, header=TRUE)
656
% @
657
% << >>=
658
% head(wp_count)
659
% head(unr_count)
660
% @
661

  
662

  
663
\section{Statistical analysis of quantitative variation}
664

  
665

  
666
{\footnotesize
667
<<>>= 
668
wpunr_snep = read.table(paste(config$RESULTS_DIR, "/full/" ,combi[1],"_",combi[2],"_",marker,"_wp_snep.tab",sep=""), header=TRUE)
669
head(wpunr_snep)
670

  
671
check_iso_snep = wpunr_snep = read.table(paste(config$RESULTS_DIR, "/full/" ,combi[1],"_",combi[2],"_",marker,"_wpunr_snep.tab",sep=""), header=TRUE)
672
check_iso_snep = check_iso_snep[order(check_iso_snep$chr_BY, check_iso_snep$lower_bound_BY),]
673
# isolated, 943 iso wp and unr over 5240 for Fabien
674
nb_iso = 0
675
for (snep_index in which(check_iso_snep$snep_index)) {
676
  cur_snep = check_iso_snep[snep_index, ]
677
  prev_snep = check_iso_snep[snep_index-1,]
678
  next_snep = check_iso_snep[snep_index+1,]
679
  print(snep_index - 1)  
680

  
681
  if (nrow(prev_snep) == 0) {
682
    is_prev_not_snep = TRUE
683
  } else if (prev_snep$pvalsGLM >= 0.01 | prev_snep$cur_index != cur_snep$cur_index
684
    ) { # it's NOT a SNEP
685
    is_prev_not_snep = TRUE
686
  } else {
687
    is_prev_not_snep = FALSE    
688
  }
689

  
690
  if (nrow(next_snep) == 0) {
691
    is_next_not_snep = TRUE
692
  } else if (next_snep$pvalsGLM >= 0.01 | next_snep$cur_index != cur_snep$cur_index
693
    ) { # it's NOT a SNEP
694
    is_next_not_snep = TRUE
695
  } else {
696
    is_next_not_snep = FALSE    
697
  }
698

  
699
  if (is_prev_not_snep & is_next_not_snep) {
700
    nb_iso = nb_iso + 1
701
  }
702
}
703

  
704
print(nb_iso)
705
print(nb_iso/sum(check_iso_snep$snep_index))
706

  
707

  
708
wpunr_mnase = read.table( paste(config$RESULTS_DIR, "/full/" ,combi[1],"_",combi[2],"_wp_mnase.tab",sep=""), header=TRUE)
709
head(wpunr_mnase)
710

  
711
sf = read.table(paste(config$RESULTS_DIR,"/full/size_factors.tab",sep=""), header=TRUE)        
712
head(sf)
713
@
714
}
715

  
716
<<launch_deseq, echo=FALSE, results=hide, eval=TRUE >>= 
717
top_left_index = which(-log10(wpunr_mnase$mnase_l2fc_pval) < 1 & -log10(wpunr_snep$pvalsGLM) > 12)[1]
718
top_right_index = which(-log10(wpunr_mnase$mnase_l2fc_pval) > 10 & -log10(wpunr_snep$pvalsGLM) > 10)[1]
719
bottom_right_index = which(-log10(wpunr_mnase$mnase_l2fc_pval) > 10 & -log10(wpunr_snep$pvalsGLM) < 2)[1]
720

  
721
curs = get_content(cur_filename, "table", stringsAsFactors=FALSE, head=TRUE)	
722
the_nuc =   wpunr_snep[top_left_index,]
723
cur_index = the_nuc$cur_index
724
cur = as.list(curs[cur_index,])
725
cur$begin = the_nuc$lower_bound_BY - 500
726
cur$end = the_nuc$upper_bound_BY + 1500
727
expes = list()
728
for (manip in manips) {
729
  for (strain in strains) { 
730
    expes[[length(expes) + 1]] = all_samples[all_samples$strain == strain & all_samples$marker == manip, ]$id
731
  }
732
}
733
sf = sf[match(unlist(expes), sf$sample_id),]
734
replicates = build_replicates(expes, cur, all_samples= all_samples, config=config)
735
out = watch_samples(replicates, config$READ_LENGTH, 
736
  plot_coverage = TRUE, 
737
  plot_squared_reads = FALSE, 
738
  plot_ref_genome = FALSE, 
739
  plot_arrow_raw_reads = FALSE, 
740
  plot_arrow_nuc_reads = FALSE, 
741
  plot_gaussian_reads = FALSE, 
742
  plot_gaussian_unified_reads = FALSE, 
743
  plot_ellipse_nucs = FALSE, 
744
  plot_wp_nucs = TRUE, 
745
  plot_wp_nuc_model = FALSE, 
746
  plot_common_nucs = TRUE, 
747
  plot_common_unrs = TRUE, 
748
  height = 300,
749
  config = config
750
)
751
@
752

  
753
\setkeys{Gin}{width=.99\linewidth}
754
\begin{figure}
755
\begin{center}
756
\subfigure{
757
<< only_nuc_4_cov, echo=FALSE, results=hide, fig=TRUE, width=8, height=2, echo=FALSE, eval=TRUE >>= 
758
layout(matrix(c(2,1,1,2),1 , byrow=TRUE))
759
expes2 = list()
760
for (manip in c("Mnase_Seq")) {
761
  for (strain in strains) { 
762
    expes2[[length(expes2) + 1]] = all_samples[all_samples$strain == strain & all_samples$marker == manip, ]$id
763
  }
764
}
765
replicates = build_replicates(expes2, cur, all_samples= all_samples, config=config)
766
bar = watch_samples(replicates, config$READ_LENGTH, 
767
  plot_coverage = FALSE, 
768
  plot_squared_reads = FALSE, 
769
  plot_ref_genome = FALSE, 
770
  plot_arrow_raw_reads = FALSE, 
771
  plot_arrow_nuc_reads = FALSE, 
772
  plot_gaussian_reads = FALSE, 
773
  plot_gaussian_unified_reads = FALSE, 
774
  plot_ellipse_nucs = FALSE, 
775
  plot_wp_nucs = TRUE, 
776
  plot_wp_nuc_model = FALSE, 
777
  plot_common_nucs = TRUE, 
778
  plot_common_unrs = TRUE, 
779
  height = 300,
780
  config = config
781
)
782
@
783
}
784
\subfigure{
785
<< splitted_fig, fig=TRUE, width=8, height=7, results=hide, echo=FALSE, eval=TRUE >>= 
786
layout(matrix(c(1,5,5,2,4,4,4,3),2, byrow=TRUE))
787

  
788
data = data.frame(nb_reads = unlist(wpunr_snep[top_left_index,11:21])/sf$all_1, 
789
                  strain = c("BY", "BY", "BY", "RM", "RM", "RM", "BY", "BY", "BY", "RM", "RM"), 
790
                  manip = c("Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", marker, marker, marker, marker, marker))
791
boxplot(nb_reads ~ strain + manip, data, las=3)
792

  
793
data = data.frame(nb_reads = unlist(wpunr_snep[top_right_index,11:21])/sf$all_1, 
794
                  strain = c("BY", "BY", "BY", "RM", "RM", "RM", "BY", "BY", "BY", "RM", "RM"), 
795
                  manip = c("Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", marker, marker, marker, marker, marker))
796
boxplot(nb_reads ~ strain + manip, data, las=3)
797

  
798
data = data.frame(nb_reads = unlist(wpunr_snep[bottom_right_index,11:21])/sf$all_1, 
799
                  strain = c("BY", "BY", "BY", "RM", "RM", "RM", "BY", "BY", "BY", "RM", "RM"), 
800
                  manip = c("Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", "Mnase_Seq", marker, marker, marker, marker, marker))
801
boxplot(nb_reads ~ strain + manip, data, las=3)
802

  
803
plot(-log10(wpunr_mnase$mnase_l2fc_pval), -log10(wpunr_snep$pvalsGLM), col=wpunr_snep$snep_index + 1, xlab = "-log10(pvalue MNase)", ylab = "-log10(pvalue SNEP)", main = "", pch=".")
804
points(-log10(wpunr_mnase$mnase_l2fc_pval)[top_left_index], -log10(wpunr_snep$pvalsGLM)[top_left_index], col=wpunr_snep$snep_index[top_left_index] + 1, pch = 21, bg="grey")
805
points(-log10(wpunr_mnase$mnase_l2fc_pval)[bottom_right_index], -log10(wpunr_snep$pvalsGLM)[bottom_right_index], col=wpunr_snep$snep_index[bottom_right_index] + 1, pch = 21, bg="grey")
806
points(-log10(wpunr_mnase$mnase_l2fc_pval)[top_right_index], -log10(wpunr_snep$pvalsGLM)[top_right_index], col=wpunr_snep$snep_index[top_right_index] + 1, pch = 21, bg="grey")
807

  
808

  
809
plot(0,0, col=0, xlim=c(cur$begin, cur$end), ylim=c(-1000, 4500), xlab="chr I", ylab="Normalised coverage")
810
lty_manip = list(Mnase_Seq = 1)
811
lty_manip[[marker]] = 2
812
col_strain = list()
813
col_strain[[combi[[1]]]] = 2
814
col_strain[[combi[[2]]]] = 4
815
for (cov_name in names(out)) {
816
  sample_id = as.numeric(substr(cov_name, 5, 10))  
817
  strain = all_samples[all_samples$id == sample_id,]$strain
818
  manip = all_samples[all_samples$id == sample_id,]$marker
819
  lines(cur$begin:cur$end, out[[cov_name]](cur$begin:cur$end), pch="", col=col_strain[[strain]], lty=lty_manip[[manip]],lw=2)  
820
}
821
legend("topright", col=c(2, 4, 2, 4), c("BY Mnas Seq", "RM Mnas Seq", paste("BY", marker), paste("RM", marker)), lty=c(1, 1, 2, 2), lw=2)
822
@
823
}
824
\end{center}
825
\caption{MNase effect Vs. SNEP effect}
826
\end{figure}
827

  
828

  
829

  
830

  
831
\section{Consistency with Nagarajan PLoS Genetics 2010}
832

  
833
\subsection{Counting common ff Naga nucleosomes}
834

  
835
\setkeys{Gin}{width=.99\linewidth}
836
\begin{figure}
837
\begin{center}
838
<<ff_vs_naga_consistency_wp, fig=TRUE, results=hide, echo=FALSE, eval=TRUE >>=
839
print("Vs. Nagarajan for wp...")
840

  
841
ff_wp_snep = get_content(paste("results/full/BY_RM_H3K14ac_wp_snep.tab",sep=""), "table", header=TRUE,stringsAsFactors=FALSE);
842
ff_wp_snep$ff_center = (ff_wp_snep[,2] + ff_wp_snep[,3])/2;
843
ff_wp_snep$index_ff = 1:length(ff_wp_snep$chr_BY);
844

  
845
naga_orig_snep = get_content(paste("results/naga/Nagarajan_H3K14ac_BY_RM_NManova_nuc.txt",sep =""), "table", stringsAsFactors=FALSE);
846
naga_orig_snep$index_naga = 1:length(naga_orig_snep[,1])
847
naga_orig_snep$nuc_center = (naga_orig_snep[,5]+naga_orig_snep[,6])/2;
848
naga_orig_snep$chr_arab = apply(t(naga_orig_snep[,1]),2,function(x){ROM2ARAB()[[substr(as.character(x), 4,1000)]]});
849

  
850
ff_naga_common_wp_filename = "cache/ff_naga_common_wp.tab"
851

  
852
if (!file.exists(ff_naga_common_wp_filename)) {
853
  naga_chr_BY = list()
854
  for (chr_BY in unique(ff_wp_snep$chr_BY)) {
855
    naga_chr_BY[[paste("chr_BY",chr_BY, sep = "_")]] = naga_orig_snep[naga_orig_snep$chr_arab == chr_BY,]    
856
  }
857
  foo = apply(t(1:length(ff_wp_snep[,1])), 2, function(nuc_ff_index) {;
858
     if (nuc_ff_index %% 100 == 1) {print(paste(nuc_ff_index, "/", length(ff_wp_snep[,1])))}
859
     nuc_ff = ff_wp_snep[nuc_ff_index,]
860
     tmp_naga = naga_chr_BY[[paste("chr_BY", nuc_ff$chr_BY, sep = "_")]]
861
     tmp_ff_center = rep(nuc_ff$ff_center, length(tmp_naga[,1]))
862
     tmp_naga$diff = abs(tmp_naga$nuc_center - tmp_ff_center)
863
     index_nearest = order(tmp_naga$diff)[1]
864
     res = list(index_naga = tmp_naga[index_nearest,]$index_naga, index_ff = nuc_ff$index_ff, diff = tmp_naga[index_nearest,]$diff);
865
     return(res);
866
  });
867
  tmp_joint = do.call(rbind, foo)
868
  tmp_joint = data.frame(lapply(data.frame(tmp_joint, stringsAsFactors=FALSE), unlist), stringsAsFactors=FALSE)
869

  
870
  naga_indexes = unique(tmp_joint$index_naga)
871
  dup_naga_indexes = unique(tmp_joint[duplicated(tmp_joint$index_naga),]$index_naga)
872
  unique_naga_indexes = naga_indexes[!(naga_indexes %in% dup_naga_indexes)]
873
  uniq_joint_1 = tmp_joint[tmp_joint$index_naga %in% unique_naga_indexes,]
874

  
875
  uniq_joint_2 = tmp_joint[tmp_joint$index_naga %in% dup_naga_indexes,]
876

  
877
  bar = apply(t(dup_naga_indexes), 2, function(naga_nuc){
878
    i = which(naga_nuc == dup_naga_indexes)
879
    if (i %% 100 == 1) {print(paste(i, "/", length(dup_naga_indexes)))}    
880
    tmp_tmp_joint = uniq_joint_2[uniq_joint_2$index_naga == naga_nuc,]
881
    ret = tmp_tmp_joint[tmp_tmp_joint$diff == min(tmp_tmp_joint$diff),][1,]
882
    return(ret)
883
  })
884
  uniq_joint_2 = do.call(rbind, bar)
885
  uniq_joint_2 = data.frame(lapply(data.frame(uniq_joint_2, stringsAsFactors=FALSE), unlist), stringsAsFactors=FALSE)
886
  
887
  ff_naga_common_wp = rbind(uniq_joint_1, uniq_joint_2)
888
  ff_naga_common_wp = ff_naga_common_wp[order(ff_naga_common_wp$index_ff),]
889

  
890
  write.table(ff_naga_common_wp, ff_naga_common_wp_filename, sep = "\t",row.names = FALSE, quote=FALSE);
891
}
892

  
893
ff_naga_common_wp = get_content(ff_naga_common_wp_filename, "table", header=TRUE);
894

  
895
hist(ff_naga_common_wp$diff, nclass=1000,xlab = "distance (bp)", main = "ff naga commom wp distance")
896

  
897
@
898
\end{center}
899
\caption{...}
900
\end{figure}
901

  
902

  
903
\setkeys{Gin}{width=.99\linewidth}
904
\begin{figure}
905
\begin{center}
906

  
907
<<ff_vs_naga_consistency_thres, fig=TRUE, results=hide, echo=FALSE, eval=TRUE >>=
908
diad_diff_thres = 75
909
ff_naga_common_wp = ff_naga_common_wp[ff_naga_common_wp$diff <= diad_diff_thres,]
910
nb_ff_naga_common_wp = nrow(ff_naga_common_wp)
911
print (paste(nb_ff_naga_common_wp,"common wp between ff and naga with a threshold of", diad_diff_thres))
912

  
913
fdr = 0.0001
914

  
915
ff_naga_common_wp$naga_pval = naga_orig_snep[ff_naga_common_wp$index_naga,]$V15
916
ff_naga_common_wp$ff_pval = ff_wp_snep[ff_naga_common_wp$index_ff,]$pvalsGLM
917
ff_naga_common_wp$naga_seffect = naga_orig_snep[ff_naga_common_wp$index_naga,]$V14
918
ff_naga_common_wp$ff_seffect = ff_wp_snep[ff_naga_common_wp$index_ff,]$manipMnase_Seq.strainRM
919
naga_wp_snep_pval_thres = FDR(ff_naga_common_wp$naga_pval, fdr)
920
ff_wp_snep_pval_thres = FDR(ff_naga_common_wp$ff_pval, fdr)
921
ff_naga_common_wp$naga_snep = ff_naga_common_wp$naga_pval < naga_wp_snep_pval_thres
922
ff_naga_common_wp$ff_snep =  ff_naga_common_wp$ff_pval < ff_wp_snep_pval_thres
923

  
924
ff_naga_common_wp_snep = ff_naga_common_wp[ff_naga_common_wp$ff_snep & ff_naga_common_wp$naga_snep,]
925
nb_ff_naga_common_wp_snep = nrow(ff_naga_common_wp_snep)
926
naga_wp_snep = ff_naga_common_wp[ff_naga_common_wp$naga_snep, ]
927
ff_wp_snep = ff_naga_common_wp[ff_naga_common_wp$ff_snep,]
928
nb_naga_wp_snep = nrow(naga_wp_snep)
929
nb_ff_wp_snep = nrow(ff_wp_snep)
930

  
931
hist(ff_naga_common_wp$diff, nclass=70, xlab = "distance (bp)", main = "distance between ff naga common wp")
932
@
933
\end{center}
934
\caption{FF vs. Naga nucleosome positions}
935
\end{figure}
936

  
937

  
938

  
939

  
940

  
941

  
942

  
943

  
944

  
945
\setkeys{Gin}{width=.99\linewidth}
946
\begin{figure}
947
\begin{center}
948
<<ff_vs_naga_unr, fig=TRUE, results=hide, echo=FALSE, eval=TRUE >>=
949
print("Vs. Nagarajan for unr...")
950
ff_unr_snep = get_content(paste("results/full/BY_RM_H3K14ac_unr_snep.tab", sep = ""), "table", header=TRUE, stringsAsFactors=FALSE);
951
ff_unr_snep$index_ff=1:length(ff_unr_snep$chr_BY);
952
ff_naga_common_unr_filename = "cache/ff_naga_common_unr.tab"
953
if (!file.exists(ff_naga_common_unr_filename)) {
954
  results = apply(t(1:nrow(ff_unr_snep)), 2, function(i) {
955
    if (i %% 100 == 1) {print(paste(i, "/", nrow(ff_unr_snep)))}
956
    unr_ff = ff_unr_snep[i,]
957
    tmp_naga = naga_chr_BY[[paste("chr_BY", unr_ff$chr_BY, sep = "_")]]    
958
    tmp_naga = tmp_naga[(tmp_naga$V2 >= unr_ff$lower_bound_BY & tmp_naga$V2 <= unr_ff$upper_bound_BY) | 
959
                       (tmp_naga$V3 >= unr_ff$lower_bound_BY & tmp_naga$V3 <= unr_ff$upper_bound_BY) |
960
                       (tmp_naga$V2 <= unr_ff$lower_bound_BY & tmp_naga$V3 >= unr_ff$upper_bound_BY),]
961
    if (length(tmp_naga[,1]) > 0) {
962
      overlaps = apply(t(1:length(tmp_naga[,1])), 2, function(tmp_naga_idx) {
963
        tmp2_naga = tmp_naga[tmp_naga_idx,]
964
        overlap = (min(tmp2_naga$V3, unr_ff$upper_bound_BY) - max(tmp2_naga$V2, unr_ff$lower_bound_BY)) / (tmp2_naga$V3 - tmp2_naga$V2)
965
        return(signif(overlap,5))
966
      })
967
      overlaps = unlist(overlaps)
968
      tmp_naga$overlaps = overlaps
969
      res = list(index_naga=tmp_naga$index_naga, index_ff=rep(unr_ff$index_ff, length(tmp_naga$index_naga)), overlap=overlaps)
970
      return (t(do.call("rbind", res)))
971
    } else {
972
      return (NULL)
973
    }
974
  })
975
  results = do.call("rbind", results)
976
  write.table(results, ff_naga_common_unr_filename, row.names=FALSE, quote=FALSE)
977
}
978
ff_naga_common_unr = get_content(ff_naga_common_unr_filename, "table", head=TRUE);
979
ov = 0.70
980
ff_naga_common_unr = ff_naga_common_unr[ff_naga_common_unr$overlap > ov,]
981

  
982
fdr = 0.0001
983
ff_naga_common_unr$naga_pval = naga_orig_snep[ff_naga_common_unr$index_naga,]$V15
984
ff_naga_common_unr$ff_pval = ff_unr_snep[ff_naga_common_unr$index_ff,]$pvalsGLM
985
ff_naga_common_unr$naga_len = naga_orig_snep[ff_naga_common_unr$index_naga,]$V3 - naga_orig_snep[ff_naga_common_unr$index_naga,]$V2
986
ff_naga_common_unr$ff_len = ff_unr_snep[ff_naga_common_unr$index_ff,]$upper_bound_BY - ff_unr_snep[ff_naga_common_unr$index_ff,]$lower_bound_BY
987
ff_naga_common_unr$naga_seffect = naga_orig_snep[ff_naga_common_unr$index_naga,]$V14
988
ff_naga_common_unr$ff_seffect = ff_unr_snep[ff_naga_common_unr$index_ff,]$manipMnase_Seq.strainRM
989
naga_unr_snep_pval_thres = FDR(ff_naga_common_unr$naga_pval, fdr)
990
ff_unr_snep_pval_thres = FDR(ff_naga_common_unr$ff_pval, fdr)
991
ff_naga_common_unr$naga_snep = ff_naga_common_unr$naga_pval < naga_unr_snep_pval_thres
992
ff_naga_common_unr$ff_snep =  ff_naga_common_unr$ff_pval < ff_unr_snep_pval_thres
993

  
994
print("Removing Naga nuc that are associated with an ff wp...")
995
ff_naga_common_unr = ff_naga_common_unr[!(ff_naga_common_unr$index_naga %in%  ff_naga_common_wp$index_naga),]
996

  
997
dim (ff_naga_common_unr)
998

  
999
print("Dealing with duplicated ff index in UNRs...")
1000
all_ff_indexes = unique(ff_naga_common_unr$index_ff)
1001
duplicated_ff_indexes = unique(ff_naga_common_unr[duplicated(ff_naga_common_unr$index_ff),]$index_ff)
1002
unique_ff_indexes = all_ff_indexes[!(all_ff_indexes %in% duplicated_ff_indexes)]
1003
duplicated_ff_naga_common_unr_filename = "cache/duplicated_ff_naga_common_unr.tab"
1004
if (!file.exists(duplicated_ff_naga_common_unr_filename)) {
1005
  foo = apply(t(1:length(duplicated_ff_indexes)), 2, function(i){
1006
    if (i %% 100 == 1) {print(paste(i, "/", length(duplicated_ff_indexes)))}  
1007
    tmp_duplicated_ff_indexes = ff_naga_common_unr[ff_naga_common_unr$index_ff == duplicated_ff_indexes[i],]
1008
    if ( length(tmp_duplicated_ff_indexes[,1]) > 0 ) { 
1009
      the_dup = tmp_duplicated_ff_indexes[tmp_duplicated_ff_indexes$naga_pval == min(tmp_duplicated_ff_indexes$naga_pval),][1,]
1010
      return(the_dup)
1011
    } else {
1012
      return(NULL)
1013
    }
1014
  })
1015
  duplicated_ff_naga_common_unr = do.call(rbind, foo)
1016
  duplicated_ff_naga_common_unr = data.frame(lapply(data.frame(duplicated_ff_naga_common_unr, stringsAsFactors=FALSE), unlist), stringsAsFactors=FALSE)
1017
  write.table(duplicated_ff_naga_common_unr, file = duplicated_ff_naga_common_unr_filename, sep = "\t",row.names = FALSE, quote=FALSE);
1018
}
1019
duplicated_ff_naga_common_unr = read.table(duplicated_ff_naga_common_unr_filename, header=TRUE)
1020
unique_ff_naga_common_unr = ff_naga_common_unr[ff_naga_common_unr$index_ff %in% unique_ff_indexes, ]
1021
ff_naga_common_unr = rbind(unique_ff_naga_common_unr, duplicated_ff_naga_common_unr)
1022

  
1023
ff_naga_common_unr = ff_naga_common_unr[ff_naga_common_unr$ff_len < (6*150),]
1024

  
1025

  
1026
print("common_ff...")
1027
nb_ff_naga_common_unr = nrow(ff_naga_common_unr)
1028
ff_naga_common_unr_snep = ff_naga_common_unr[ff_naga_common_unr$ff_snep & ff_naga_common_unr$naga_snep,]
1029
nb_ff_naga_common_unr_snep = nrow(ff_naga_common_unr_snep)
1030
naga_unr_snep = ff_naga_common_unr[ff_naga_common_unr$naga_snep, ]
1031
nb_naga_unr_snep = nrow(naga_unr_snep)
1032
ff_unr_snep = ff_naga_common_unr[ff_naga_common_unr$ff_snep,]
1033
nb_ff_unr_snep = nrow(ff_unr_snep)
1034

  
1035
layout(matrix(1:2, nrow=1), respect=TRUE)
1036
# hist(ff_naga_common_unr$overlap, nclass=70, xlab = "overlap", main = "overlap between ff naga common unr")
1037
hist(ff_naga_common_unr_snep$ff_len, nclass=200)
1038
hist(ff_naga_common_unr_snep$naga_len)
1039
@
1040
\end{center}
1041
\caption{UNR positionning}
1042
\end{figure}
1043

  
1044

  
1045

  
1046

  
1047
Percentage of Naga SNEPs among all nucs:
1048
$$\frac{\Sexpr{nb_naga_wp_snep + nb_naga_unr_snep}}{\Sexpr{nrow(ff_naga_common_wp) + nrow(ff_naga_common_unr)}} = \Sexpr{signif((nb_naga_wp_snep + nb_naga_unr_snep)/(nrow(ff_naga_common_wp) + nrow(ff_naga_common_unr)) * 100, 3)}\%$$
1049

  
1050
Percentage of FF SNEPs among all nucs:
1051
$$\frac{\Sexpr{nb_ff_wp_snep + nb_ff_unr_snep}}{\Sexpr{nrow(ff_naga_common_wp) + nrow(ff_naga_common_unr)}} = \Sexpr{signif((nb_ff_wp_snep + nb_ff_unr_snep)/(nrow(ff_naga_common_wp) + nrow(ff_naga_common_unr)) * 100, 3)}\%$$
1052

  
1053
Percentage of wp FF SNEPs that were SNEP in Naga:
1054
$$\frac{\Sexpr{nb_ff_naga_common_wp_snep}}{\Sexpr{nb_ff_wp_snep}} = \Sexpr{signif(nb_ff_naga_common_wp_snep/nb_ff_wp_snep * 100, 3)}\%$$
1055

  
1056
Percentage of unr FF SNEPs that were SNEP in Naga:
1057
$$\frac{\Sexpr{nb_ff_naga_common_unr_snep}}{\Sexpr{nb_ff_unr_snep}} = \Sexpr{signif(nb_ff_naga_common_unr_snep/nb_ff_unr_snep * 100, 3)}\%$$
1058

  
1059
Percentage of FF SNEPs that were SNEP in Naga:
1060
$$\frac{\Sexpr{nb_ff_naga_common_wp_snep + nb_ff_naga_common_unr_snep}}{\Sexpr{nb_ff_wp_snep + nb_ff_unr_snep}} = \Sexpr{signif((nb_ff_naga_common_wp_snep + nb_ff_naga_common_unr_snep)/(nb_ff_wp_snep + nb_ff_unr_snep) * 100, 3)}\%$$
1061

  
1062
Percentage of Naga SNEPs that are either a wp or unr SNEP in FF:
1063
$$\frac{\Sexpr{nb_ff_naga_common_wp_snep + nb_ff_naga_common_unr_snep}}{\Sexpr{nb_naga_wp_snep + nb_naga_unr_snep}} = \Sexpr{signif((nb_ff_naga_common_wp_snep + nb_ff_naga_common_unr_snep)/(nb_naga_wp_snep + nb_naga_unr_snep) * 100, 3)}\%$$
1064

  
1065

  
1066
\subsection{SNEP effect correlation}
1067

  
1068

  
1069
\setkeys{Gin}{width=.99\linewidth}
1070
\begin{figure}
1071
\begin{center}
1072
\subfigure{
1073
<< ff_vs_naga_cov_1, results=hide, fig=TRUE, height=5, width=16, echo=FALSE, eval=TRUE >>= 
1074
cur_index = 2
1075
cur = as.list(curs[cur_index,])
1076
cur$begin = 168850
1077
cur$end =   170200
1078
foo = get_content("data/TF/sample_1_TF.txt", "table", header=TRUE)
1079
by_mnase_seq_cov = foo[foo$V1 == 1 & foo$V2 > cur$begin & foo$V2 < cur$end, ]
1080
f = by_mnase_seq_cov[by_mnase_seq_cov$V3 == "F",]
1081
f_exp = rep(0, cur$end - cur$begin + 1)
1082
f_exp[f$V2 - cur$begin + 1] = f$V4
1083
r = by_mnase_seq_cov[by_mnase_seq_cov$V3 == "R",]
1084
r_exp = rep(0, cur$end - cur$begin + 1)
1085
r_exp[r$V2 - cur$begin + 1] = r$V4
1086
plot(0,0, col=0, xlim=c(cur$begin, cur$end), ylim=c(-150,100), ylab="MNase-seq")
1087
# lines(cur$begin:cur$end, f_exp)
1088
# lines(cur$begin:cur$end, -r_exp)
1089
abline(h=0)
1090

  
1091

  
1092
by_mnase_seq_cov = foo[foo$V1 == 1 & foo$V2 > cur$begin - 50 & foo$V2 < cur$end + 50, ]
1093
f = by_mnase_seq_cov[by_mnase_seq_cov$V3 == "F",]
1094
f_exp = rep(0, cur$end - cur$begin + 1)
1095
for (i in 1:nrow(f)) {
1096
  l = f[i,]
1097
  if (l$V2 <= cur$end) {
1098
    b = min(cur$end-cur$begin+1,max(1,l$V2-cur$begin+1))
1099
    e = min(cur$end-cur$begin+1,l$V2-cur$begin+1+50)
1100
    # print(paste(l$V2 - cur$begin + 1, b,":", e))
1101
    f_exp[b:e] = f_exp[b:e] + l$V4
1102
  }
1103
}
1104
lines(cur$begin:cur$end, f_exp, lwd=3)
1105

  
1106
r = by_mnase_seq_cov[by_mnase_seq_cov$V3 == "R",]
1107
r_exp = rep(0, cur$end - cur$begin + 1)
1108
for (i in 1:nrow(r)) {
1109
  l = r[i,]
1110
  if (l$V2 <= cur$end + 50) {
1111
    b = min(cur$end-cur$begin+1,max(1,l$V2-cur$begin+1-50))
1112
    e = max(1,min(cur$end-cur$begin+1,l$V2-cur$begin+1))
1113
    # print(paste(l$V2 - cur$begin + 1, b,":", e))
1114
    r_exp[b:e] = r_exp[b:e] + l$V4
1115
  }
1116
}
1117
lines(cur$begin:cur$end, -r_exp, lwd=3)
1118

  
1119
@
1120
}
1121
\subfigure{
1122
<< ff_vs_naga_cov_2, results=hide, fig=TRUE, height=5, width=16, echo=FALSE, eval=TRUE >>= 
1123
by_arrays_normalized_cby01_filename = "data/by_arrays_normalized_cby01.tab"
1124
if (!file.exists(by_arrays_normalized_cby01_filename)) {
1125
  foo = get_content("data/BY_arrays_normalized.dat", "table", header=TRUE)
1126
  by_arrays_normalized_cby01 = foo[foo$chromosome == "chrI" & foo$position > cur$begin & foo$position < cur$end , c("chromosome", "position", "CBY01")]
1127
  write.table(by_arrays_normalized_cby01, by_arrays_normalized_cby01_filename, sep = "\t",row.names = FALSE, quote=FALSE);
1128
}
1129
by_arrays_normalized_cby01 = get_content(by_arrays_normalized_cby01_filename, "table", header=TRUE);
1130

  
1131
plot(by_arrays_normalized_cby01$position, by_arrays_normalized_cby01$CBY01, type="l", xlim=c(cur$begin, cur$end), lwd=3, xlab="chr I", ylab="MNase-CHIP") 
1132
@
1133
}
1134
\subfigure{
1135
<<SNEP_eff_ff2Naga, results=hide, fig=TRUE, echo=FALSE, eval=TRUE >>=
1136
X = c(-ff_naga_common_wp$naga_seffect, -ff_naga_common_unr$naga_seffect)
1137
Y = c(ff_naga_common_wp$ff_seffect, ff_naga_common_unr$ff_seffect)
1138

  
1139
plot(0,0,col=0, xlim=c(-1.5,1.5), ylim=c(-4,4), xlab = "SNEP effect Naga", ylab="SNEP effect FF")
1140
points(X,Y, col = adjustcolor("darkviolet", alpha.f = 0.03), pch=19)
1141

  
1142
abline( lm(Y ~ X), lty = 1, lwd = 2, col = "darkviolet" )
1143
legend("topleft",legend= sprintf("Spearman correlation: %.3f",cor(X,Y, method = "spearman")))
1144

  
1145
@
1146
}
1147
\end{center}
1148
\caption{FF vs Naga}
1149
\label{fig:inf}
1150
\end{figure}
1151

  
1152

  
1153
\end{document}
1154

  
1155

  
1156

  
b/doc/Chuffart_NM2_sweave/NOTE.txt
1
## Minimal sweave script and data archive Chuffart_NM2_sweave.tgz is obtained using the following commands: 
2

  
3
COPYFILE_DISABLE=1 tar -czvf Chuffart_NM2_sweave.tgz\
4
  Chuffart_NM2_sweave/Chuffart_NM2_sweave.Rnw\
5
  Chuffart_NM2_sweave/nucleo_miner_config.json\
6
  Chuffart_NM2_sweave/NOTE.txt\
7
  Chuffart_NM2_sweave/.Rhistory\
8
  Chuffart_NM2_sweave/data/samples.csv\
9
  Chuffart_NM2_sweave/data/BY_RM_gxcomp.c2c\
10
  Chuffart_NM2_sweave/data/by_arrays_normalized_cby01.tab\
11
  Chuffart_NM2_sweave/data/TF/sample_1_TF.txt\
12
  Chuffart_NM2_sweave/data/TF/sample_1_all_nucs.tab\
13
  Chuffart_NM2_sweave/data/TF/sample_2_TF.txt\
14
  Chuffart_NM2_sweave/data/TF/sample_2_all_nucs.tab\
15
  Chuffart_NM2_sweave/data/TF/sample_3_TF.txt\
16
  Chuffart_NM2_sweave/data/TF/sample_3_all_nucs.tab\
17
  Chuffart_NM2_sweave/data/TF/sample_4_TF.txt\
18
  Chuffart_NM2_sweave/data/TF/sample_4_all_nucs.tab\
19
  Chuffart_NM2_sweave/data/TF/sample_5_TF.txt\
20
  Chuffart_NM2_sweave/data/TF/sample_5_all_nucs.tab\
21
  Chuffart_NM2_sweave/data/TF/sample_6_TF.txt\
22
  Chuffart_NM2_sweave/data/TF/sample_6_all_nucs.tab\
23
  Chuffart_NM2_sweave/data/TF/sample_36_TF.txt\
24
  Chuffart_NM2_sweave/data/TF/sample_37_TF.txt\
25
  Chuffart_NM2_sweave/data/TF/sample_38_TF.txt\
26
  Chuffart_NM2_sweave/data/TF/sample_39_TF.txt\
27
  Chuffart_NM2_sweave/data/TF/sample_53_TF.txt\
28
  Chuffart_NM2_sweave/data/Templates_7.1.txt\
29
  Chuffart_NM2_sweave/cache/common_wp_with_dyad_shift.tab\
30
  Chuffart_NM2_sweave/cache/ff_naga_common_wp.tab\
31
  Chuffart_NM2_sweave/cache/ff_naga_common_unr.tab\
32
  Chuffart_NM2_sweave/cache/duplicated_ff_naga_common_unr.tab\
33
  Chuffart_NM2_sweave/results/all_curs.tab\
34
  Chuffart_NM2_sweave/results/full/BY_wp.tab\
35
  Chuffart_NM2_sweave/results/full/RM_wp.tab\
36
  Chuffart_NM2_sweave/results/full/BY_fuzzy.tab\
37
  Chuffart_NM2_sweave/results/full/RM_fuzzy.tab\
38
  Chuffart_NM2_sweave/results/full/BY_in_BY_RM_unr.tab\
39
  Chuffart_NM2_sweave/results/full/BY_RM_common_wp.tab\
40
  Chuffart_NM2_sweave/results/full/BY_llrs.tab\
41
  Chuffart_NM2_sweave/results/full/RM_llrs.tab\
42
  Chuffart_NM2_sweave/results/full/BY_RM_llrs.tab\
43
  Chuffart_NM2_sweave/results/full/RM_wp_tr_2_BY.tab\
44
  Chuffart_NM2_sweave/results/full/BY_RM_H3K14ac_wp_snep.tab\
45
  Chuffart_NM2_sweave/results/full/BY_RM_H3K14ac_unr_snep.tab\
46
  Chuffart_NM2_sweave/results/full/BY_RM_wp_mnase.tab\
47
  Chuffart_NM2_sweave/results/full/size_factors.tab\
48
  Chuffart_NM2_sweave/results/naga/Nagarajan_H3K14ac_BY_RM_NManova_nuc.txt
49

  
50
## To unarchive the archive:
51
# tar xvfz Chuffart_NM2_sweave.tgz 
52

  
53

  
54
## To clear cache use the following command line: 
55
# rm cache
56

  
57
## To rebuild Template filter outputs type the following command line:
58
# rm data/TF/sample_*_all_nucs.tab
59

  
60
## To build the pdf file from sweave type the following command line:
61
# cd Chuffart_NM2_sweave
62
# Sweave.sh -nc -ld Chuffart_NM2_sweave.Rnw 
b/doc/Chuffart_NM2_sweave/cache/duplicated_ff_naga_common_unr.tab
1
index_naga	index_ff	overlap	naga_pval	ff_pval	naga_len	ff_len	naga_seffect	ff_seffect	naga_snep	ff_snep
2
5417	7	1	1.728383e-11	3.3307e-16	138	975	0.398396	-0.74547	TRUE	TRUE
3
5432	8	1	0.3531307	0.010108	120	310	-0.0858912	-0.40117	FALSE	FALSE
4
5434	9	1	0.02058755	0.28345	124	357	-0.221966	0.14357	FALSE	FALSE
5
5451	13	1	0.197095	0.022642	132	456	0.124913	0.32086	FALSE	FALSE
6
5455	14	1	0.001287218	6.9675e-06	124	286	0.245222	-0.7435	FALSE	TRUE
7
5495	24	1	6.441099e-06	1.1727e-10	163	843	0.325358	-0.82771	TRUE	TRUE
8
5506	26	0.7766	0.001462621	0.90938	188	316	-0.216148	0.019575	FALSE	FALSE
9
5512	28	0.97561	0.0127633	0.58564	123	361	0.270317	0.16492	FALSE	FALSE
10
5515	29	1	2.081539e-06	4.5761e-07	67	406	0.485278	-0.78783	TRUE	TRUE
11
5526	33	1	3.973889e-16	6.3567e-09	121	717	0.563109	-0.6161	TRUE	TRUE
12
5532	34	1	0.001003382	0.030265	129	322	0.285685	-0.27103	FALSE	FALSE
13
5559	38	1	9.447861e-07	2.1677e-06	149	383	0.339124	-1.3982	TRUE	TRUE
14
5577	40	0.9619	1.207186e-07	8.0658e-13	105	276	0.448226	-1.4071	TRUE	TRUE
15
5586	43	1	0.007479997	0.054878	119	304	-0.227301	-0.29439	FALSE	FALSE
16
5590	44	1	0.05625848	0.02996	151	758	0.141737	-0.3606	FALSE	FALSE
17
5597	46	1	0.0795782	6.6849e-10	120	1204	0.122369	-0.63543	FALSE	TRUE
18
5605	48	0.84167	0.01072153	0.0048391	120	220	-0.203826	-0.50171	FALSE	FALSE
19
5617	53	0.83444	3.262148e-06	1.1897e-05	151	318	0.303634	-1.1313	TRUE	TRUE
20
5620	55	1	0.06624525	0.011919	118	392	0.168772	0.61524	FALSE	FALSE
21
5637	57	1	4.489032e-22	1.4793e-12	130	1089	0.66704	-1.4242	TRUE	TRUE
22
5649	60	1	0.001085014	0.012239	111	395	-0.491395	-0.36203	FALSE	FALSE
23
5665	64	1	0.3686377	4.3908e-10	120	350	0.0756826	-1.1857	FALSE	TRUE
24
5671	65	1	2.101641e-15	1.0614e-13	142	1095	0.472112	-0.79411	TRUE	TRUE
25
5683	66	1	3.628294e-05	0.0014038	146	370	0.281347	-0.45841	FALSE	FALSE
26
5684	67	1	5.005284e-18	1.2286e-11	170	1034	0.546967	-0.67755	TRUE	TRUE
27
5731	74	1	0.003417446	0.15068	75	582	0.41483	-0.2087	FALSE	FALSE
28
5737	76	1	0.3289787	0.057219	119	327	-0.0849075	-0.39718	FALSE	FALSE
29
5784	85	1	0.2361155	0.95612	118	1158	-0.0988478	-0.0060477	FALSE	FALSE
30
5794	88	1	0.3115251	0.11717	102	332	0.0939036	-0.2422	FALSE	FALSE
31
5817	92	1	0.1511713	0.50563	120	327	0.127696	-0.11345	FALSE	FALSE
32
5835	97	1	8.870688e-07	1.612e-13	136	1079	0.299555	-0.89552	TRUE	TRUE
33
5842	98	1	0.008417169	2.9847e-10	52	287	0.276457	-0.83948	FALSE	TRUE
34
5893	105	0.94167	4.354075e-05	2.3048e-08	120	640	0.300468	-0.82553	FALSE	TRUE
35
5897	106	1	0.01596452	0.27923	64	958	-0.440829	-0.14925	FALSE	FALSE
36
5908	110	1	0.1935594	0.00059238	152	360	-0.124955	0.63309	FALSE	FALSE
37
5921	113	1	0.2240976	0.057739	124	336	-0.086352	-0.38272	FALSE	FALSE
38
5925	114	1	0.001389898	0.035592	144	324	0.233255	-0.36623	FALSE	FALSE
39
5931	116	1	1.291088e-05	0.0011766	136	1087	0.310378	-0.3749	FALSE	FALSE
40
5938	117	1	0.2929466	0.60362	131	350	-0.121858	0.1113	FALSE	FALSE
41
5947	118	1	0.09994925	0.008969	167	599	-0.104201	-0.41256	FALSE	FALSE
42
5992	127	1	0.5197087	0.68262	124	630	0.0660483	0.054799	FALSE	FALSE
43
6009	128	0.80519	2.309517e-05	0.049879	77	639	-0.569386	0.22798	FALSE	FALSE
44
6020	131	1	0.01893957	0.28763	124	299	-0.193631	0.20865	FALSE	FALSE
45
6026	133	1	1.212857e-07	1.5248e-06	109	690	-0.5083	-0.56765	TRUE	TRUE
46
6034	136	1	0.6685141	0.16492	174	336	0.0243204	-0.1748	FALSE	FALSE
47
6042	137	1	0.08979627	0.44691	106	405	-0.164744	0.1154	FALSE	FALSE
48
6048	139	1	0.04761496	0.19609	106	823	0.200086	-0.15652	FALSE	FALSE
49
6053	140	1	0.2495427	0.26787	150	418	0.088776	-0.18403	FALSE	FALSE
50
6055	141	1	1.308685e-06	0.092037	106	397	0.442292	0.32412	TRUE	FALSE
51
6062	144	1	0.4048712	6.572e-07	120	761	0.0766115	-0.59448	FALSE	TRUE
52
6067	145	1	0.3495669	0.099658	138	623	0.0744762	-0.21146	FALSE	FALSE
53
6129	159	1	0.00377351	1.0424e-06	123	955	0.228136	-0.72854	FALSE	TRUE
54
6145	162	1	0.03113878	0.072717	97	450	0.169786	-0.22912	FALSE	FALSE
55
6159	166	1	0.0001385634	0.82591	149	745	0.286566	0.042254	FALSE	FALSE
56
6185	173	1	0.01226	0.072942	118	315	0.266807	-0.32366	FALSE	FALSE
57
6191	174	1	0.001820601	0.40044	122	951	0.22677	-0.094224	FALSE	FALSE
58
6237	178	1	7.370601e-08	0	135	387	0.395524	-1.3915	TRUE	TRUE
59
6262	185	0.77381	0.0004998094	1.0668e-09	168	924	0.23487	-0.70519	FALSE	TRUE
60
6267	187	1	0.5728356	0.00019091	136	598	-0.101416	-0.54341	FALSE	FALSE
61
1450	201	1	0.005436928	0.00039993	133	493	0.182207	-0.49351	FALSE	FALSE
62
1470	208	1	0.03693795	0.40418	141	595	-0.181532	0.11999	FALSE	FALSE
63
1484	212	0.91667	0.1473053	0.89409	132	319	0.0996868	-0.024129	FALSE	FALSE
64
1502	215	1	4.367055e-09	1.4072e-05	184	707	0.328626	-0.50818	TRUE	TRUE
65
1515	219	1	0.007227256	6.687e-09	141	774	0.156417	-0.58919	FALSE	TRUE
66
1557	233	1	0.0006922912	0.0067809	104	748	-0.365497	-0.3146	FALSE	FALSE
67
1578	237	0.7546	4.586364e-15	2.6879e-05	163	324	-0.578644	0.79131	TRUE	FALSE
68
1588	239	1	3.67913e-06	4.8254e-09	128	726	0.280195	-0.59455	TRUE	TRUE
69
1608	243	1	0.003170233	0.00021109	100	601	0.254839	-0.47526	FALSE	FALSE
70
1613	244	1	0.0003824085	0.54656	128	613	0.309294	-0.088882	FALSE	FALSE
71
1619	246	1	0.001922927	0.081601	152	741	0.272094	-0.44534	FALSE	FALSE
72
1629	248	1	0.007585209	0.19476	92	1080	0.255023	-0.2752	FALSE	FALSE
73
1634	249	1	1.028186e-05	0.0098703	132	417	0.344355	-0.41165	TRUE	FALSE
74
1639	250	1	0.01645364	0.0001089	108	354	0.243072	-0.77095	FALSE	FALSE
75
1643	251	0.71212	0.008062551	0.15845	132	325	-0.229853	-0.29728	FALSE	FALSE
76
1647	252	1	0.3213715	0.060811	168	733	-0.0705864	0.23066	FALSE	FALSE
77
1685	264	1	0.0009416019	5.695e-05	117	566	0.236964	-0.58452	FALSE	FALSE
78
1691	265	0.81197	5.785354e-09	6.6003e-13	117	302	0.416353	-1.2053	TRUE	TRUE
79
1701	266	1	1.094938e-06	0.00060476	63	785	0.495272	-0.54337	TRUE	FALSE
80
1728	271	1	0.00271115	0.00033211	152	313	0.217048	-0.59635	FALSE	FALSE
81
1757	275	1	0.001009375	0.0012202	143	732	0.228255	-0.59004	FALSE	FALSE
82
1761	276	1	0.1103847	0.6413	149	449	-0.138029	-0.081162	FALSE	FALSE
83
1764	277	1	0.04658873	0.068206	119	629	0.168352	-0.26177	FALSE	FALSE
84
1783	282	1	7.684392e-10	3.1844e-05	116	299	0.486626	-1.3006	TRUE	FALSE
85
1786	283	1	8.211537e-12	0.0010876	120	322	0.526139	-0.58468	TRUE	FALSE
86
1823	292	0.78906	0.0007060376	3.2707e-05	128	301	-0.370284	0.91338	FALSE	FALSE
87
1841	297	1	0.001013461	0.59931	112	1121	-0.222408	-0.054536	FALSE	FALSE
88
1862	309	1	0.02763645	0.40721	107	638	-0.245139	-0.11255	FALSE	FALSE
89
1869	312	0.82569	0.01309019	0.77901	109	321	0.260207	-0.086279	FALSE	FALSE
90
1876	315	1	0.005553935	2.1841e-06	111	361	-0.343141	-0.76574	FALSE	TRUE
91
1931	322	1	1.135022e-05	0.009687	120	488	-0.442503	-0.38499	FALSE	FALSE
92
1945	326	1	0.07659836	0.020694	72	349	0.162485	-0.39986	FALSE	FALSE
93
1964	331	1	0.0003766938	0.05365	131	797	-0.372446	0.23219	FALSE	FALSE
94
1975	334	1	0.1297587	8.6678e-06	76	429	0.138995	-0.87641	FALSE	TRUE
95
1978	335	1	0.1987051	0.028551	108	473	0.0994785	-0.33401	FALSE	FALSE
96
1989	341	1	7.288714e-08	3.0153e-05	113	500	0.406027	-0.70965	TRUE	FALSE
97
2002	344	1	0.03079656	2.2622e-08	152	1067	0.172548	-0.7888	FALSE	TRUE
98
2006	345	0.9646	0.376338	0.0095113	113	532	0.0723651	-0.53589	FALSE	FALSE
99
2026	350	1	1.3763e-05	2.2204e-15	94	790	0.348176	-0.95006	FALSE	TRUE
100
2069	380	1	0.1135037	0.021182	117	260	0.15461	-0.46671	FALSE	FALSE
101
2070	381	1	0.1315066	0.047196	119	360	-0.177405	0.82193	FALSE	FALSE
102
2073	382	0.93506	0.5248663	2.3662e-06	77	382	-0.0779146	-0.7838	FALSE	TRUE
103
2076	383	1	0.04030712	4.3303e-06	117	271	0.17691	-0.84581	FALSE	TRUE
104
2110	389	1	0.008886462	1.3858e-05	54	666	-0.442664	-0.4771	FALSE	TRUE
105
2128	396	1	0.0174405	0.029021	144	522	-0.248301	0.32345	FALSE	FALSE
106
2163	404	1	0.1050541	0.86244	117	280	-0.121858	-0.028001	FALSE	FALSE
107
2165	405	0.80451	0.02072467	0.00092148	133	976	-0.152011	-0.35118	FALSE	FALSE
108
2173	406	1	0.0007125601	0.00011681	120	415	0.302253	-0.5528	FALSE	FALSE
109
2176	407	0.81884	1.173297e-08	4.7346e-11	138	576	0.390999	-0.81419	TRUE	TRUE
110
2181	408	1	0.0005207124	0.00021122	118	338	0.270446	-0.58432	FALSE	FALSE
111
2197	411	1	5.667179e-11	0.0015711	114	376	0.458305	-0.66143	TRUE	FALSE
112
2200	412	1	0.1210016	0.11834	142	569	0.121607	-0.21895	FALSE	FALSE
113
2233	419	1	0.1644465	0.44992	118	360	-0.116083	0.10714	FALSE	FALSE
114
2259	427	1	0.1014116	0.036517	90	750	-0.191437	-0.23888	FALSE	FALSE
115
2269	431	0.82192	1.196259e-35	0	146	480	0.819747	-1.5341	TRUE	TRUE
116
2280	433	1	7.339495e-27	5.107e-15	86	462	0.799959	-1.7665	TRUE	TRUE
117
2286	435	0.9918	0.05587683	0.31621	122	248	-0.223803	0.26429	FALSE	FALSE
118
2299	445	1	5.455112e-07	1.3069e-08	124	724	0.472224	-0.79215	TRUE	TRUE
119
2312	447	1	0.03998099	0.48767	95	331	0.171352	-0.10187	FALSE	FALSE
120
2326	449	1	0.05065432	0.94388	82	822	0.209835	-0.0076866	FALSE	FALSE
121
2340	452	1	0.1057237	0.65753	120	494	-0.172615	-0.06264	FALSE	FALSE
122
2354	456	1	7.397197e-11	2.6717e-08	136	438	0.414111	-1.1398	TRUE	TRUE
123
2358	457	1	1.107187e-10	3.243e-05	144	448	0.401904	-0.7979	TRUE	FALSE
124
2392	465	1	6.538037e-07	4.1874e-07	80	418	-0.533585	0.80118	TRUE	TRUE
125
2396	466	1	6.496771e-17	4.297e-11	104	590	-0.728814	0.8544	TRUE	TRUE
126
2410	471	1	0.001259679	0.12358	144	910	0.26834	-0.1878	FALSE	FALSE
127
2414	472	1	0.06974412	0.053818	125	337	0.171474	-0.36124	FALSE	FALSE
128
2420	474	1	0.009699467	5.7545e-05	120	620	0.237267	-0.58595	FALSE	FALSE
129
2423	475	1	0.001162696	0.027957	116	416	0.343487	-0.37301	FALSE	FALSE
130
2429	476	1	3.124553e-05	0.038468	88	612	0.361142	-0.3032	FALSE	FALSE
131
2436	477	0.88158	0.0008138225	0.0043351	152	294	0.298291	-0.53582	FALSE	FALSE
132
2439	478	1	3.655997e-05	0.54989	124	672	0.381921	0.080365	FALSE	FALSE
133
2465	485	1	0.00842961	0.003551	141	578	0.197043	-0.39711	FALSE	FALSE
134
2472	488	1	0.5319148	0.50942	125	321	0.0611396	0.095886	FALSE	FALSE
135
2497	493	0.93939	0.004698302	0.59412	132	376	-0.277926	0.086308	FALSE	FALSE
136
2516	497	1	2.015516e-06	0.02073	130	2242	-0.386978	-0.18775	TRUE	FALSE
137
2538	502	1	0.04728853	8.2418e-06	118	856	-0.212784	0.56914	FALSE	TRUE
138
2546	503	0.73759	2.270472e-11	8.5487e-15	141	768	0.467192	-0.83951	TRUE	TRUE
139
2561	508	1	0.06073585	0.49596	120	351	-0.159152	0.097992	FALSE	FALSE
140
2589	515	1	2.49126e-12	1.0895e-08	155	437	0.365697	-0.76664	TRUE	TRUE
141
2607	520	1	2.973684e-05	0.0083472	119	545	0.283018	-0.374	FALSE	FALSE
142
2614	522	0.86667	0.7101744	0.30769	105	267	-0.0353774	-0.27287	FALSE	FALSE
143
2643	529	1	0.01126686	0.0099803	126	326	0.175093	-0.37762	FALSE	FALSE
144
2658	532	1	3.855191e-05	5.7926e-05	129	598	0.263815	-0.55488	FALSE	FALSE
145
2671	535	1	3.092683e-10	0.48355	94	308	-0.403633	0.11717	TRUE	FALSE
146
2682	537	0.79412	4.557318e-05	1.0009e-05	102	356	0.333838	0.65808	FALSE	TRUE
147
2686	538	1	0.006758562	0.010722	122	312	-0.253099	0.41173	FALSE	FALSE
148
2693	541	1	0.001131573	8.5379e-05	132	547	0.30429	-0.58092	FALSE	FALSE
149
2716	545	1	4.009105e-11	0.23208	124	366	-0.759131	-0.16991	TRUE	FALSE
150
2724	549	0.73387	0.005223838	0.32361	124	191	-0.362318	0.17711	FALSE	FALSE
151
2754	557	1	1.388985e-05	0.76704	111	489	-0.332976	-0.039069	FALSE	FALSE
152
2761	558	0.73171	0.003488335	0.019363	123	212	-0.264763	0.6527	FALSE	FALSE
153
2812	570	0.75168	0.001874081	0.20966	149	340	-0.27496	0.19437	FALSE	FALSE
154
2840	574	1	0.0723344	0.015485	210	716	-0.101366	-0.28195	FALSE	FALSE
155
2847	575	1	1.220117e-10	0.42097	130	556	0.385147	-0.11665	TRUE	FALSE
156
2860	577	1	1.17974e-05	0.11602	149	582	-0.381734	-0.18767	FALSE	FALSE
157
2872	578	0.78295	0.008208431	0.016889	129	333	-0.253231	0.33161	FALSE	FALSE
158
2881	581	1	0.007305894	0.50559	120	576	0.265196	0.10256	FALSE	FALSE
159
2909	588	1	0.04281768	0.73908	119	360	-0.210534	0.04516	FALSE	FALSE
160
2931	595	1	0.08280988	0.65746	120	274	-0.215946	-0.076187	FALSE	FALSE
161
2958	601	1	0.009674651	0.34685	120	304	0.200935	-0.15541	FALSE	FALSE
162
2961	602	1	1.149092e-07	1.9734e-07	120	1491	0.406568	-0.47456	TRUE	TRUE
163
3021	614	1	0.04213373	0.00012412	118	738	0.176712	-0.44795	FALSE	FALSE
164
3026	615	0.96512	0.3324894	0.67535	86	279	-0.105553	-0.067789	FALSE	FALSE
165
3044	617	0.95763	2.468992e-05	3.4974e-06	118	303	0.326029	-0.68216	FALSE	TRUE
166
3049	618	1	1.432677e-06	3.1586e-13	132	703	-0.38329	0.81111	TRUE	TRUE
167
3055	619	0.97163	0.0001396768	0.29237	141	338	-0.41033	0.16313	FALSE	FALSE
168
3058	620	1	0.03467227	0.0067665	113	308	-0.201923	0.44766	FALSE	FALSE
169
3091	629	0.71111	8.263622e-06	8.7987e-09	135	360	0.334726	-1.0666	TRUE	TRUE
170
3095	630	1	6.748616e-20	3.1373e-05	155	408	0.570392	-1.1071	TRUE	FALSE
171
3100	631	1	4.353329e-05	0.00050892	128	702	0.28206	-0.44841	FALSE	FALSE
172
3128	635	1	0.07174809	0.48675	72	449	0.145981	-0.095915	FALSE	FALSE
173
3131	636	0.70833	0.006486665	0.80718	120	420	0.19579	-0.036054	FALSE	FALSE
174
3156	646	1	0.004821985	7.5939e-07	89	443	0.204634	-0.8213	FALSE	TRUE
175
3165	649	0.80556	2.332823e-19	5.9376e-06	144	447	0.566247	-0.97188	TRUE	TRUE
176
3167	650	1	6.457706e-06	0.042085	128	418	0.317003	-0.29761	TRUE	FALSE
177
3172	651	1	8.827576e-06	0.058247	168	694	-0.430702	-0.23136	TRUE	FALSE
178
3186	655	1	0.003840398	0.026824	87	579	-0.280596	-0.24138	FALSE	FALSE
179
3197	658	1	0.005563903	0.2938	108	845	0.257013	0.11623	FALSE	FALSE
180
3219	662	1	0.007278787	0.71996	146	897	-0.20853	-0.040138	FALSE	FALSE
181
3240	666	1	0.005108187	0.66769	159	485	0.182236	-0.065409	FALSE	FALSE
182
3244	667	1	0.01295267	0.017794	139	925	0.191084	-0.28566	FALSE	FALSE
183
3250	669	1	0.3150166	0.00010011	151	304	-0.0883983	0.81133	FALSE	FALSE
184
3289	673	1	6.009777e-07	0.029186	117	450	0.356571	-0.31246	TRUE	FALSE
185
3299	675	1	0.01410224	0.00018293	119	885	0.180087	-0.41972	FALSE	FALSE
186
3316	680	1	6.546752e-05	1.7229e-05	155	1059	0.348028	-0.46405	FALSE	TRUE
187
3325	682	1	0.02237703	0.037223	105	821	0.252736	-0.26389	FALSE	FALSE
188
3358	692	1	0.05556546	1.5759e-06	123	478	0.160939	-0.70915	FALSE	TRUE
189
3361	693	1	0.005992634	2.6359e-08	139	445	0.161951	-0.73904	FALSE	TRUE
190
3369	694	1	0.001635201	0.98661	73	598	-0.227433	-0.001857	FALSE	FALSE
191
3373	695	1	2.718471e-07	2.3317e-05	145	612	0.326822	-0.70095	TRUE	TRUE
192
3378	696	1	5.733531e-09	7.0763e-10	143	349	0.496521	-0.95663	TRUE	TRUE
193
3390	708	1	2.175539e-06	4.0853e-08	152	706	0.340196	-0.75976	TRUE	TRUE
194
3445	722	1	1.228637e-12	1.7489e-10	131	409	0.392681	-1.0515	TRUE	TRUE
195
3452	751	1	0.01745145	1.5673e-12	152	1548	0.219949	-1.0212	FALSE	TRUE
196
3456	752	1	0.1020907	0.37617	88	330	-0.18902	0.13284	FALSE	FALSE
197
3485	759	1	0.002986327	9.119e-08	120	317	-0.377732	-0.79886	FALSE	TRUE
198
3517	770	1	0.4077137	0.084716	135	310	0.0615743	-0.30597	FALSE	FALSE
199
3523	771	1	4.813536e-05	0.77387	83	885	-0.408881	-0.034425	FALSE	FALSE
200
3527	775	1	5.103767e-16	0.7226	135	1027	-0.8341	0.51549	TRUE	FALSE
201
3532	777	1	3.387939e-09	0.0094698	117	914	-0.844194	2.5327	TRUE	FALSE
202
3538	781	1	0.01207484	0.26443	120	307	0.304913	1.5552	FALSE	FALSE
203
3547	787	1	0.008909491	0.0010683	102	452	0.300724	-0.3766	FALSE	FALSE
204
3553	788	0.7807	0.1749031	0.002103	114	487	-0.133416	-0.41587	FALSE	FALSE
205
3574	792	0.856	0.002916958	0.55911	125	768	-0.293622	0.059393	FALSE	FALSE
206
3592	797	0.80833	4.01594e-12	0.73738	120	232	-0.698132	0.048016	TRUE	FALSE
207
3621	805	1	0.01343625	6.0997e-06	156	377	0.153838	-0.94315	FALSE	TRUE
208
3624	806	1	0.08886065	1.08e-06	151	329	0.121437	-0.68233	FALSE	TRUE
209
3631	808	1	1.221748e-06	0.0014773	128	292	-0.47119	-0.47703	TRUE	FALSE
210
3632	809	1	0.007045039	7.6624e-12	120	313	-0.329345	-0.99038	FALSE	TRUE
211
3671	816	1	0.0004496255	0.024063	100	738	0.437708	-0.28726	FALSE	FALSE
212
3678	818	0.93277	0.009027182	0.010241	119	275	-0.261458	-0.48491	FALSE	FALSE
213
3719	828	1	0.0326477	0.10812	120	507	0.164314	-0.21657	FALSE	FALSE
214
3722	829	1	0.1914911	0.0049924	118	446	-0.194162	0.85347	FALSE	FALSE
215
3728	831	0.86885	0.7178374	0.58302	122	267	-0.0358643	-0.10615	FALSE	FALSE
216
3732	832	1	0.01449534	0.95266	130	952	0.211142	-0.008171	FALSE	FALSE
217
3748	835	1	0.05759924	0.064697	114	808	0.162065	-0.21552	FALSE	FALSE
218
3760	838	1	0.003009376	0.081029	58	743	-0.574786	0.2061	FALSE	FALSE
219
3783	842	1	2.039509e-05	2.7369e-07	81	1147	0.421503	-0.5719	FALSE	TRUE
220
3791	843	1	7.088512e-11	0.0030462	63	1271	0.612764	-0.41934	TRUE	FALSE
221
3801	845	0.82171	0.003359307	0.31515	129	678	0.281741	-0.17983	FALSE	FALSE
222
3812	848	1	0.2104186	0.46614	109	408	0.113711	-0.1315	FALSE	FALSE
223
3823	849	1	0.00199324	0.063693	129	1418	-0.292484	-0.20007	FALSE	FALSE
224
3826	850	1	0.0002453386	0.33381	113	649	-0.369397	-0.12618	FALSE	FALSE
225
3851	855	1	0.0001143568	4.4358e-07	121	820	0.362327	-0.57884	FALSE	TRUE
226
3856	856	1	0.001794558	0.27828	152	429	-0.346463	-0.17381	FALSE	FALSE
227
3859	858	1	0.3220366	0.019815	74	415	-0.100877	-0.32534	FALSE	FALSE
228
3902	862	1	8.879317e-07	0.19304	130	478	-0.675039	0.16781	TRUE	FALSE
229
3917	866	1	0.01883283	0.00049332	143	380	0.202992	-0.61203	FALSE	FALSE
230
3923	867	1	0.0004894124	0.00038904	124	446	0.315915	-0.54172	FALSE	FALSE
231
3953	871	1	0.01661217	0.69173	140	482	0.17574	0.053137	FALSE	FALSE
232
3992	878	1	3.902978e-06	0.0046599	126	592	-0.550619	-0.41799	TRUE	FALSE
233
3995	879	1	0.1414767	0.99176	138	401	-0.108402	-0.0018398	FALSE	FALSE
234
4002	881	1	0.001427557	0.00089995	125	777	-0.321067	-0.40119	FALSE	FALSE
235
4006	882	1	0.008993172	2.1097e-07	165	588	0.171412	-0.62848	FALSE	TRUE
236
4009	883	1	0.001771273	0.018193	69	275	0.322275	-0.66617	FALSE	FALSE
237
4019	885	1	0.01709036	0.8415	122	327	-0.40952	0.050445	FALSE	FALSE
238
4039	894	1	0.07314616	2.3742e-07	138	479	0.12109	-0.83854	FALSE	TRUE
239
4062	902	1	1.921713e-06	0.75817	94	519	-0.764928	0.042871	TRUE	FALSE
240
4098	909	1	0.05378303	0.13404	146	1220	0.216904	-0.15038	FALSE	FALSE
241
4119	913	0.96104	0.04185201	0.0032582	77	680	-0.195392	-0.33963	FALSE	FALSE
242
4133	915	1	0.1025472	2.6519e-06	160	484	0.126779	-0.61695	FALSE	TRUE
243
4157	920	1	0.02207097	0.27702	85	521	0.185326	0.1286	FALSE	FALSE
244
4161	922	1	0.003912038	0.072574	135	474	-0.342593	-0.23953	FALSE	FALSE
245
4197	930	0.91608	0.000402379	0.023795	143	322	-0.323039	0.3159	FALSE	FALSE
246
4219	934	0.71528	0.06002533	0.55928	144	225	0.139501	0.12074	FALSE	FALSE
247
4224	935	1	0.004498192	0.0001078	117	650	-0.212749	0.46577	FALSE	FALSE
248
4233	937	1	0.0006547855	0.96939	120	365	-0.327729	-0.005996	FALSE	FALSE
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff