Commit a0cdc5c3 authored by Penom Nom's avatar Penom Nom
Browse files

fix bug label in otuanalysis component

parent 75c49600
......@@ -92,7 +92,7 @@ class MothurOTUAnalysis(Analysis):
"""
def define_parameters(self, an_list_files, taxonomy_files, fasta_subsample_files=None, names_files=None, groups_files=None, count_table_files=None, \
calc="simpson-npshannon-shannon-jack-ace-chao", tree_calc="thetayc", label="unique-0.10-0.05-0.03", tree_label="unique-0.01", freq=100):
calc="simpson-npshannon-shannon-jack-ace-chao", tree_calc="thetayc", label="unique-0.03-0.05-0.10", tree_label="unique-0.01", freq=100):
"""
:param an_list_files: an list files to process
:type an_list_files: str
......@@ -135,6 +135,8 @@ class MothurOTUAnalysis(Analysis):
if count_table_files : self.count_table_files = InputFileList(count_table_files, Formats.MOTHUR_COUNT_TABLE)
else : self.count_table_files = None
labels = self.label.split('-')
user_labels = [lines.split('\t')[0] for lines in open(self.an_list_files[0]).readlines()]
good_label = list(set(user_labels).intersection(set(labels)))
#define makeshared output files
self.shared_files = OutputFileList(self.get_outputs('{basename_woext}.shared', self.an_list_files))
self.makeshared_stdout = OutputFileList(self.get_outputs('{basename_woext}.makeshared.stdout', self.an_list_files))
......@@ -145,9 +147,9 @@ class MothurOTUAnalysis(Analysis):
self.rarefaction_single_files = OutputFileList(self.get_outputs('{basename_woext}.groups.rarefaction', self.shared_files))
self.rarefactionsingle_stdout = OutputFileList(self.get_outputs('{basename_woext}.rarefactionsingle.stdout', self.shared_files))
#define treeshared output files
list_tree_files = [os.path.splitext(self.shared_files[0])[0]+"."+tree_calc+"."+label+".tre" for label in labels]
self.tree_files = OutputFileList(self.get_outputs('{basename}', list_tree_files))
self.treeshared_stdout = OutputFileList(self.get_outputs('{basename_woext}.treeshared.stdout', self.shared_files))
# list_tree_files = [os.path.splitext(self.shared_files[0])[0]+"."+tree_calc+"."+label+".tre" for label in good_label]
# self.tree_files = OutputFileList(self.get_outputs('{basename}', list_tree_files))
# self.treeshared_stdout = OutputFileList(self.get_outputs('{basename_woext}.treeshared.stdout', self.shared_files))
#define subsample output files
if fasta_subsample_files :
self.subsample_fasta_files = OutputFileList(self.get_outputs('{basename_woext}.subsample.fasta', self.fasta_subsample_files), Formats.FASTA)
......@@ -157,7 +159,7 @@ class MothurOTUAnalysis(Analysis):
self.subsample_count_files = OutputFileList(self.get_outputs('{basename_woext}.subsample.count_table', self.count_table_files), Formats.MOTHUR_COUNT_TABLE)
self.subsample_stdout = OutputFileList(self.get_outputs('{basename_woext}.subsample.stdout', self.count_table_files))
#define classifyotu output files
self.cons_taxonomy_files = OutputFileList([os.path.join(self.output_directory,l+".taxonomy") for l in labels],Formats.MOTHUR_TAXONOMY)
self.cons_taxonomy_files = OutputFileList([os.path.join(self.output_directory,l+".taxonomy") for l in good_label],Formats.MOTHUR_TAXONOMY)
#self.cons_tax_taxonomy_files = OutputFileList(self.get_outputs('{basename_woext}.'+str(self.label.split('-')[0])+'.cons.tax.summary', self.an_list_files))
self.classifyotu_stdout = OutputFileList(self.get_outputs('{basename_woext}.classifyotu.stdout', self.an_list_files))
#define krona output files
......@@ -370,9 +372,10 @@ class MothurOTUAnalysis(Analysis):
self.output_directory+'/)" > $2',cmd_format='{EXE} {IN} {OUT}')
rarefactionsingle = MultiMap(rarefactionsingle, inputs=[self.shared_files], outputs=[self.rarefactionsingle_stdout,self.rarefaction_single_files])
# Beta diversity analysis
treeshared = ShellFunction(self.get_exec_path("mothur") + ' "#tree.shared(shared=$1,calc='+self.tree_calc+',label='+self.tree_label+',outputdir='+self.output_directory+\
'/)" > $2',cmd_format='{EXE} {IN} {OUT}')
treeshared(inputs=self.shared_files[0], outputs=[self.treeshared_stdout,self.tree_files])
#TODO : create an interface in NG6
# treeshared = ShellFunction(self.get_exec_path("mothur") + ' "#tree.shared(shared=$1,calc='+self.tree_calc+',label='+self.tree_label+',outputdir='+self.output_directory+\
# '/)" > $2',cmd_format='{EXE} {IN} {OUT}')
# treeshared(inputs=self.shared_files[0], outputs=[self.treeshared_stdout,self.tree_files])
#Classify OTUs
if self.fasta_subsample_files and self.count_table_files:
subsample = ShellFunction(self.get_exec_path("mothur") + ' "#sub.sample(fasta=$1,count=$2,outputdir='+self.output_directory+'/)" > $3',cmd_format='{EXE} {IN} {OUT}')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment