Statistiques
| Branche: | Révision :

root / doc / sphinx_doc / build / text / ref.txt @ 7e2d37e1

Historique | Voir | Annoter | Télécharger (28,08 ko)

1

    
2
References
3
**********
4

    
5

    
6
Python Reference
7
================
8

    
9

    
10
R Reference
11
===========
12

    
13

    
14
Arabic to Roman pair list.
15
--------------------------
16

    
17

    
18
Description
19
~~~~~~~~~~~
20

    
21
Util to convert Arabicto Roman
22

    
23

    
24
Usage
25
~~~~~
26

    
27
   ARAB2ROM()
28

    
29

    
30
Author(s)
31
~~~~~~~~~
32

    
33
Florent Chuffart
34

    
35
R: False Discovery Rate
36

    
37

    
38
False Discovery Rate
39
--------------------
40

    
41

    
42
Description
43
~~~~~~~~~~~
44

    
45
From a vector x of independent p-values, extract the cutoff
46
corresponding to the specified FDR. See Benjamini & Hochberg 1995
47
paper
48

    
49

    
50
Usage
51
~~~~~
52

    
53
   FDR(x, FDR)
54

    
55

    
56
Arguments
57
~~~~~~~~~
58

    
59
"x"
60

    
61
A vector x of independent p-values.
62

    
63
"FDR"
64

    
65
The specified FDR.
66

    
67

    
68
Value
69
~~~~~
70

    
71
Return the the corresponding cutoff.
72

    
73

    
74
Author(s)
75
~~~~~~~~~
76

    
77
Gael Yvert, Florent Chuffart
78

    
79

    
80
Examples
81
~~~~~~~~
82

    
83
   print("example")
84

    
85
R: Roman to Arabic pair list.
86

    
87

    
88
Roman to Arabic pair list.
89
--------------------------
90

    
91

    
92
Description
93
~~~~~~~~~~~
94

    
95
Util to convert Roman to Arabic
96

    
97

    
98
Usage
99
~~~~~
100

    
101
   ROM2ARAB()
102

    
103

    
104
Author(s)
105
~~~~~~~~~
106

    
107
Florent Chuffart
108

    
109
R: Aggregate replicated sample's nucleosomes.
110

    
111

    
112
Aggregate replicated sample's nucleosomes.
113
------------------------------------------
114

    
115

    
116
Description
117
~~~~~~~~~~~
118

    
119
This function aggregates nucleosome for replicated samples. It uses
120
TemplateFilter ouput of each sample as replicate. Each sample owns a
121
set of nucleosomes computed using TemplateFilter and ordered by the
122
position of their center. Adajacent nucleosomes are compared two by
123
two. Comparison is based on a log likelihood ratio score. The issue of
124
comparison is adjacents nucleosomes merge or separation. Finally the
125
function returns a list of clusters and all computed *llr_scores*.
126
Each cluster ows an attribute *wp* for "well positionned". This
127
attribute is set as *TRUE* if the cluster is composed of exactly one
128
nucleosomes of each sample.
129

    
130

    
131
Usage
132
~~~~~
133

    
134
   aggregate_intra_strain_nucs(samples, llr_thres = 20, coord_max = 2e+07)
135

    
136

    
137
Arguments
138
~~~~~~~~~
139

    
140
"samples"
141

    
142
A list of samples. Each sample is a list like *sample = list(id=...,
143
marker=..., strain=..., roi=..., inputs=..., outputs=...)* with *roi =
144
list(name=..., begin=..., end=..., chr=..., genome=...)*.
145

    
146
"llr_thres"
147

    
148
Log likelihood ration threshold.
149

    
150
"coord_max"
151

    
152
A too big value to be a coord for a nucleosome lower bound.
153

    
154

    
155
Value
156
~~~~~
157

    
158
Returns a list of clusterized nucleosomes, and all computed llr
159
scores.
160

    
161

    
162
Author(s)
163
~~~~~~~~~
164

    
165
Florent Chuffart
166

    
167

    
168
Examples
169
~~~~~~~~
170

    
171
   # Dealing with a region of interest
172
   roi =list(name="example", begin=1000,  end=1300, chr="1", genome=rep("A",301))
173
   samples = list()
174
   for (i in 1:3) {
175
       # Create TF output
176
       tf_nuc = list("chr"=paste("chr", roi$chr, sep=""), "center"=(roi$end + roi$begin)/2, "width"= 150, "correlation.score"= 0.9)
177
       outputs = dfadd(NULL,tf_nuc)
178
       outputs = filter_tf_outputs(outputs, roi$chr, roi$begin, roi$end)
179
       # Generate corresponding reads
180
       nb_reads = round(runif(1,170,230))
181
       reads = round(rnorm(nb_reads, tf_nuc$center,20))
182
       u_reads = sort(unique(reads))
183
       strands = sample(c(rep("R",ceiling(length(u_reads)/2)),rep("F",floor(length(u_reads)/2))))
184
       counts = apply(t(u_reads), 2, function(r) { sum(reads == r)})
185
       shifts = apply(t(strands), 2, function(s) { if (s == "F") return(-tf_nuc$width/2) else return(tf_nuc$width/2)})
186
       u_reads = u_reads + shifts
187
       inputs = data.frame(list("V1" = rep(roi$chr, length(u_reads)),
188
                                "V2" = u_reads,
189
                                                        "V3" = strands,
190
                                                        "V4" = counts), stringsAsFactors=FALSE)
191
       samples[[length(samples) + 1]] = list(id=1, marker="Mnase_Seq", strain="strain_ex", total_reads = 10000000, roi=roi, inputs=inputs, outputs=outputs)
192
   }
193
   print(aggregate_intra_strain_nucs(samples))
