Statistiques
| Branche: | Révision :

root / doc / sphinx_doc / build / text / ref.txt @ 6e0010bc

Historique | Voir | Annoter | Télécharger (28,11 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 *lod_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, lod_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
"lod_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 lod
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, lod_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
"lod_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 lod
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 likelihood log of two set of value from two models Vs. a
1276
unique model.
1277

    
1278

    
1279
Usage
1280
~~~~~
1281

    
1282
   lod_score_vecs(x, y)
1283

    
1284

    
1285
Arguments
1286
~~~~~~~~~
1287

    
1288
"x"
1289

    
1290
First vector.
1291

    
1292
"y"
1293

    
1294
Second vector.
1295

    
1296

    
1297
Value
1298
~~~~~
1299

    
1300
Returns the likelihood ratio.
1301

    
1302

    
1303
Author(s)
1304
~~~~~~~~~
1305

    
1306
Florent Chuffart
1307

    
1308

    
1309
Examples
1310
~~~~~~~~
1311

    
1312
   # LOD score for 2 set of values
1313
   mean1=5; sd1=2; card2 = 250
1314
   mean2=6; sd2=3; card1 = 200
1315
   x1 = rnorm(card1, mean1, sd1)
1316
   x2 = rnorm(card2, mean2, sd2)
1317
   min = floor(min(c(x1,x2)))
1318
   max = ceiling(max(c(x1,x2)))
1319
   hist(c(x1,x2), xlim=c(min, max), breaks=min:max)
1320
   lines(min:max,dnorm(min:max,mean1,sd1)*card1,col=2)
1321
   lines(min:max,dnorm(min:max,mean2,sd2)*card2,col=3)
1322
   lines(min:max,dnorm(min:max,mean(c(x1,x2)),sd(c(x1,x2)))*card2,col=4)
1323
   lod_score_vecs(x1,x2)
1324

    
1325
R: nm
1326

    
1327

    
1328
nm
1329
--
1330

    
1331

    
1332
Description
1333
~~~~~~~~~~~
1334

    
1335
It provides a set of useful functions allowing to perform quantitative
1336
analysis of nucleosomal epigenome.
1337

    
1338

    
1339
Details
1340
~~~~~~~
1341

    
1342
+-----------------+-----------------------------------------------------+
1343
| Package:        | nucleominer                                         |
1344
+-----------------+-----------------------------------------------------+
1345
| Maintainer:     | Florent Chuffart <florent.chuffart@ens-lyon.fr>     |
1346
+-----------------+-----------------------------------------------------+
1347
| Author:         | Florent Chuffart                                    |
1348
+-----------------+-----------------------------------------------------+
1349
| Version:        | 2.3.40                                              |
1350
+-----------------+-----------------------------------------------------+
1351
| License:        | CeCILL                                              |
1352
+-----------------+-----------------------------------------------------+
1353
| Title:          | nm                                                  |
1354
+-----------------+-----------------------------------------------------+
1355
| Depends:        | seqinr, plotrix, DESeq, cachecache                  |
1356
+-----------------+-----------------------------------------------------+
1357

    
1358

    
1359
Author(s)
1360
~~~~~~~~~
1361

    
1362
Florent Chuffart
1363

    
1364
R: Plot the distribution of reads.
1365

    
1366

    
1367
Plot the distribution of reads.
1368
-------------------------------
1369

    
1370

    
1371
Description
1372
~~~~~~~~~~~
1373

    
1374
This fuxntion use the deseq nomalization feature to compare
1375
qualitatively the distribution.
1376

    
1377

    
1378
Usage
1379
~~~~~
1380

    
1381
   plot_dist_samples(strain, marker, res, all_samples, NEWPLOT = TRUE)
1382

    
1383

    
1384
Arguments
1385
~~~~~~~~~
1386

    
1387
"strain"
1388

    
1389
The strain to considere.
1390

    
1391
"marker"
1392

    
1393
The marker to considere.
1394

    
1395
"res"
1396

    
1397
Data
1398

    
1399
"all_samples"
1400

    
1401
Global list of samples.
1402

    
1403
"NEWPLOT"
1404

    
1405
If FALSE the curve will be add to the current plot.
1406

    
1407

    
1408
Author(s)
1409
~~~~~~~~~
1410

    
1411
Florent Chuffart
1412

    
1413
R: sign from strand
1414

    
1415

    
1416
sign from strand
1417
----------------
1418

    
1419

    
1420
Description
1421
~~~~~~~~~~~
1422

    
1423
Get the sign of strand
1424

    
1425

    
1426
Usage
1427
~~~~~
1428

    
1429
   sign_from_strand(strands)
1430

    
1431

    
1432
Arguments
1433
~~~~~~~~~
1434

    
1435
+-----------------+------+
1436
+-----------------+------+
1437

    
1438

    
1439
Value
1440
~~~~~
1441

    
1442
If strand in forward then returns 1 else returns -1
1443

    
1444

    
1445
Author(s)
1446
~~~~~~~~~
1447

    
1448
Florent Chuffart
1449

    
1450
R: Substract to a list of regions an other list of regions that...
1451

    
1452

    
1453
Substract to a list of regions an other list of regions that intersect it.
1454
--------------------------------------------------------------------------
1455

    
1456

    
1457
Description
1458
~~~~~~~~~~~
1459

    
1460
This fucntion embed a recursive part. It occurs when a substracted
1461
region split an original region on two.
1462

    
1463

    
1464
Usage
1465
~~~~~
1466

    
1467
   substract_region(region1, region2)
1468

    
1469

    
1470
Arguments
1471
~~~~~~~~~
1472

    
1473
"region1"
1474

    
1475
Original regions.
1476

    
1477
"region2"
1478

    
1479
Regions to substract.
1480

    
1481

    
1482
Author(s)
1483
~~~~~~~~~
1484

    
1485
Florent Chuffart
1486

    
1487
R: Switch a pairlist
1488

    
1489

    
1490
Switch a pairlist
1491
-----------------
1492

    
1493

    
1494
Description
1495
~~~~~~~~~~~
1496

    
1497
Take a pairlist key:value and return the switched pairlist value:key.
1498

    
1499

    
1500
Usage
1501
~~~~~
1502

    
1503
   switch_pairlist(l)
1504

    
1505

    
1506
Arguments
1507
~~~~~~~~~
1508

    
1509
"l"
1510

    
1511
The pairlist to switch.
1512

    
1513

    
1514
Value
1515
~~~~~
1516

    
1517
The switched pairlist.
1518

    
1519

    
1520
Author(s)
1521
~~~~~~~~~
1522

    
1523
Florent Chuffart
1524

    
1525

    
1526
Examples
1527
~~~~~~~~
1528

    
1529
   l = list(key1 = "value1", key2 = "value2")
1530
   print(switch_pairlist(l))
1531

    
1532
R: Translate coords of a genome region.
1533

    
1534

    
1535
Translate coords of a genome region.
1536
------------------------------------
1537

    
1538

    
1539
Description
1540
~~~~~~~~~~~
1541

    
1542
This function is used in the examples, usualy you have to define your
1543
own translation function and overwrite this one using *unlockBinding*
1544
features. Please, refer to the example.
1545

    
1546

    
1547
Usage
1548
~~~~~
1549

    
1550
   translate_cur(roi, strain2, config = NULL, big_cur = NULL)
1551

    
1552

    
1553
Arguments
1554
~~~~~~~~~
1555

    
1556
"roi"
1557

    
1558
Original genome region of interest.
1559

    
1560
"strain2"
1561

    
1562
The strain in wich you want the genome region of interest.
1563

    
1564
"config"
1565

    
1566
GLOBAL config variable
1567

    
1568
"big_cur"
1569

    
1570
A largest region than roi use to filter c2c if it is needed.
1571

    
1572

    
1573
Author(s)
1574
~~~~~~~~~
1575

    
1576
Florent Chuffart
1577

    
1578

    
1579
Examples
1580
~~~~~~~~
1581

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

    
1599
R: Translate a list of regions from a strain ref to another.
1600

    
1601

    
1602
Translate a list of regions from a strain ref to another.
1603
---------------------------------------------------------
1604

    
1605

    
1606
Description
1607
~~~~~~~~~~~
1608

    
1609
This function is an eloborated call to translate_cur.
1610

    
1611

    
1612
Usage
1613
~~~~~
1614

    
1615
   translate_regions(regions, combi, cur_index, config = NULL, roi)
1616

    
1617

    
1618
Arguments
1619
~~~~~~~~~
1620

    
1621
"regions"
1622

    
1623
Regions to be translated.
1624

    
1625
"combi"
1626

    
1627
Combination of strains.
1628

    
1629
"cur_index"
1630

    
1631
The region of interest index.
1632

    
1633
"config"
1634

    
1635
GLOBAL config variable
1636

    
1637
"roi"
1638

    
1639
The region of interest.
1640

    
1641

    
1642
Author(s)
1643
~~~~~~~~~
1644

    
1645
Florent Chuffart
1646

    
1647
R: Aggregate regions that intersect themnselves.
1648

    
1649

    
1650
Aggregate regions that intersect themnselves.
1651
---------------------------------------------
1652

    
1653

    
1654
Description
1655
~~~~~~~~~~~
1656

    
1657
This function is based on sort of lower bounds to detect regions that
1658
intersect. We compare lower bound and upper bound of the porevious
1659
item. This function embed a while loop and break break regions list
1660
become stable.
1661

    
1662

    
1663
Usage
1664
~~~~~
1665

    
1666
   union_regions(regions)
1667

    
1668

    
1669
Arguments
1670
~~~~~~~~~
1671

    
1672
"regions"
1673

    
1674
The Regions to be aggregated
1675

    
1676

    
1677
Author(s)
1678
~~~~~~~~~
1679

    
1680
Florent Chuffart
1681

    
1682
R: Watching analysis of samples
1683

    
1684

    
1685
Watching analysis of samples
1686
----------------------------
1687

    
1688

    
1689
Description
1690
~~~~~~~~~~~
1691

    
1692
This function allows to view analysis for a particuler region of the
1693
genome.
1694

    
1695

    
1696
Usage
1697
~~~~~
1698

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

    
1710

    
1711
Arguments
1712
~~~~~~~~~
1713

    
1714
"replicates"
1715

    
1716
replicates under the form...
1717

    
1718
"read_length"
1719

    
1720
length of the reads
1721

    
1722
"plot_ref_genome"
1723

    
1724
Plot (or not) reference genome.
1725

    
1726
"plot_arrow_raw_reads"
1727

    
1728
Plot (or not) arrows for raw reads.
1729

    
1730
"plot_arrow_nuc_reads"
1731

    
1732
Plot (or not) arrows for reads aasiocied to a nucleosome.
1733

    
1734
"plot_squared_reads"
1735

    
1736
Plot (or not) reads in the square fashion.
1737

    
1738
"plot_coverage"
1739

    
1740
Plot (or not) reads in the covergae fashion. fashion.
1741

    
1742
"plot_gaussian_reads"
1743

    
1744
Plot (or not) gaussian model of a F anf R reads.
1745

    
1746
"plot_gaussian_unified_reads"
1747

    
1748
Plot (or not) gaussian model of a nuc.
1749

    
1750
"plot_ellipse_nucs"
1751

    
1752
Plot (or not) ellipse for a nuc.
1753

    
1754
"change_col"
1755

    
1756
Change the color of each nucleosome.
1757

    
1758
"plot_wp_nucs"
1759

    
1760
Plot (or not) cluster of nucs
1761

    
1762
"plot_fuzzy_nucs"
1763

    
1764
Plot (or not) cluster of fuzzy
1765

    
1766
"plot_wp_nuc_model"
1767

    
1768
Plot (or not) gaussian model for a cluster of nucs
1769

    
1770
"plot_common_nucs"
1771

    
1772
Plot (or not) aligned reads.
1773

    
1774
"plot_common_unrs"
1775

    
1776
Plot (or not) unaligned nucleosomal refgions (UNRs).
1777

    
1778
"plot_wp_nucs_4_nonmnase"
1779

    
1780
Plot (or not) clusters for non inputs samples.
1781

    
1782
"plot_chain"
1783

    
1784
Plot (or not) clusterised nuceosomes between mnase samples.
1785

    
1786
"plot_sample_id"
1787

    
1788
Plot (or not) the sample id for each sample.
1789

    
1790
"aggregated_intra_strain_nucs"
1791

    
1792
list of aggregated intra strain nucs. If NULL, it will be computed.
1793

    
1794
"aligned_inter_strain_nucs"
1795

    
1796
list of aligned inter strain nucs. If NULL, it will be computed.
1797

    
1798
"height"
1799

    
1800
Number of reads in per million read for each sample, graphical
1801
parametre for the y axis.
1802

    
1803
"main"
1804

    
1805
main title of the produced plot
1806

    
1807
"xlab"
1808

    
1809
xlab of the produced plot
1810

    
1811
"ylab"
1812

    
1813
ylab of the produced plot
1814

    
1815
"config"
1816

    
1817
GLOBAL config variable
1818

    
1819

    
1820
Author(s)
1821
~~~~~~~~~
1822

    
1823
Florent Chuffart