annotate beta_diversity_through_plots_wrapper.py @ 0:c1bd0c560018 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
author bebatut
date Tue, 02 Feb 2016 05:50:37 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
1 #!/usr/bin/env python
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
2
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
3 # create a html output for beta_diverity_through_plots.py
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
4 # to replace beta_diversity_through_plot_html.py in qiime 1.8
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
5 # Leroi Laura laura.leroi@ifremer.fr
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
6
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
7 import optparse
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
8 import os
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
9 import sys
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
10 import subprocess
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
11
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
12 # Create html template
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
13 def html_maker(metrics):
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
14
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
15 tag=""
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
16 plots = metrics.split(',')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
17 for i in range(0, len(plots)):
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
18 tag = tag+"""\t\t<option value='%s_emperor_pcoa_plot/index.html'>%s</option>\n""" % (plots[i], plots[i])
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
19 template_html= """
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
20 <!doctype html>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
21 <html lang="en">
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
22 <head>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
23 <meta charset="utf-8">
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
24 <script type="text/javascript" src="/galaxy/static/scripts/libs/jquery/jquery.js"></script>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
25 </head>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
26 <body>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
27 <label for="outputs">Select a beta-diversity metric :</label>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
28 <select id="outputs" name="outputs">
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
29 %s
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
30 </select>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
31 <br/>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
32 <br/>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
33 <iframe id="plot" name="plot" style="position:absolute; width: 90%%; height: 90%%;" src="" frameborder="0"></iframe>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
34 <script>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
35 $(document).ready(function(){
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
36 var str = "";
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
37 $( "#outputs option:selected" ).each(function() {
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
38 str += $( this ).val() + " ";
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
39 $("#plot").attr("src", str);
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
40 });
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
41
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
42 });
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
43 $( "#outputs" ).change(function () {
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
44 var str = "";
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
45 $( "#outputs option:selected" ).each(function() {
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
46 str += $( this ).val() + " ";
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
47 $("#plot").attr("src", str);
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
48 });
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
49 }).change();
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
50 </script>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
51 </body>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
52 </html> """ % (tag)
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
53 return template_html
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
54
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
55
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
56 def html_matrix_maker(metrics):
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
57
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
58 tag=""
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
59 plots = metrics.split(',')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
60 for i in range(0, len(plots)):
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
61 tag = tag+"""\t\t<a href='%s_dm.txt'>%s_dm</a><br/>\n""" % (plots[i], plots[i])
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
62
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
63 template_html= """
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
64 <!doctype html>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
65 <html lang="en">
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
66 <body>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
67 <label>Metrics matrix : </label><br/>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
68 %s
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
69 </body>
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
70 </html> """ % (tag)
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
71 return template_html
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
72
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
73
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
74 def main():
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
75
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
76 #On importe l environnemnent envqiime
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
77 pipe = subprocess.Popen(". /home12/caparmor/bioinfo/GALAXY_DEV/ourenv/envqiime; python -c 'import os; print \"newenv = %r\" % os.environ'", stdout=subprocess.PIPE, shell=True)
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
78 exec(pipe.communicate()[0])
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
79 os.environ.update(newenv)
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
80
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
81 #New parser
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
82 parser = optparse.OptionParser()
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
83 #beta diversity options
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
84 parser.add_option('--metrics',dest='metrics')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
85 parser.add_option('--biom',dest='biom')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
86 parser.add_option('--mapping',dest='mapping')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
87 parser.add_option('--tree',dest='tree')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
88 parser.add_option('--depth',dest='depth')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
89 parser.add_option('--masterhtml',dest='masterhtml')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
90 parser.add_option('--outputfolder',dest='outputfolder')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
91 parser.add_option('--matrixhtml',dest='matrixhtml')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
92
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
93 (options,args) = parser.parse_args()
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
94
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
95 #New hmtl template
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
96 master = open('./master.html', 'w')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
97 master.write(html_maker(options.metrics))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
98 master.close()
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
99 #On lance le fichier avec les options precisees pour l'affichage html
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
100 os.system("mv master.html %s" % options.masterhtml)
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
101
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
102 #parameter file, which specifies changes to the default behavior
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
103 parameters = open('./parameters.txt','w')
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
104 parameters.write("beta_diversity:metrics %s" % options.metrics)
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
105 parameters.close()
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
106
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
107 if options.depth:
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
108 if options.tree :
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
109 os.system("beta_diversity_through_plots.py -i %s -m %s -t %s -e %s -o %s -p ./parameters.txt >& file_log.txt" % (options.biom, options.mapping, options.tree, options.depth, options.outputfolder))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
110 else :
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
111 os.system("beta_diversity_through_plots.py -i %s -m %s -e %s -o %s -p ./parameters.txt >& file_log.txt" % (options.biom, options.mapping, options.depth, options.outputfolder))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
112 else:
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
113 if options.tree :
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
114 os.system("beta_diversity_through_plots.py -i %s -m %s -t %s -o %s -p ./parameters.txt >& file_log.txt" % (options.biom, options.mapping, options.tree, options.outputfolder))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
115 else :
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
116 os.system("beta_diversity_through_plots.py -i %s -m %s -o %s -p ./parameters.txt >& file_log.txt" % (options.biom, options.mapping, options.outputfolder))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
117
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
118 os.system("mkdir %s/txt" % (options.outputfolder))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
119 os.system("mv %s/*_dm.txt %s/txt" %(options.outputfolder,options.outputfolder))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
120 os.system("compress_path.py -i %s/txt -o %s" % (options.outputfolder,options.matrixhtml))
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
121
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
122 if __name__=="__main__":
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
123 main()
c1bd0c560018 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime commit bcbe76277f3e60303faf826f8ce7f018bc663a9a-dirty
bebatut
parents:
diff changeset
124