194

    
195
R: Aligns nucleosomes between 2 strains.
196

    
197

    
198
Aligns nucleosomes between 2 strains.
199
-------------------------------------
200

    
201

    
202
Description
203
~~~~~~~~~~~
204

    
205
This function aligns nucs between two strains for a given genome
206
region.
207

    
208

    
209
Usage
210
~~~~~
211

    
212
   align_inter_strain_nucs(replicates, wp_nucs_strain_ref1 = NULL,
213
       wp_nucs_strain_ref2 = NULL, corr_thres = 0.5, llr_thres = 100,
214
       config = NULL, ...)
215

    
216

    
217
Arguments
218
~~~~~~~~~
219

    
220
"replicates"
221

    
222
Set of replicates, ideally 3 per strain.
223

    
224
"wp_nucs_strain_ref1"
225

    
226
List of aggregates nucleosome for strain 1. If it's null this list
227
will be computed.
228

    
229
"wp_nucs_strain_ref2"
230

    
231
List of aggregates nucleosome for strain 2. If it's null this list
232
will be computed.
233

    
234
"corr_thres"
235

    
236
Correlation threshold.
237

    
238
"llr_thres"
239

    
240
LOD cut off.
241

    
242
"config"
243

    
244
GLOBAL config variable
245

    
246
"..."
247

    
248
A list of parameters that will be passed to
249
*aggregate_intra_strain_nucs* if needed.
250

    
251

    
252
Value
253
~~~~~
254

    
255
Returns a list of clusterized nucleosomes, and all computed llr
256
scores.
257

    
258

    
259
Author(s)
260
~~~~~~~~~
261

    
262
Florent Chuffart
263

    
264

    
265
Examples
266
~~~~~~~~
267

    
268
       # Define new translate_cur function...
269
       translate_cur = function(roi, strain2, big_cur=NULL, config=NULL) {
270
         return(roi)
271
       }
272
       # Binding it by uncomment follwing lines.
273
       unlockBinding("translate_cur", as.environment("package:nucleominer"))
274
       unlockBinding("translate_cur", getNamespace("nucleominer"))
275
       assign("translate_cur", translate_cur, "package:nucleominer")
276
       assign("translate_cur", translate_cur, getNamespace("nucleominer"))
277
       lockBinding("translate_cur", getNamespace("nucleominer"))
278
       lockBinding("translate_cur", as.environment("package:nucleominer"))
279

    
280
   # Dealing with a region of interest
281
   roi =list(name="example", begin=1000,  end=1300, chr="1", genome=rep("A",301), strain_ref1 = "STRAINREF1")
282
   roi2 = translate_cur(roi, roi$strain_ref1)
283
   replicates = list()
284
   for (j in 1:2) {
285
       samples = list()
286
       for (i in 1:3) {
287
           # Create TF output
288
           tf_nuc = list("chr"=paste("chr", roi$chr, sep=""), "center"=(roi$end + roi$begin)/2, "width"= 150, "correlation.score"= 0.9)
289
           outputs = dfadd(NULL,tf_nuc)
290
           outputs = filter_tf_outputs(outputs, roi$chr, roi$begin, roi$end)
291
           # Generate corresponding reads
292
           nb_reads = round(runif(1,170,230))
293
           reads = round(rnorm(nb_reads, tf_nuc$center,20))
294
           u_reads = sort(unique(reads))
295
           strands = sample(c(rep("R",ceiling(length(u_reads)/2)),rep("F",floor(length(u_reads)/2))))
296
           counts = apply(t(u_reads), 2, function(r) { sum(reads == r)})
297
           shifts = apply(t(strands), 2, function(s) { if (s == "F") return(-tf_nuc$width/2) else return(tf_nuc$width/2)})
298
           u_reads = u_reads + shifts
299
           inputs = data.frame(list("V1" = rep(roi$chr, length(u_reads)),
300
                                    "V2" = u_reads,
301
                                                            "V3" = strands,
302
                                                            "V4" = counts), stringsAsFactors=FALSE)
303
           samples[[length(samples) + 1]] = list(id=1, marker="Mnase_Seq", strain=paste("strain_ex",j,sep=""), total_reads = 10000000, roi=roi, inputs=inputs, outputs=outputs)
304
       }
305
       replicates[[length(replicates) + 1]] = samples
306
   }
307
   print(align_inter_strain_nucs(replicates))
308

    
309
R: Launch deseq methods.
310

    
311

    
312
Launch deseq methods.
313
---------------------
314

    
315

    
316
Description
317
~~~~~~~~~~~
318

    
319
This function is based on deseq example. It mormalizes data, fit data
320
to GLM model with and without interaction term and compare the two
321
l;=models.
322

    
323

    
324
Usage
325
~~~~~
326

    
327
   analyse_design(snep_design, reads)
328

    
329

    
330
Arguments
331
~~~~~~~~~
332

    
333
"snep_design"
334

    
335
The design to considere.
336

    
337
"reads"
338

    
339
The data to considere.
340

    
341

    
342
Author(s)
343
~~~~~~~~~
344

    
345
Florent Chuffart
346

    
347
R: Stage replicates data
348

    
349

    
350
Stage replicates data
351
---------------------
352

    
353

    
354
Description
355
~~~~~~~~~~~
356

    
357
This function loads in memory data corresponding to the given
358
experiments.
359

    
360

    
361
Usage
362
~~~~~
363

    
364
   build_replicates(expe, roi, only_fetch = FALSE, get_genome = FALSE,
365
       all_samples, config = NULL)
366

    
367

    
368
Arguments
369
~~~~~~~~~
370

    
371
"expe"
372

    
373
a list of vector corresponding to vector of replicates.
374

    
375
"roi"
376

    
377
the region that we are interested in.
378

    
379
"only_fetch"
380

    
381
filter or not inputs.
382

    
383
"get_genome"
384

    
385
Load or not corresponding genome.
386

    
387
"all_samples"
388

    
389
Global list of samples.
390

    
391
"config"
392

    
393
GLOBAL config variable.
394

    
395

    
396
Author(s)
397
~~~~~~~~~
398

    
399
Florent Chuffart
400

    
401

    
402
Examples
403
~~~~~~~~
404

    
405
   # library(rjson)
