commit 5badc2fd692d95cbe72b0729b0c822892be9f606
Author: Florent Chuffart <florent.chuffart@ens-lyon.fr>
Date:   Fri Jul 18 17:34:44 2014 +0200

    Publishing version for submission with documentation and tutorial

diff --git a/README b/README
index 7a83826..0c2b953 100644
--- a/README
+++ b/README
@@ -73,6 +73,12 @@ The Yvert lab web page is accessible here:
 Installation
 ------------
 
+The first installation step is to retrieve the source code of
+MyLabStocks. You can do this by typing the following command in a
+terminal.
+
+   git clone http://forge.cbp.ens-lyon.fr/git/nucleominer
+
 
 Prerequisites
 ~~~~~~~~~~~~~
@@ -98,6 +104,10 @@ system:
 
    * seqinr
 
+   * plotrix
+
+   * DESeq
+
    * cachecache https://forge.cbp.ens-
      lyon.fr/redmine/projects/cachecache
 
@@ -105,3 +115,18 @@ system:
 
    * nucleominer https://forge.cbp.ens-
      lyon.fr/redmine/projects/nucleominer
+
+The first packages could be installed by typing the following command
+in an R console:
+
+   install.packages(c("fork", "rjson", "seqinr", "plotrix"))
+   source("http://bioconductor.org/biocLite.R")
+   biocLite("DESeq")
+
+The last packages are available in the git repository they could be
+install by typing the following command in your terminal:
+
+   cd nucleominer
+   R CMD INSTALL doc/Chuffart_NM2_workdir/deps/bot_0.14.tar.gz\
+       doc/Chuffart_NM2_workdir/deps/cachecache_0.1.tar.gz\
+       build/nucleominer_2.3.46.tar.gz
diff --git a/build/nucleominer_2.3.46.tar.gz b/build/nucleominer_2.3.46.tar.gz
new file mode 100644
index 0000000..dc48ebf
Binary files /dev/null and b/build/nucleominer_2.3.46.tar.gz differ
diff --git a/doc/sphinx_doc/Makefile b/doc/sphinx_doc/Makefile
index becbe08..17a8f92 100644
--- a/doc/sphinx_doc/Makefile
+++ b/doc/sphinx_doc/Makefile
@@ -112,7 +112,7 @@ latexpdf:
 
 text:
 	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
-	cp build/text/readme.txt ../../README 
+	cat build/text/index.txt build/text/readme.txt build/text/tuto.txt ../../README 
 	@echo
 	@echo "Build finished. The text files are in $(BUILDDIR)/text."
 
diff --git a/doc/sphinx_doc/build/latex/NucleoMiner2.pdf b/doc/sphinx_doc/build/latex/NucleoMiner2.pdf
index 44fa6d3..a418027 100644
Binary files a/doc/sphinx_doc/build/latex/NucleoMiner2.pdf and b/doc/sphinx_doc/build/latex/NucleoMiner2.pdf differ
diff --git a/doc/sphinx_doc/conf.py b/doc/sphinx_doc/conf.py
index 28af47b..55057fe 100644
--- a/doc/sphinx_doc/conf.py
+++ b/doc/sphinx_doc/conf.py
@@ -50,9 +50,9 @@ copyright = u'2012, Florent CHUFFART, Jean-Baptiste VEYRIERAS, Gael YVERT'
 # built documents.
 #
 # The short X.Y version.
-version = '2.3.45'
+version = '2.3.46'
 # The full version, including alpha/beta/rc tags.
-release = '2.3.45'
+release = '2.3.46'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/doc/sphinx_doc/readme.rst b/doc/sphinx_doc/readme.rst
index c16a59b..5b4659f 100644
--- a/doc/sphinx_doc/readme.rst
+++ b/doc/sphinx_doc/readme.rst
@@ -84,21 +84,27 @@ It also requires the following R packages to be installed on your system:
  - fork
  - rjson
  - seqinr
+ - plotrix
+ - DESeq
  - cachecache https://forge.cbp.ens-lyon.fr/redmine/projects/cachecache
  - bot https://forge.cbp.ens-lyon.fr/redmine/projects/bot
  - nucleominer https://forge.cbp.ens-lyon.fr/redmine/projects/nucleominer
  
 The first packages could be installed by typing the following command in an R console:
 
