Commit 860a14ad authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent d8bb72ff
......@@ -25,6 +25,7 @@ class Formats(object):
SFF = "sff"
QUAL = "qual"
FLOW = "flow"
HTML = "html"
MOTHUR_NAMES = "mothur_names"
MOTHUR_OLIGOS = "mothur_oligos"
MOTHUR_GROUPS = "mothur_groups"
......
......@@ -57,7 +57,7 @@ class RNAdiversity (Workflow):
# classify reads with the provided taxonomy
classifyseqs = self.add_component("MothurClassifySeqs",[removeseqs.pick_fasta_files,self.args["classify_template"],self.args["classify_taxonomy"],removeseqs.pick_names_files,\
removeseqs.pick_groups_files])
# krona_classifyseqs = self.add_component("MothurKrona", [classifyseqs.taxonomy_files,removeseqs.pick_names_files,removeseqs.pick_groups_files],component_prefix="classifyseqs")
krona_classifyseqs = self.add_component("MothurKrona", [classifyseqs.taxonomy_files,removeseqs.pick_names_files,removeseqs.pick_groups_files],component_prefix="classifyseqs")
# OTUs approach
distseqs = self.add_component("MothurDistSeqs", [removeseqs.pick_fasta_files])
......
......@@ -33,29 +33,23 @@ def classifyseqs_with_sample(exec_path, output_directory, taxonomy_files, names_
p = os.popen(cmd)
class MothurKrona(Component):
"""
"""
def define_parameters(self, taxonomy_files, names_files=None, groups_files=None):
"""
"""
#define input files
def define_parameters(self, taxonomy_files, names_files=None, groups_files=None):
# define input files
self.taxonomy_files = InputFileList(taxonomy_files, Formats.MOTHUR_TAXONOMY)
if names_files : self.names_files = InputFileList(names_files, Formats.MOTHUR_NAMES)
else : self.names_files = None
if groups_files : self.groups_files = InputFileList(groups_files, Formats.MOTHUR_GROUPS)
else : self.groups_files = None
#define output files
self.krona_files = OutputFileList(self.get_outputs('{basename_woext}.html', self.taxonomy_files), Formats.MOTHUR_KRONA)
# define output files
self.krona_files = OutputFileList(self.get_outputs('{basename_woext}.html', self.taxonomy_files), Formats.HTML)
self.stdout = OutputFileList(self.get_outputs('{basename_woext}.stdout', self.taxonomy_files))
def process(self):
print ">>>Process Krona"
if self.names_files and self.groups_files:
krona = PythonFunction(classifyseqs_with_sample, cmd_format="{EXE} {ARG} {IN} {OUT}")
krona(arguments=[self.get_exec_path("krona"),self.output_directory],inputs=[self.taxonomy_files,self.names_files,self.groups_files],\
krona(arguments=[self.get_exec_path("ImportMothurTaxonomy.pl"),self.output_directory],inputs=[self.taxonomy_files,self.names_files,self.groups_files],\
outputs=[self.krona_files])
else:
krona = ShellFunction(self.get_exec_path("krona") + ' $1 -o $3 > $2', cmd_format='{EXE} {IN} {OUT}')
krona = ShellFunction(self.get_exec_path("ImportMothurTaxonomy.pl") + ' $1 -o $3 > $2', cmd_format='{EXE} {IN} {OUT}')
krona = MultiMap(krona, inputs=[self.taxonomy_files], outputs=[self.stdout,self.krona_files])
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