406
   # library(nucleominer)
407
   #
408
   # # Read config file
409
   # json_conf_file = "nucleo_miner_config.json"
410
   # config = fromJSON(paste(readLines(json_conf_file), collapse=""))
411
   # # Read sample file
412
   # all_samples = get_content(config$CSV_SAMPLE_FILE, "cvs", sep=";", head=TRUE, stringsAsFactors=FALSE)
413
   # # here are the sample ids in a list
414
   # expes = list(c(1))
415
   # # here is the region that we wnt to see the coverage
416
   # cur = list(chr="8", begin=472000, end=474000, strain_ref="BY")
417
   # # it displays the corverage
418
   # replicates = build_replicates(expes, cur, all_samples=all_samples, config=config)
419
   # out = watch_samples(replicates, config$READ_LENGTH,
420
   #       plot_coverage = TRUE,
421
   #       plot_squared_reads = FALSE,
422
   #       plot_ref_genome = FALSE,
423
   #       plot_arrow_raw_reads = FALSE,
424
   #       plot_arrow_nuc_reads = FALSE,
425
   #       plot_gaussian_reads = FALSE,
426
   #       plot_gaussian_unified_reads = FALSE,
427
   #       plot_ellipse_nucs = FALSE,
428
   #       plot_wp_nucs = FALSE,
429
   #       plot_wp_nuc_model = FALSE,
430
   #       plot_common_nucs = FALSE,
431
   #       height = 50)
432

    
433
R: Extract a sub part of the corresponding c2c file
434

    
435

    
436
Extract a sub part of the corresponding c2c file
437
------------------------------------------------
438

    
439

    
440
Description
441
~~~~~~~~~~~
442

    
443
This fonction allow to acces to a specific part of the c2c file.
444

    
445

    
446
Usage
447
~~~~~
448

    
449
   c2c_extraction(strain1, strain2, chr = NULL, lower_bound = NULL,
450
       upper_bound = NULL, config = NULL)
451

    
452

    
453
Arguments
454
~~~~~~~~~
455

    
456
"strain1"
457

    
458
the key strain
459

    
460
"strain2"
461

    
462
the target strain
463

    
464
"chr"
465

    
466
if defined, the c2c will filtered according to the chromosome value
467

    
468
"lower_bound"
469

    
470
if defined, the c2c will filtered for part of the genome upper than
471
lower_bound
472

    
473
"upper_bound"
474

    
475
if defined, the c2c will filtered for part of the genome lower than
476
upper_bound
477

    
478
"config"
479

    
480
GLOBAL config variable
481

    
482

    
483
Author(s)
484
~~~~~~~~~
485

    
486
Florent Chuffart
487

    
488
R: reformat an "apply manipulated" list of regions
489

    
490

    
491
reformat an "apply manipulated" list of regions
492
-----------------------------------------------
493

    
494

    
495
Description
496
~~~~~~~~~~~
497

    
498
Utils to reformat an "apply manipulated" list of regions
499

    
500

    
501
Usage
502
~~~~~
503

    
504
   collapse_regions(regions)
505

    
506

    
507
Arguments
508
~~~~~~~~~
509

    
510
+-----------------+------+
511
+-----------------+------+
512

    
513

    
514
Author(s)
515
~~~~~~~~~
516

    
517
Florent Chuffart
518

    
519
R: Compute Common Uninterrupted Regions (CUR)
520

    
521

    
522
Compute Common Uninterrupted Regions (CUR)
523
------------------------------------------
524

    
525

    
526
Description
527
~~~~~~~~~~~
528

    
529
CURs are regions that can be aligned between the genomes
530

    
531

    
532
Usage
533
~~~~~
534

    
535
   compute_inter_all_strain_curs(diff_allowed = 30, min_cur_width = 4000,
536
       config = NULL)
537

    
538

    
539
Arguments
540
~~~~~~~~~
541

    
542
"diff_allowed"
543

    
544
the maximum indel width allowe din a CUR
545

    
546
"min_cur_width"
547

    
548
The minimum width of a CUR
549

    
550
"config"
551

    
552
GLOBAL config variable
553

    
554

    
555
Author(s)
556
~~~~~~~~~
557

    
558
Florent Chuffart
559

    
560
R: Crop bound of regions according to region of interest bound
561

    
562

    
563
Crop bound of regions according to region of interest bound
564
-----------------------------------------------------------
565

    
566

    
567
Description
568
~~~~~~~~~~~
569

    
570
The fucntion is no more necessary since we remove "big_cur" bug in
571
translate_cur function.
572

    
573

    
574
Usage
575
~~~~~
576

    
577
   crop_fuzzy(tmp_fuzzy_nucs, roi, strain, config = NULL)
578

    
579

    
580
Arguments
581
~~~~~~~~~
582

    
583
"tmp_fuzzy_nucs"
584

    
585
the regiuons to be croped.
586

    
587
"roi"
588

    
589
The region of interest.
590

    
591
"strain"
592

    
593
The strain to consider.
594

    
595
"config"
596

    
597
GLOBAL config variable
598

    
599

    
600
Author(s)
601
~~~~~~~~~
602

    
603
Florent Chuffart
604

    
605
R: Adding list to a dataframe.
606

    
607

    
608
Adding list to a dataframe.
609
---------------------------
610

    
611

    
612
Description
613
~~~~~~~~~~~
614

    
615
Add a list *l* to a dataframe *df*. Create it if *df* is *NULL*.
616
Return the dataframe *df*.
617

    
618

    
619
Usage
620
~~~~~
621

    
622
   dfadd(df, l)