+.. code:: bash
 
+   install.packages(c("fork", "rjson", "seqinr", "plotrix"))
+   source("http://bioconductor.org/biocLite.R")
+   biocLite("DESeq")
  
 The last packages are available in the git repository they could be install by typing the following command in your terminal:
 
 .. code:: bash
 
   cd nucleominer
-   R CMD INSTALL doc/Chuffart_NM2_workdir/deps/bot_0.14.tar.gz\
+  R CMD INSTALL doc/Chuffart_NM2_workdir/deps/bot_0.14.tar.gz\
       doc/Chuffart_NM2_workdir/deps/cachecache_0.1.tar.gz\
-      build/nucleominer_2.XXX.tar.gz 
+      build/nucleominer_2.3.46.tar.gz 
       
       
\ No newline at end of file
diff --git a/doc/sphinx_doc/rref.rst b/doc/sphinx_doc/rref.rst
index 724e329..f5e2110 100644
--- a/doc/sphinx_doc/rref.rst
+++ b/doc/sphinx_doc/rref.rst
@@ -102,7 +102,7 @@ replicates. Adjacent nucleosomes of the chain are compared two by two.
 Comparison is based on a log likelihood ratio (LLR1). depending on the
 LLR1 value nucleosomes are merged (low LLR) or separated (high LLR).
 Finally the function returns a list of clusters and all computed
-llr\_scores. Each cluster ows an attribute wp for “well positioned”.
+llr\_scores. Each cluster ows an attribute wp for "well positioned".
 This attribute is set to TRUE if the cluster is composed of exactly one
 nucleosome of each sample.
 
@@ -1251,7 +1251,7 @@ Details
 +---------------+---------------------------------------------------+
 | Author:       | Florent Chuffart                                  |
 +---------------+---------------------------------------------------+
-| Version:      | 2.3.45                                            |
+| Version:      | 2.3.46                                            |
 +---------------+---------------------------------------------------+
 | License:      | CeCILL                                            |
 +---------------+---------------------------------------------------+
diff --git a/doc/sphinx_doc/tuto.rst b/doc/sphinx_doc/tuto.rst
index f1ee89b..44c64a9 100644
--- a/doc/sphinx_doc/tuto.rst
+++ b/doc/sphinx_doc/tuto.rst
@@ -14,10 +14,11 @@ Experimental Dataset, Working Directory and Configuration File
 Working Directory Organisation
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The working directory... 
+After having install NucleoMiner2 environment (Previous section), go to the root working directory of the tutorial by typing the following command in a terminal:
 
-$$$ TODO: Explain how and where retrieve the workdir
+.. code:: bash
 
+  cd doc/Chuffart_NM2_workdir/
 
 
 Retrieving Experimental Dataset
@@ -247,7 +248,6 @@ id  strain  found nucs  nuc file size  process duration
 
 ..
 ..
-.. $$$ other python script to describe:
 .. - libcoverage.py
 .. - wf.py
 ..
@@ -636,6 +636,10 @@ wpunr   BY-RM 39961    5240
 APPENDICE: Generate .c2c Files
 ------------------------------
 
+$$$ TODO make it works properly.
+working directory.
+
+
 The `.c2c` files is a simple table that describes how the genome sequence can be aligned. We generate it using NucleoMiner 1.0.
 
 To install NucleoMiner 1.0 on your UNIX/LINUX computer you need first to install the Genetic Data analysis Library (GDL), which is a dynamic library of useful C functions derived from the GNU Scientific Library.
@@ -651,9 +655,16 @@ This creates a directory called gdl-1.0. You now need to go into this directory
 
 .. code:: bash
 
+  mkdir tmp_c2c_workdir
+  cd tmp_c2c_workdir
+  cp ../deps/gdl-1.0.tar.gz .
+  tar -xvzf gdl-1.0.tar.gz
   cd gdl-1.0
   ./configure
   make
+  
+  cd ..
+  
 
 Now you need to install the library on your system. This needs root priviledges:
 
@@ -661,17 +672,19 @@ Now you need to install the library on your system. This needs root priviledges:
 
   sudo make install
 
