Révision 5badc2fd
b/README | ||
---|---|---|
73 | 73 |
Installation |
74 | 74 |
------------ |
75 | 75 |
|
76 |
The first installation step is to retrieve the source code of |
|
77 |
MyLabStocks. You can do this by typing the following command in a |
|
78 |
terminal. |
|
79 |
|
|
80 |
git clone http://forge.cbp.ens-lyon.fr/git/nucleominer |
|
81 |
|
|
76 | 82 |
|
77 | 83 |
Prerequisites |
78 | 84 |
~~~~~~~~~~~~~ |
... | ... | |
98 | 104 |
|
99 | 105 |
* seqinr |
100 | 106 |
|
107 |
* plotrix |
|
108 |
|
|
109 |
* DESeq |
|
110 |
|
|
101 | 111 |
* cachecache https://forge.cbp.ens- |
102 | 112 |
lyon.fr/redmine/projects/cachecache |
103 | 113 |
|
... | ... | |
105 | 115 |
|
106 | 116 |
* nucleominer https://forge.cbp.ens- |
107 | 117 |
lyon.fr/redmine/projects/nucleominer |
118 |
|
|
119 |
The first packages could be installed by typing the following command |
|
120 |
in an R console: |
|
121 |
|
|
122 |
install.packages(c("fork", "rjson", "seqinr", "plotrix")) |
|
123 |
source("http://bioconductor.org/biocLite.R") |
|
124 |
biocLite("DESeq") |
|
125 |
|
|
126 |
The last packages are available in the git repository they could be |
|
127 |
install by typing the following command in your terminal: |
|
128 |
|
|
129 |
cd nucleominer |
|
130 |
R CMD INSTALL doc/Chuffart_NM2_workdir/deps/bot_0.14.tar.gz\ |
|
131 |
doc/Chuffart_NM2_workdir/deps/cachecache_0.1.tar.gz\ |
|
132 |
build/nucleominer_2.3.46.tar.gz |
b/doc/sphinx_doc/Makefile | ||
---|---|---|
112 | 112 |
|
113 | 113 |
text: |
114 | 114 |
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text |
115 |
cp build/text/readme.txt ../../README
|
|
115 |
cat build/text/index.txt build/text/readme.txt build/text/tuto.txt ../../README
|
|
116 | 116 |
@echo |
117 | 117 |
@echo "Build finished. The text files are in $(BUILDDIR)/text." |
118 | 118 |
|
b/doc/sphinx_doc/conf.py | ||
---|---|---|
50 | 50 |
# built documents. |
51 | 51 |
# |
52 | 52 |
# The short X.Y version. |
53 |
version = '2.3.45'
|
|
53 |
version = '2.3.46'
|
|
54 | 54 |
# The full version, including alpha/beta/rc tags. |
55 |
release = '2.3.45'
|
|
55 |
release = '2.3.46'
|
|
56 | 56 |
|
57 | 57 |
# The language for content autogenerated by Sphinx. Refer to documentation |
58 | 58 |
# for a list of supported languages. |
b/doc/sphinx_doc/readme.rst | ||
---|---|---|
84 | 84 |
- fork |
85 | 85 |
- rjson |
86 | 86 |
- seqinr |
87 |
- plotrix |
|
88 |
- DESeq |
|
87 | 89 |
- cachecache https://forge.cbp.ens-lyon.fr/redmine/projects/cachecache |
88 | 90 |
- bot https://forge.cbp.ens-lyon.fr/redmine/projects/bot |
89 | 91 |
- nucleominer https://forge.cbp.ens-lyon.fr/redmine/projects/nucleominer |
90 | 92 |
|
91 | 93 |
The first packages could be installed by typing the following command in an R console: |
92 | 94 |
|
95 |
.. code:: bash |
|
93 | 96 |
|
97 |
install.packages(c("fork", "rjson", "seqinr", "plotrix")) |
|
98 |
source("http://bioconductor.org/biocLite.R") |
|
99 |
biocLite("DESeq") |
|
94 | 100 |
|
95 | 101 |
The last packages are available in the git repository they could be install by typing the following command in your terminal: |
96 | 102 |
|
97 | 103 |
.. code:: bash |
98 | 104 |
|
99 | 105 |
cd nucleominer |
100 |
R CMD INSTALL doc/Chuffart_NM2_workdir/deps/bot_0.14.tar.gz\
|
|
106 |
R CMD INSTALL doc/Chuffart_NM2_workdir/deps/bot_0.14.tar.gz\ |
|
101 | 107 |
doc/Chuffart_NM2_workdir/deps/cachecache_0.1.tar.gz\ |
102 |
build/nucleominer_2.XXX.tar.gz
|
|
108 |
build/nucleominer_2.3.46.tar.gz
|
|
103 | 109 |
|
104 | 110 |
|
b/doc/sphinx_doc/rref.rst | ||
---|---|---|
102 | 102 |
Comparison is based on a log likelihood ratio (LLR1). depending on the |
103 | 103 |
LLR1 value nucleosomes are merged (low LLR) or separated (high LLR). |
104 | 104 |
Finally the function returns a list of clusters and all computed |
105 |
llr\_scores. Each cluster ows an attribute wp for “well positioned”.
|
|
105 |
llr\_scores. Each cluster ows an attribute wp for "well positioned".
|
|
106 | 106 |
This attribute is set to TRUE if the cluster is composed of exactly one |
107 | 107 |
nucleosome of each sample. |
108 | 108 |
|
... | ... | |
1251 | 1251 |
+---------------+---------------------------------------------------+ |
1252 | 1252 |
| Author: | Florent Chuffart | |
1253 | 1253 |
+---------------+---------------------------------------------------+ |
1254 |
| Version: | 2.3.45 |
|
|
1254 |
| Version: | 2.3.46 |
|
|
1255 | 1255 |
+---------------+---------------------------------------------------+ |
1256 | 1256 |
| License: | CeCILL | |
1257 | 1257 |
+---------------+---------------------------------------------------+ |
b/doc/sphinx_doc/tuto.rst | ||
---|---|---|
14 | 14 |
Working Directory Organisation |
15 | 15 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
16 | 16 |
|
17 |
The working directory...
|
|
17 |
After having install NucleoMiner2 environment (Previous section), go to the root working directory of the tutorial by typing the following command in a terminal:
|
|
18 | 18 |
|
19 |
$$$ TODO: Explain how and where retrieve the workdir
|
|
19 |
.. code:: bash
|
|
20 | 20 |
|
21 |
cd doc/Chuffart_NM2_workdir/ |
|
21 | 22 |
|
22 | 23 |
|
23 | 24 |
Retrieving Experimental Dataset |
... | ... | |
247 | 248 |
|
248 | 249 |
.. |
249 | 250 |
.. |
250 |
.. $$$ other python script to describe: |
|
251 | 251 |
.. - libcoverage.py |
252 | 252 |
.. - wf.py |
253 | 253 |
.. |
... | ... | |
636 | 636 |
APPENDICE: Generate .c2c Files |
637 | 637 |
------------------------------ |
638 | 638 |
|
639 |
$$$ TODO make it works properly. |
|
640 |
working directory. |
|
641 |
|
|
642 |
|
|
639 | 643 |
The `.c2c` files is a simple table that describes how the genome sequence can be aligned. We generate it using NucleoMiner 1.0. |
640 | 644 |
|
641 | 645 |
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 | 655 |
|
652 | 656 |
.. code:: bash |
653 | 657 |
|
658 |
mkdir tmp_c2c_workdir |
|
659 |
cd tmp_c2c_workdir |
|
660 |
cp ../deps/gdl-1.0.tar.gz . |
|
661 |
tar -xvzf gdl-1.0.tar.gz |
|
654 | 662 |
cd gdl-1.0 |
655 | 663 |
./configure |
656 | 664 |
make |
665 |
|
|
666 |
cd .. |
|
667 |
|
|
657 | 668 |
|
658 | 669 |
Now you need to install the library on your system. This needs root priviledges: |
659 | 670 |
|
... | ... | |
661 | 672 |
|
662 | 673 |
sudo make install |
663 | 674 |
|
664 |
Installing NucleoMiner |
|
665 |
^^^^^^^^^^^^^^^^^^^^^^ |
|
675 |
Installing NucleoMiner 1.0
|
|
676 |
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
666 | 677 |
|
667 | 678 |
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: |
668 | 679 |
|
669 |
tar -xvzf nucleominer-1.0.tar.gz |
|
670 | 680 |
This creates a directory called nucleominer-1.0. You now need to go into this directory and compile the library, by typing: |
671 | 681 |
|
672 | 682 |
.. code:: bash |
673 | 683 |
|
684 |
cp ../deps/nucleominer-1.0.tar.gz . |
|
685 |
tar -xvzf nucleominer-1.0.tar.gz |
|
674 | 686 |
cd nucleominer-1.0 |
687 |
ln -s ../gdl-1.0/gdl |
|
675 | 688 |
./configure |
676 | 689 |
make |
677 | 690 |
|
... | ... | |
689 | 702 |
.. code:: bash |
690 | 703 |
|
691 | 704 |
mkdir dir_4_c2c |
692 |
NMgxcomp Data/BY_S288c/Sequence/Genome.fasta \
|
|
693 |
Data/RM_11-1a/Sequence/Genome.fasta \
|
|
705 |
NMgxcomp ../data/saccharomyces_cerevisiae_BY_S288c_chromosomes.fasta\
|
|
706 |
../data/saccharomyces_cerevisiae_rm11-1a_1_supercontigs.fasta\
|
|
694 | 707 |
dir_4_c2c/BY_RM 2>dir_4_c2c/BY_RM.log |
695 | 708 |
|
696 |
After execution, the directory dir_4_c2c will hold the .c2c files. |
|
709 |
After execution, the directory `dir_4_c2c` will hold the .c2c files. |
b/src/DESCRIPTION | ||
---|---|---|
1 | 1 |
Package: nucleominer |
2 | 2 |
Maintainer: Florent Chuffart <florent.chuffart@ens-lyon.fr> |
3 | 3 |
Author: Florent Chuffart |
4 |
Version: 2.3.45
|
|
4 |
Version: 2.3.46
|
|
5 | 5 |
License: CeCILL |
6 | 6 |
Title: nm |
7 | 7 |
Depends: seqinr, plotrix, DESeq, cachecache |
b/src/R/nucleominer.R | ||
---|---|---|
1 |
# get_content = function(# Get content from cached |
|
2 |
# ### Acces to the cached content of a file via the global variable NM_CACHE. Load content in NM_CACHE if needed. |
|
3 |
# obj, ##<< The object that we want its content. |
|
4 |
# ... ##<< Parameters that will be passed to my_read |
|
5 |
# ) { |
|
6 |
# UseMethod("get_content", obj) |
|
7 |
# ### Returns the cached content of the current object. |
|
8 |
# } |
|
9 |
# |
|
10 |
# get_content.default = structure( function(# Get content from cached |
|
11 |
# ### Acces to the cached content of a file via the global variable NM_CACHE. Load content in NM_CACHE if needed. |
|
12 |
# obj, ##<< The object that we want its content. |
|
13 |
# ... ##<< Parameters that will be passed to my_read |
|
14 |
# ) { |
|
15 |
# if (inherits(try(NM_CACHE,TRUE), "try-error") || is.null(NM_CACHE)) { |
|
16 |
# NM_CACHE <<- list() |
|
17 |
# } |
|
18 |
# if (is.null(NM_CACHE[[obj$filename]])) { |
|
19 |
# print(paste("Loading file ",obj$filename, sep="")) |
|
20 |
# tmp_content = my_read(obj, ...) |
|
21 |
# print("affect it...") |
|
22 |
# NM_CACHE[[obj$filename]] <<- tmp_content |
|
23 |
# print("done.") |
|
24 |
# } |
|
25 |
# return(NM_CACHE[[obj$filename]]) |
|
26 |
# ### Returns the cached content of the current object. |
|
27 |
# }, ex=function(){ |
|
28 |
# # Create a dataframe |
|
29 |
# df = NULL |
|
30 |
# df = dfadd(df, list(key1 = "value1", key2 = "value2")) |
|
31 |
# df = dfadd(df, list(key1 = "value1'", key2 = "value3'")) |
|
32 |
# # Dump it into tmp file |
|
33 |
# write.table(df, file="/tmp/tmp.dump.table.tmp") |
|
34 |
# # Load it into cache using feature. |
|
35 |
# cached_content_object = list(filename="/tmp/tmp.dump.table.tmp") |
|
36 |
# class(cached_content_object) = "table" |
|
37 |
# # First time it will be load into cache |
|
38 |
# print(get_content(cached_content_object)) |
|
39 |
# # Second time not |
|
40 |
# print(get_content(cached_content_object)) |
|
41 |
# |
|
42 |
# }) |
|
43 |
# |
|
44 |
# my_read = function( |
|
45 |
# ### Abstract my_read function. |
|
46 |
# obj, ...) { |
|
47 |
# UseMethod("my_read", obj) |
|
48 |
# } |
|
49 |
# |
|
50 |
# my_read.default = function( |
|
51 |
# ### Default my_read function. |
|
52 |
# obj, ...){ |
|
53 |
# stop(paste("ERROR, my_read is not defined for any Objects (file ", obj$filename," )", sep="")) |
|
54 |
# } |
|
55 |
# |
|
56 |
# my_read.fasta = function( |
|
57 |
# ### my_read function for fasta files. |
|
58 |
# obj, ...){ |
|
59 |
# # require(seqinr) |
|
60 |
# return(read.fasta(obj$filename, ...)) |
|
61 |
# } |
|
62 |
# |
|
63 |
# my_read.table = function( |
|
64 |
# ### my_read function for table files. |
|
65 |
# obj, ...){ |
|
66 |
# if (rev(unlist(strsplit(obj$filename, ".", fixed=TRUE)))[1] == "gz") { |
|
67 |
# return(read.table(file=gzfile(obj$filename), ...)) |
|
68 |
# } else { |
|
69 |
# return(read.table(file=obj$filename, ...)) |
|
70 |
# } |
|
71 |
# } |
|
72 |
# |
|
73 |
# my_read.cvs = function( |
|
74 |
# ### my_read function for cvs files. |
|
75 |
# obj, ...){ |
|
76 |
# return(read.csv(file=obj$filename, ...)) |
|
77 |
# } |
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 | 1 |
FDR = structure(function# False Discovery Rate |
88 | 2 |
### From a vector x of independent p-values, extract the cutoff corresponding to the specified FDR. See Benjamini & Hochberg 1995 paper |
89 | 3 |
##author<< Gael Yvert, |
... | ... | |
273 | 187 |
|
274 | 188 |
|
275 | 189 |
aggregate_intra_strain_nucs = structure(function(# Aggregate replicated sample's nucleosomes. |
276 |
### 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.
|
|
190 |
### 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.
|
|
277 | 191 |
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=...)}. |
278 | 192 |
llr_thres=20, ##<< Log likelihood ratio threshold to decide between merging and separating |
279 | 193 |
coord_max=20000000 ##<< A too big value to be a coord for a nucleosome lower bound. |
... | ... | |
1085 | 999 |
# print(snep_design) |
1086 | 1000 |
thres = FDR(reads$pvalsGLM, FDR) |
1087 | 1001 |
reads$snep_index = reads$pvalsGLM < thres |
1088 |
print(paste(sum(reads$snep_index), " SNEPs found for ", length(reads[,1])," nucs and ", fdr*100,"% of FDR.", sep = ""))
|
|
1002 |
print(paste(sum(reads$snep_index), " SNEPs found for ", length(reads[,1])," nucs and ", FDR*100,"% of FDR.", sep = ""))
|
|
1089 | 1003 |
return(reads) |
1090 | 1004 |
}, ex=function(){ |
1091 | 1005 |
marker = "H3K4me1" |
... | ... | |
1946 | 1860 |
if (length(nucs$center) > 0) { |
1947 | 1861 |
col = 1 |
1948 | 1862 |
for (i in 1:length(nucs$center)) { |
1949 |
foo<<-nucs |
|
1950 | 1863 |
if (change_col) { |
1951 | 1864 |
col = col + 1 |
1952 | 1865 |
} else { |
Formats disponibles : Unified diff