623

    
624

    
625
Arguments
626
~~~~~~~~~
627

    
628
"df"
629

    
630
A dataframe
631

    
632
"l"
633

    
634
A list
635

    
636

    
637
Value
638
~~~~~
639

    
640
Return the dataframe *df*.
641

    
642

    
643
Author(s)
644
~~~~~~~~~
645

    
646
Florent Chuffart
647

    
648

    
649
Examples
650
~~~~~~~~
651

    
652
   ## Here dataframe is NULL
653
   print(df)
654
   df = NULL
655

    
656
   # Initialize df
657
   df = dfadd(df, list(key1 = "value1", key2 = "value2"))
658
   print(df)
659

    
660
   # Adding elements to df
661
   df = dfadd(df, list(key1 = "value1'", key2 = "value2'"))
662
   print(df)
663

    
664
R: Prefetch data
665

    
666

    
667
Prefetch data
668
-------------
669

    
670

    
671
Description
672
~~~~~~~~~~~
673

    
674
Fetch and filter inputs and outpouts per region of interest. Organize
675
it per replicates.
676

    
677

    
678
Usage
679
~~~~~
680

    
681
   fetch_mnase_replicates(strain, roi, all_samples, config = NULL,
682
       only_fetch = FALSE, get_genome = FALSE, get_ouputs = TRUE)
683

    
684

    
685
Arguments
686
~~~~~~~~~
687

    
688
"strain"
689

    
690
The strain we want mnase replicatesList of replicates. Each replicates
691
is a vector of sample ids.
692

    
693
"roi"
694

    
695
Region of interest.
696

    
697
"all_samples"
698

    
699
Global list of samples.
700

    
701
"config"
702

    
703
GLOBAL config variable
704

    
705
"only_fetch"
706

    
707
If TRUE, only fetch and not filtering. It is used tio load sample
708
files into memory before forking.
709

    
710
"get_genome"
711

    
712
If TRUE, load corresponding genome sequence.
713

    
714
"get_ouputs"
715

    
716
If TRUE, get also ouput corresponding TF output files.
717

    
718

    
719
Author(s)
720
~~~~~~~~~
721

    
722
Florent Chuffart
723

    
724
R: Filter TemplateFilter inputs
725

    
726

    
727
Filter TemplateFilter inputs
728
----------------------------
729

    
730

    
731
Description
732
~~~~~~~~~~~
733

    
734
This function filters TemplateFilter inputs according genome area
735
observed properties. It takes into account reads that are at the
736
frontier of this area and the strand of these reads.
737

    
738

    
739
Usage
740
~~~~~
741

    
742
   filter_tf_inputs(inputs, chr, x_min, x_max, nuc_width = 160,
743
       only_f = FALSE, only_r = FALSE, filter_for_coverage = FALSE)
744

    
745

    
746
Arguments
747
~~~~~~~~~
748

    
749
"inputs"
750

    
751
TF inputs to be filtered.
752

    
753
"chr"
754

    
755
Chromosome observed, here chr is an integer.
756

    
757
"x_min"
758

    
759
Coordinate of the first bp observed.
760

    
761
"x_max"
762

    
763
Coordinate of the last bp observed.
764

    
765
"nuc_width"
766

    
767
Nucleosome width.
768

    
769
"only_f"
770

    
771
Filter only F reads.
772

    
773
"only_r"
774

    
775
Filter only R reads.
776

    
777
"filter_for_coverage"
778

    
779
Does it filter for plot coverage?
780

    
781

    
782
Value
783
~~~~~
784

    
785
Returns filtred inputs.
786

    
787

    
788
Author(s)
789
~~~~~~~~~
790

    
791
Florent Chuffart
792

    
793
R: Filter TemplateFilter outputs
794

    
795

    
796
Filter TemplateFilter outputs
797
-----------------------------
798

    
799

    
800
Description
801
~~~~~~~~~~~
802

    
803
This function filters TemplateFilter outputs according, not only
804
genome area observerved properties, but also correlation and overlap
805
threshold.
806

    
807

    
808
Usage
809
~~~~~
810

    
811
   filter_tf_outputs(tf_outputs, chr, x_min, x_max, nuc_width = 160,
812
       ol_bp = 59, corr_thres = 0.5)
813

    
814

    
815
Arguments
816
~~~~~~~~~
817

    
818
"tf_outputs"
819

    
820
TemplateFilter outputs.
821

    
822
"chr"
823

    
824
Chromosome observed, here chr is an integer.
825

    
826
"x_min"
827

    
828
Coordinate of the first bp observed.
829

    
830
"x_max"
831

    
832
Coordinate of the last bp observed.
833

    
834
"nuc_width"
835

    
836
Nucleosome width.
837

    
838
"ol_bp"
839

    
840
Overlap Threshold.
841

    
842
"corr_thres"
843

    
844
Correlation threshold.
845

    
846

    
847
Value
848
~~~~~
849

    
850
Returns filtered TemplateFilter Outputs
851

    
852

    
853
Author(s)
854
~~~~~~~~~
855

    
856
Florent Chuffart
857

    
858
R: to flat aggregate_intra_strain_nucs function output
859

    
860

    
861
to flat aggregate_intra_strain_nucs function output
862
---------------------------------------------------
863

    
864

    
865
Description
866
~~~~~~~~~~~
867

    
868
This function builds a dataframe of all clusters obtain from
869
aggregate_intra_strain_nucs function.
870

    
871

    
872
Usage
873
~~~~~
874

    
875
   flat_aggregated_intra_strain_nucs(partial_strain_maps, cur_index)