-Installing NucleoMiner
-^^^^^^^^^^^^^^^^^^^^^^
+Installing NucleoMiner 1.0
+^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Get the nucleominer-1.0.tar.gz archive on your computer. Copy it in a dedicated directory. Go into this directory using the cd command, and then unfold the archive by typing:
 
-tar -xvzf nucleominer-1.0.tar.gz
 This creates a directory called nucleominer-1.0. You now need to go into this directory and compile the library, by typing:
 
 .. code:: bash
 
+  cp ../deps/nucleominer-1.0.tar.gz .
+  tar -xvzf nucleominer-1.0.tar.gz
   cd nucleominer-1.0
+  ln -s ../gdl-1.0/gdl
   ./configure
   make
 
@@ -689,8 +702,8 @@ To generate .c2c files you need to type the following command in a terminal:
 .. code:: bash
 
   mkdir dir_4_c2c
-  NMgxcomp Data/BY_S288c/Sequence/Genome.fasta \
-           Data/RM_11-1a/Sequence/Genome.fasta \
+  NMgxcomp ../data/saccharomyces_cerevisiae_BY_S288c_chromosomes.fasta\
+           ../data/saccharomyces_cerevisiae_rm11-1a_1_supercontigs.fasta\
            dir_4_c2c/BY_RM 2>dir_4_c2c/BY_RM.log
             
-After execution, the directory dir_4_c2c will hold the .c2c files.
+After execution, the directory `dir_4_c2c` will hold the .c2c files.
diff --git a/src/DESCRIPTION b/src/DESCRIPTION
index 7e323ad..2ffc4fa 100644
--- a/src/DESCRIPTION
+++ b/src/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: nucleominer
 Maintainer: Florent Chuffart <florent.chuffart@ens-lyon.fr>
 Author: Florent Chuffart
-Version: 2.3.45
+Version: 2.3.46
 License: CeCILL 
 Title: nm
 Depends: seqinr, plotrix, DESeq, cachecache
diff --git a/src/R/nucleominer.R b/src/R/nucleominer.R
index 040eea0..a06e449 100644
--- a/src/R/nucleominer.R
+++ b/src/R/nucleominer.R
@@ -1,89 +1,3 @@
-# get_content = function(# Get content from cached
-# ### Acces to the cached content of a file via the global variable NM_CACHE. Load content in NM_CACHE if needed.
-# obj, ##<< The object that we want its content.
-# ... ##<< Parameters that will be passed to my_read
-# ) {
-#   UseMethod("get_content", obj)
-#   ### Returns the cached content of the current object.
-# }
-#
-# get_content.default = structure( function(# Get content from cached
-# ### Acces to the cached content of a file via the global variable NM_CACHE. Load content in NM_CACHE if needed.
-# obj, ##<< The object that we want its content.
-# ... ##<< Parameters that will be passed to my_read
-# ) {
-#   if (inherits(try(NM_CACHE,TRUE), "try-error") || is.null(NM_CACHE)) {
-#     NM_CACHE <<- list()
-#   }
-#   if (is.null(NM_CACHE[[obj$filename]])) {
-#     print(paste("Loading file ",obj$filename, sep=""))
-#     tmp_content = my_read(obj, ...)
-#     print("affect it...")
-#     NM_CACHE[[obj$filename]] <<- tmp_content
-#     print("done.")
-#   }
-#   return(NM_CACHE[[obj$filename]])
-# ### Returns the cached content of the current object.
-# }, ex=function(){
-#   # Create a dataframe
-#   df = NULL
-#   df = dfadd(df, list(key1 = "value1", key2 = "value2"))
-#   df = dfadd(df, list(key1 = "value1'", key2 = "value3'"))
-#   # Dump it into tmp file
-#   write.table(df, file="/tmp/tmp.dump.table.tmp")
-#   # Load it into cache using feature.
-#   cached_content_object  = list(filename="/tmp/tmp.dump.table.tmp")
-#   class(cached_content_object) = "table"
-#   # First time it will be load into cache
-#   print(get_content(cached_content_object))
-#   # Second time not
-#   print(get_content(cached_content_object))
-#
-# })
-#
-# my_read = function(
-# ### Abstract my_read function.
-#   obj, ...) {
-#   UseMethod("my_read", obj)
-# }
-#
-# my_read.default = function(
-# ### Default my_read function.
-#   obj, ...){
-#   stop(paste("ERROR, my_read is not defined for any Objects (file ", obj$filename," )", sep=""))
-# }
-#
-# my_read.fasta = function(
-# ### my_read function for fasta files.
-#   obj, ...){
-#   # require(seqinr)
-#   return(read.fasta(obj$filename, ...))
-# }
-#
-# my_read.table = function(
-# ### my_read function for table files.
-#   obj, ...){
-#   if (rev(unlist(strsplit(obj$filename, ".", fixed=TRUE)))[1] == "gz") {
-#     return(read.table(file=gzfile(obj$filename), ...))
-#   } else {
-#     return(read.table(file=obj$filename, ...))
-#   }
-# }
-#
-# my_read.cvs = function(
-# ### my_read function for cvs files.
-#   obj, ...){
-#   return(read.csv(file=obj$filename, ...))
-# }
-
-
-
-
-
-
-
-
-
 FDR = structure(function#  False Discovery Rate
 ### From a vector x of independent p-values, extract the cutoff corresponding to the specified FDR. See Benjamini & Hochberg 1995 paper
 ##author<< Gael Yvert,
@@ -273,7 +187,7 @@ strand ##<< The original strand.
 
 
 aggregate_intra_strain_nucs = structure(function(# Aggregate replicated sample's nucleosomes.
-### This function aggregates nucleosomes from replicated samples. It uses TemplateFilter ouput of each sample as replicate. Each sample owns a set of nucleosomes computed using TemplateFilter and ordered by the position of their center (dyad). A chain of nucleosomes is builts across all replicates. Adjacent nucleosomes of the chain are compared two by two. Comparison is based on a log likelihood ratio (LLR1). depending on the LLR1 value nucleosomes are merged (low LLR) or separated (high LLR). Finally the function returns a list of clusters and all computed llr_scores. Each cluster ows an attribute wp for “well positioned”. This attribute is set to TRUE if the cluster is composed of exactly one nucleosome of each sample.
+### This function aggregates nucleosomes from replicated samples. It uses TemplateFilter ouput of each sample as replicate. Each sample owns a set of nucleosomes computed using TemplateFilter and ordered by the position of their center (dyad). A chain of nucleosomes is builts across all replicates. Adjacent nucleosomes of the chain are compared two by two. Comparison is based on a log likelihood ratio (LLR1). depending on the LLR1 value nucleosomes are merged (low LLR) or separated (high LLR). Finally the function returns a list of clusters and all computed llr_scores. Each cluster ows an attribute wp for "well positioned". This attribute is set to TRUE if the cluster is composed of exactly one nucleosome of each sample.
 samples, ##<< A list of samples. Each sample is a list like \emph{sample = list(id=..., marker=..., strain=..., roi=..., inputs=..., outputs=...)} with \emph{roi = list(name=..., begin=...,  end=..., chr=..., genome=...)}.
 llr_thres=20, ##<< Log likelihood ratio threshold to decide between merging and separating
 coord_max=20000000 ##<< A too big value to be a coord for a nucleosome lower bound.
@@ -1085,7 +999,7 @@ config=NULL ##<< GLOBAL config variable
   # print(snep_design)
 	thres = FDR(reads$pvalsGLM, FDR)
 	reads$snep_index = reads$pvalsGLM < thres
-	print(paste(sum(reads$snep_index), " SNEPs found for ", length(reads[,1])," nucs and ", fdr*100,"% of FDR.", sep = ""))
+	print(paste(sum(reads$snep_index), " SNEPs found for ", length(reads[,1])," nucs and ", FDR*100,"% of FDR.", sep = ""))
   return(reads)
   },  ex=function(){
     marker = "H3K4me1"
@@ -1946,7 +1860,6 @@ config=NULL ##<< GLOBAL config variable
 				if (length(nucs$center) > 0) {
 					col = 1
 		      for (i in 1:length(nucs$center)) {
-            foo<<-nucs
             if (change_col) {
   						col = col + 1
               } else {