876

    
877

    
878
Arguments
879
~~~~~~~~~
880

    
881
"partial_strain_maps"
882

    
883
the output of aggregate_intra_strain_nucs function
884

    
885
"cur_index"
886

    
887
the index of the roi involved
888

    
889

    
890
Value
891
~~~~~
892

    
893
Returns a dataframe of all clusters obtain from
894
aggregate_intra_strain_nucs function.
895

    
896

    
897
Author(s)
898
~~~~~~~~~
899

    
900
Florent Chuffart
901

    
902
R: flat reads
903

    
904

    
905
flat reads
906
----------
907

    
908

    
909
Description
910
~~~~~~~~~~~
911

    
912
Extract reads coordinates from TempleteFilter input sequence
913

    
914

    
915
Usage
916
~~~~~
917

    
918
   flat_reads(reads, nuc_width)
919

    
920

    
921
Arguments
922
~~~~~~~~~
923

    
924
"reads"
925

    
926
TemplateFilter input reads
927

    
928
"nuc_width"
929

    
930
Width used to shift F and R reads.
931

    
932

    
933
Value
934
~~~~~
935

    
936
Returns a list of F reads, R reads and joint/shifted F and R reads.
937

    
938

    
939
Author(s)
940
~~~~~~~~~
941

    
942
Florent Chuffart
943

    
944
R: Retrieve Reads
945

    
946

    
947
Retrieve Reads
948
--------------
949

    
950

    
951
Description
952
~~~~~~~~~~~
953

    
954
Retrieve reads for a given marker, combi, form.
955

    
956

    
957
Usage
958
~~~~~
959

    
960
   get_all_reads(marker, combi, form = "wp", config = NULL)
961

    
962

    
963
Arguments
964
~~~~~~~~~
965

    
966
"marker"
967

    
968
The marker to considere.
969

    
970
"combi"
971

    
972
The starin combination to considere.
973

    
974
"form"
975

    
976
The nuc form to considere.
977

    
978
"config"
979

    
980
GLOBAL config variable
981

    
982

    
983
Author(s)
984
~~~~~~~~~
985

    
986
Florent Chuffart
987

    
988
R: get comp strand
989

    
990

    
991
get comp strand
992
---------------
993

    
994

    
995
Description
996
~~~~~~~~~~~
997

    
998
Compute the complementatry strand.
999

    
1000

    
1001
Usage
1002
~~~~~
1003

    
1004
   get_comp_strand(strand)
1005

    
1006

    
1007
Arguments
1008
~~~~~~~~~
1009

    
1010
"strand"
1011

    
1012
The original strand.
1013

    
1014

    
1015
Value
1016
~~~~~
1017

    
1018
Returns the complementatry strand.
1019

    
1020

    
1021
Author(s)
1022
~~~~~~~~~
1023

    
1024
Florent Chuffart
1025

    
1026
R: Build the design for deseq
1027

    
1028

    
1029
Build the design for deseq
1030
--------------------------
1031

    
1032

    
1033
Description
1034
~~~~~~~~~~~
1035

    
1036
This function build the design according sample properties.
1037

    
1038

    
1039
Usage
1040
~~~~~
1041

    
1042
   get_design(marker, combi, all_samples)
1043

    
1044

    
1045
Arguments
1046
~~~~~~~~~
1047

    
1048
"marker"
1049

    
1050
The marker to considere.
1051

    
1052
"combi"
1053

    
1054
The starin combination to considere.
1055

    
1056
"all_samples"
1057

    
1058
Global list of samples.
1059

    
1060

    
1061
Author(s)
1062
~~~~~~~~~
1063

    
1064
Florent Chuffart
1065

    
1066
R: Compute the fuzzy list for a given strain.
1067

    
1068

    
1069
Compute the fuzzy list for a given strain.
1070
------------------------------------------
1071

    
1072

    
1073
Description
1074
~~~~~~~~~~~
1075

    
1076
This function grabs the nucleosomes detxted by template_filter that
1077
have been rejected bt aggregate_intra_strain_nucs as well positions.
1078

    
1079

    
1080
Usage
1081
~~~~~
1082

    
1083
   get_intra_strain_fuzzy(wp_map, roi, strain, config = NULL)
1084

    
1085

    
1086
Arguments
1087
~~~~~~~~~
1088

    
1089
"wp_map"
1090

    
1091
Well positionned nucleosomes map.
1092

    
1093
"roi"
1094

    
1095
The region of interest.
1096

    
1097
"strain"
1098

    
1099
The strain we want to extracvt the fuzzy map.
1100

    
1101
"config"
1102

    
1103
GLOBAL config variable.
1104

    
1105

    
1106
Author(s)
1107
~~~~~~~~~
1108

    
1109
Florent Chuffart
1110

    
1111
R: Compute the list of SNEPs for a given set of marker, strain...
1112

    
1113

    
1114
Compute the list of SNEPs for a given set of marker, strain combination and nuc form.
1115
-------------------------------------------------------------------------------------
1116

    
1117

    
1118
Description
1119
~~~~~~~~~~~
1120

    
1121
This function uses
1122

    
1123

    
1124
Usage
1125
~~~~~
1126

    
1127
   get_sneps(marker, combi, form, all_samples, config = NULL)
1128

    
1129

    
1130
Arguments
1131
~~~~~~~~~
1132

    
1133
"marker"
1134

    
1135
The marker involved.
1136

    
1137
"combi"
1138

    
1139
The strain combination involved.
1140

    
1141
"form"
1142

    
1143
the nuc form involved.
1144

    
1145
"all_samples"
1146

    
1147
Global list of samples.
1148

    
1149
"config"
1150

    
1151
GLOBAL config variable
1152

    
1153

    
1154
Author(s)
1155
~~~~~~~~~
1156

    
1157
Florent Chuffart
1158

    
1159

    
1160
Examples
1161
~~~~~~~~
1162

    
1163
   marker = "H3K4me1"
1164
   combi = c("BY", "YJM")
1165
   form = "wpunr" # "wp" | "unr" | "wpunr"
1166
   # foo = get_sneps(marker, combi, form)
1167
   # foo = get_sneps("H4K12ac", c("BY", "RM"), "wp")
1168

    
1169
R: Compute the unaligned nucleosomal regions (UNRs).
1170

    
1171

    
1172
Compute the unaligned nucleosomal regions (UNRs).
1173
-------------------------------------------------
1174

    
1175

    
1176
Description
1177
~~~~~~~~~~~
1178

    
1179
This function aggregate non common wp nucs for each strain and
1180
substract common wp nucs. It does not take care about the size of the
1181
resulting UNR. It will be take into account in the count read part og
1182
the pipeline.
1183

    
1184

    
1185
Usage
1186
~~~~~
1187

    
1188
   get_unrs(combi, roi, cur_index, wp_maps, fuzzy_maps, common_nuc_results,
1189
       config = NULL)
1190

    
1191

    
1192
Arguments
1193
~~~~~~~~~
1194

    
1195
"combi"
1196

    
1197
The strain combination to consider.
1198

    
1199
"roi"
1200

    
1201
The region of interest.
1202

    
1203
"cur_index"
1204

    
1205
The region of interest index.
1206

    
1207
"wp_maps"
1208

    
1209
Well positionned nucleosomes maps.
1210

    
1211
"fuzzy_maps"
1212

    
1213
Fuzzy nucleosomes maps.
1214

    
1215
"common_nuc_results"
1216

    
1217
Common wp nuc maps
1218

    
1219
"config"
1220

    
1221
GLOBAL config variable
1222

    
1223

    
1224
Author(s)
1225
~~~~~~~~~
1226

    
1227
Florent Chuffart
1228

    
1229
R: Returns the intersection of 2 list on regions.
1230

    
1231

    
1232
Returns the intersection of 2 list on regions.
1233
----------------------------------------------
1234

    
1235

    
1236
Description
1237
~~~~~~~~~~~
1238

    
1239
This function...
1240

    
1241

    
1242
Usage
1243
~~~~~
1244

    
1245
   intersect_region(region1, region2)
1246

    
1247

    
1248
Arguments
1249
~~~~~~~~~
1250

    
1251
"region1"
1252

    
1253
Original regions.
1254

    
1255
"region2"
1256

    
1257
Regions to intersect.
1258

    
1259

    
1260
Author(s)
1261
~~~~~~~~~
1262

    
1263
Florent Chuffart
1264

    
1265
R: Likelihood ratio
1266

    
1267

    
1268
Likelihood ratio
1269
----------------
1270

    
1271

    
1272
Description
1273
~~~~~~~~~~~
1274

    
1275
Compute the log likelihood ratio of two or more set of value.
1276

    
1277

    
1278
Usage
1279
~~~~~
1280

    
1281
   llr_score_nvecs(xs)
1282

    
1283

    
1284
Arguments
1285
~~~~~~~~~
1286

    
1287
"xs"
1288

    
1289
list of vectors.
1290

    
1291

    
1292
Value
1293
~~~~~
1294

    
1295
Returns the log likelihood ratio.
1296

    
1297

    
1298
Author(s)
1299
~~~~~~~~~
1300

    
1301
Florent Chuffart
1302

    
1303

    
1304
Examples
1305
~~~~~~~~
1306

    
1307
   # LOD score for 2 set of values
1308
   mean1=5; sd1=2; card2 = 250
1309
   mean2=6; sd2=3; card1 = 200
1310
   x1 = rnorm(card1, mean1, sd1)
1311
   x2 = rnorm(card2, mean2, sd2)
1312
   min = floor(min(c(x1,x2)))
1313
   max = ceiling(max(c(x1,x2)))
1314
   hist(c(x1,x2), xlim=c(min, max), breaks=min:max)
1315
   lines(min:max,dnorm(min:max,mean1,sd1)*card1,col=2)
1316
   lines(min:max,dnorm(min:max,mean2,sd2)*card2,col=3)
1317
   lines(min:max,dnorm(min:max,mean(c(x1,x2)),sd(c(x1,x2)))*card2,col=4)
1318
   llr_score_nvecs(list(x1,x2))
1319

    
1320
R: nm
1321

    
1322

    
1323
nm
1324
--
1325

    
1326

    
1327
Description
1328
~~~~~~~~~~~
1329

    
1330
It provides a set of useful functions allowing to perform quantitative
1331
analysis of nucleosomal epigenome.
1332

    
1333

    
1334
Details
1335
~~~~~~~
1336

    
1337
+-----------------+-----------------------------------------------------+
1338
| Package:        | nucleominer                                         |
1339
+-----------------+-----------------------------------------------------+
1340
| Maintainer:     | Florent Chuffart <florent.chuffart@ens-lyon.fr>     |
1341
+-----------------+-----------------------------------------------------+
1342
| Author:         | Florent Chuffart                                    |
1343
+-----------------+-----------------------------------------------------+
1344
| Version:        | 2.3.42                                              |
1345
+-----------------+-----------------------------------------------------+
1346
| License:        | CeCILL                                              |
1347
+-----------------+-----------------------------------------------------+
1348
| Title:          | nm                                                  |
1349
+-----------------+-----------------------------------------------------+
1350
| Depends:        | seqinr, plotrix, DESeq, cachecache                  |
1351
+-----------------+-----------------------------------------------------+
1352

    
1353

    
1354
Author(s)
1355
~~~~~~~~~
1356

    
1357
Florent Chuffart
1358

    
1359
R: Plot the distribution of reads.
1360

    
1361

    
1362
Plot the distribution of reads.
1363
-------------------------------
1364

    
1365

    
1366
Description
1367
~~~~~~~~~~~
1368

    
1369
This fuxntion use the deseq nomalization feature to compare
1370
qualitatively the distribution.
1371

    
1372

    
1373
Usage
1374
~~~~~
1375

    
1376
   plot_dist_samples(strain, marker, res, all_samples, NEWPLOT = TRUE)
1377

    
1378

    
1379
Arguments
1380
~~~~~~~~~
1381

    
1382
"strain"
1383

    
1384
The strain to considere.
1385

    
1386
"marker"
1387

    
1388
The marker to considere.
1389

    
1390
"res"
1391

    
1392
Data
1393

    
1394
"all_samples"
1395

    
1396
Global list of samples.
1397

    
1398
"NEWPLOT"
1399

    
1400
If FALSE the curve will be add to the current plot.
1401

    
1402

    
1403
Author(s)
1404
~~~~~~~~~
1405

    
1406
Florent Chuffart
1407

    
1408
R: sign from strand
1409

    
1410

    
1411
sign from strand
1412
----------------
1413

    
1414

    
1415
Description
1416
~~~~~~~~~~~
1417

    
1418
Get the sign of strand
1419

    
1420

    
1421
Usage
1422
~~~~~
1423

    
1424
   sign_from_strand(strands)
1425

    
1426

    
1427
Arguments
1428
~~~~~~~~~
1429

    
1430
+-----------------+------+
1431
+-----------------+------+
1432

    
1433

    
1434
Value
1435
~~~~~
1436

    
1437
If strand in forward then returns 1 else returns -1
1438

    
1439

    
1440
Author(s)
1441
~~~~~~~~~
1442

    
1443
Florent Chuffart
1444

    
1445
R: Substract to a list of regions an other list of regions that...
1446

    
1447

    
1448
Substract to a list of regions an other list of regions that intersect it.
1449
--------------------------------------------------------------------------
1450

    
1451

    
1452
Description
1453
~~~~~~~~~~~
1454

    
1455
This fucntion embed a recursive part. It occurs when a substracted
1456
region split an original region on two.
1457

    
1458

    
1459
Usage
1460
~~~~~
1461

    
1462
   substract_region(region1, region2)
1463

    
1464

    
1465
Arguments
1466
~~~~~~~~~
1467

    
1468
"region1"
1469

    
1470
Original regions.
1471

    
1472
"region2"
1473

    
1474
Regions to substract.
1475

    
1476

    
1477
Author(s)
1478
~~~~~~~~~
1479

    
1480
Florent Chuffart
1481

    
1482
R: Switch a pairlist
1483

    
1484

    
1485
Switch a pairlist
1486
-----------------
1487

    
1488

    
1489
Description
1490
~~~~~~~~~~~
1491

    
1492
Take a pairlist key:value and return the switched pairlist value:key.
1493

    
1494

    
1495
Usage
1496
~~~~~
1497

    
1498
   switch_pairlist(l)
1499

    
1500

    
1501
Arguments
1502
~~~~~~~~~
1503

    
1504
"l"
1505

    
1506
The pairlist to switch.
1507

    
1508

    
1509
Value
1510
~~~~~
1511

    
1512
The switched pairlist.
1513

    
1514

    
1515
Author(s)
1516
~~~~~~~~~
1517

    
1518
Florent Chuffart
1519

    
1520

    
1521
Examples
1522
~~~~~~~~
1523

    
1524
   l = list(key1 = "value1", key2 = "value2")
1525
   print(switch_pairlist(l))
1526

    
1527
R: Translate coords of a genome region.
1528

    
1529

    
1530
Translate coords of a genome region.
1531
------------------------------------
1532

    
1533

    
1534
Description
1535
~~~~~~~~~~~
1536

    
1537
This function is used in the examples, usualy you have to define your
1538
own translation function and overwrite this one using *unlockBinding*
1539
features. Please, refer to the example.
1540

    
1541

    
1542
Usage
1543
~~~~~
1544

    
1545
   translate_cur(roi, strain2, config = NULL, big_cur = NULL)
1546

    
1547

    
1548
Arguments
1549
~~~~~~~~~
1550

    
1551
"roi"
1552

    
1553
Original genome region of interest.
1554

    
1555
"strain2"
1556

    
1557
The strain in wich you want the genome region of interest.
1558

    
1559
"config"
1560

    
1561
GLOBAL config variable
1562

    
1563
"big_cur"
1564

    
1565
A largest region than roi use to filter c2c if it is needed.
1566

    
1567

    
1568
Author(s)
1569
~~~~~~~~~
1570

    
1571
Florent Chuffart
1572

    
1573

    
1574
Examples
1575
~~~~~~~~
1576

    
1577
   # Define new translate_cur function...
1578
   translate_cur = function(roi, strain2, config) {
1579
       strain1 = roi$strain_ref
1580
       if (strain1 == strain2) {
1581
           return(roi)
1582
       } else {
1583
         stop("Here is my new translate_cur function...")
1584
       }
1585
   }
1586
   # Binding it by uncomment follwing lines.
1587
   # unlockBinding("translate_cur", as.environment("package:nm"))
1588
   # unlockBinding("translate_cur", getNamespace("nm"))
1589
   # assign("translate_cur", translate_cur, "package:nm")
1590
   # assign("translate_cur", translate_cur, getNamespace("nm"))
1591
   # lockBinding("translate_cur", getNamespace("nm"))
1592
   # lockBinding("translate_cur", as.environment("package:nm"))
1593

    
1594
R: Translate a list of regions from a strain ref to another.
1595

    
1596

    
1597
Translate a list of regions from a strain ref to another.
1598
---------------------------------------------------------
1599

    
1600

    
1601
Description
1602
~~~~~~~~~~~
1603

    
1604
This function is an eloborated call to translate_cur.
1605

    
1606

    
1607
Usage
1608
~~~~~
1609

    
1610
   translate_regions(regions, combi, cur_index, config = NULL, roi)
1611

    
1612

    
1613
Arguments
1614
~~~~~~~~~
1615

    
1616
"regions"
1617

    
1618
Regions to be translated.
1619

    
1620
"combi"
1621

    
1622
Combination of strains.
1623

    
1624
"cur_index"
1625

    
1626
The region of interest index.
1627

    
1628
"config"
1629

    
1630
GLOBAL config variable
1631

    
1632
"roi"
1633

    
1634
The region of interest.
1635

    
1636

    
1637
Author(s)
1638
~~~~~~~~~
1639

    
1640
Florent Chuffart
1641

    
1642
R: Aggregate regions that intersect themnselves.
1643

    
1644

    
1645
Aggregate regions that intersect themnselves.
1646
---------------------------------------------
1647

    
1648

    
1649
Description
1650
~~~~~~~~~~~
1651

    
1652
This function is based on sort of lower bounds to detect regions that
1653
intersect. We compare lower bound and upper bound of the porevious
1654
item. This function embed a while loop and break break regions list
1655
become stable.
1656

    
1657

    
1658
Usage
1659
~~~~~
1660

    
1661
   union_regions(regions)
1662

    
1663

    
1664
Arguments
1665
~~~~~~~~~
1666

    
1667
"regions"
1668

    
1669
The Regions to be aggregated
1670

    
1671

    
1672
Author(s)
1673
~~~~~~~~~
1674

    
1675
Florent Chuffart
1676

    
1677
R: Watching analysis of samples
1678

    
1679

    
1680
Watching analysis of samples
1681
----------------------------
1682

    
1683

    
1684
Description
1685
~~~~~~~~~~~
1686

    
1687
This function allows to view analysis for a particuler region of the
1688
genome.
1689

    
1690

    
1691
Usage
1692
~~~~~
1693

    
1694
   watch_samples(replicates, read_length, plot_ref_genome = TRUE,
1695
       plot_arrow_raw_reads = TRUE, plot_arrow_nuc_reads = TRUE,
1696
       plot_squared_reads = TRUE, plot_coverage = FALSE, plot_gaussian_reads = TRUE,
1697
       plot_gaussian_unified_reads = TRUE, plot_ellipse_nucs = TRUE,
1698
       change_col = TRUE, plot_wp_nucs = TRUE, plot_fuzzy_nucs = TRUE,
1699
       plot_wp_nuc_model = TRUE, plot_common_nucs = FALSE, plot_common_unrs = FALSE,
1700
       plot_wp_nucs_4_nonmnase = FALSE, plot_chain = FALSE, plot_sample_id = FALSE,
1701
       aggregated_intra_strain_nucs = NULL, aligned_inter_strain_nucs = NULL,
1702
       height = 10, main = NULL, xlab = NULL, ylab = "#reads (per million reads)",
1703
       config = NULL)
1704

    
1705

    
1706
Arguments
1707
~~~~~~~~~
1708

    
1709
"replicates"
1710

    
1711
replicates under the form...
1712

    
1713
"read_length"
1714

    
1715
length of the reads
1716

    
1717
"plot_ref_genome"
1718

    
1719
Plot (or not) reference genome.
1720

    
1721
"plot_arrow_raw_reads"
1722

    
1723
Plot (or not) arrows for raw reads.
1724

    
1725
"plot_arrow_nuc_reads"
1726

    
1727
Plot (or not) arrows for reads aasiocied to a nucleosome.
1728

    
1729
"plot_squared_reads"
1730

    
1731
Plot (or not) reads in the square fashion.
1732

    
1733
"plot_coverage"
1734

    
1735
Plot (or not) reads in the covergae fashion. fashion.
1736

    
1737
"plot_gaussian_reads"
1738

    
1739
Plot (or not) gaussian model of a F anf R reads.
1740

    
1741
"plot_gaussian_unified_reads"
1742

    
1743
Plot (or not) gaussian model of a nuc.
1744

    
1745
"plot_ellipse_nucs"
1746

    
1747
Plot (or not) ellipse for a nuc.
1748

    
1749
"change_col"
1750

    
1751
Change the color of each nucleosome.
1752

    
1753
"plot_wp_nucs"
1754

    
1755
Plot (or not) cluster of nucs
1756

    
1757
"plot_fuzzy_nucs"
1758

    
1759
Plot (or not) cluster of fuzzy
1760

    
1761
"plot_wp_nuc_model"
1762

    
1763
Plot (or not) gaussian model for a cluster of nucs
1764

    
1765
"plot_common_nucs"
1766

    
1767
Plot (or not) aligned reads.
1768

    
1769
"plot_common_unrs"
1770

    
1771
Plot (or not) unaligned nucleosomal refgions (UNRs).
1772

    
1773
"plot_wp_nucs_4_nonmnase"
1774

    
1775
Plot (or not) clusters for non inputs samples.
1776

    
1777
"plot_chain"
1778

    
1779
Plot (or not) clusterised nuceosomes between mnase samples.
1780

    
1781
"plot_sample_id"
1782

    
1783
Plot (or not) the sample id for each sample.
1784

    
1785
"aggregated_intra_strain_nucs"
1786

    
1787
list of aggregated intra strain nucs. If NULL, it will be computed.
1788

    
1789
"aligned_inter_strain_nucs"
1790

    
1791
list of aligned inter strain nucs. If NULL, it will be computed.
1792

    
1793
"height"
1794

    
1795
Number of reads in per million read for each sample, graphical
1796
parametre for the y axis.
1797

    
1798
"main"
1799

    
1800
main title of the produced plot
1801

    
1802
"xlab"
1803

    
1804
xlab of the produced plot
1805

    
1806
"ylab"
1807

    
1808
ylab of the produced plot
1809

    
1810
"config"
1811

    
1812
GLOBAL config variable
1813

    
1814

    
1815
Author(s)
1816
~~~~~~~~~
1817

    
1818
Florent Chuffart