Commit ec8ddd48 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent c91dd66c
......@@ -51,16 +51,16 @@ class RNAdiversity (Workflow):
else:
chimerauchime = self.add_component("MothurChimeraUchime",kwargs={'fasta_files':precluster.precluster_fasta_files,'names_files':precluster.precluster_names_files,\
'groups_files':screenseqs.good_groups_files})
removeseqs = self.add_component("MothurRemoveSeqs",[chimerauchime.uchime_accnos_files,precluster.precluster_fasta_files,precluster.precluster_names_files,\
screenseqs.good_groups_files])
#removeseqs = self.add_component("MothurRemoveSeqs",[chimerauchime.uchime_accnos_files,precluster.precluster_fasta_files,precluster.precluster_names_files,\
# screenseqs.good_groups_files])
#Analysis MothurClassify
classifyseqs = self.add_component("MothurClassifySeqs",[removeseqs.pick_fasta_files,self.args["template"],self.args["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],{},"classifyseqs")
#classifyseqs = self.add_component("MothurClassifySeqs",[removeseqs.pick_fasta_files,self.args["template"],self.args["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],{},"classifyseqs")
# removegroups = self.add_component("MothurRemoveGroups", [removeseqs.pick_fasta_files,removeseqs.pick_names_files,removeseqs.pick_groups_files,chimerauchime.uchime_accnos_files])
distseqs = self.add_component("MothurDistSeqs", [removeseqs.pick_fasta_files])
cluster = self.add_component("MothurCluster", [distseqs.dist_files,removeseqs.pick_names_files])
makeshared = self.add_component("MothurMakeShared", [cluster.an_list_files,removeseqs.pick_groups_files])
venn = self.add_component("MothurVenn", [makeshared.an_shared_files])
#distseqs = self.add_component("MothurDistSeqs", [removeseqs.pick_fasta_files])
#cluster = self.add_component("MothurCluster", [distseqs.dist_files,removeseqs.pick_names_files])
#makeshared = self.add_component("MothurMakeShared", [cluster.an_list_files,removeseqs.pick_groups_files])
#venn = self.add_component("MothurVenn", [makeshared.an_shared_files])
#classifyotu = self.add_component("MothurClassifyOtu", [cluster.an_list_files,classifyseqs.taxonomy_files,removeseqs.pick_names_files,removeseqs.pick_groups_files])
#krona_classifyotu = self.add_component("MothurKrona", [classifyotu.cons_taxonomy_files],{},"classifyotu")
......@@ -23,9 +23,7 @@ from weaver.function import ShellFunction
class MothurChimeraUchime(Component):
"""
"""
def define_parameters(self, fasta_files, reference_files=None, names_files=None, groups_files=None, processors=1):
"""
Define chimera.uchime component parameters.
......@@ -43,7 +41,7 @@ class MothurChimeraUchime(Component):
self.processors = processors
#define input files
self.fasta_files = InputFileList(fasta_files, Formats.FASTA)
if reference_files : self.reference_files = InputFileList(reference_files)
if reference_files : self.reference_files = InputFile(reference_files)
else : self.reference_files = None
if names_files : self.names_files = InputFileList(names_files, Formats.MOTHUR_NAMES)
else : self.names_files = None
......@@ -55,13 +53,11 @@ class MothurChimeraUchime(Component):
self.stdout = OutputFileList(self.get_outputs('{basename_woext}.stdout', self.fasta_files))
def process(self):
print ">>>Process chimera.uchime"
if self.reference_files:
chimerauchime = ShellFunction(self.get_exec_path("mothur") + ' "#chimera.uchime(fasta=$1,reference=$2,outputdir='+self.output_directory+\
'/,processors='+str(self.processors)+')" > $3', cmd_format='{EXE} {IN} {OUT}')
chimerauchime = MultiMap(chimerauchime, inputs=[self.fasta_files,self.reference_files], \
outputs=[self.stdout,self.uchime_chimera_files,self.uchime_accnos_files])
elif self.names_files and not self.groups_files:
chimerauchime = ShellFunction(self.get_exec_path("mothur") + ' "#chimera.uchime(fasta=$1,name=$2,outputdir='+self.output_directory+\
'/,processors='+str(self.processors)+')" > $3', cmd_format='{EXE} {IN} {OUT}')
......
......@@ -23,14 +23,12 @@ from weaver.function import ShellFunction
class MothurRemoveSeqs(Component):
"""
"""
def define_parameters(self, uchime_accnos_files, fasta_files, names_files=None, groups_files=None, dups="T"):
def define_parameters(self, accnos_files, fasta_files, names_files=None, groups_files=None, dups="T"):
"""
Define remove.seqs component parameters.
:param uchime_accnos_files: uchine accnos files to process
:type uchime_accnos_files: str
:param accnos_files: uchine accnos files to process
:type accnos_files: str
:param fasta_files: fasta files to process
:type fasta_files: str
:param names_files: names files to process
......@@ -40,17 +38,16 @@ class MothurRemoveSeqs(Component):
:param dups: if any sequence in a specific line of the names file is in your .accnos file all sequences in that line will be removed
:type puds: string
"""
#define parameters
# define parameters
self.dups = dups
#define input files
self.uchime_accnos_files = InputFileList(uchime_accnos_files, Formats.MOTHUR_ACCNOS)
# define input files
self.accnos_files = InputFileList(accnos_files, Formats.MOTHUR_ACCNOS)
self.fasta_files = InputFileList(fasta_files, Formats.FASTA)
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
# define output files
self.pick_fasta_files = OutputFileList(self.get_outputs('{basename_woext}.pick.fasta', self.fasta_files), Formats.FASTA)
if names_files :
self.pick_names_files = OutputFileList(self.get_outputs('{basename_woext}.pick.names', self.fasta_files), Formats.MOTHUR_NAMES)
......@@ -59,18 +56,17 @@ class MothurRemoveSeqs(Component):
self.stdout = OutputFileList(self.get_outputs('{basename_woext}.stdout', self.fasta_files))
def process(self):
print ">>>Process remove.seqs"
if self.names_files and self.groups_files:
removeseqs = ShellFunction(self.get_exec_path("mothur") + ' "#remove.seqs(accnos=$1,fasta=$2,name=$3,group=$4,dups='+self.dups+',outputdir='+self.output_directory+\
'/)" > $5',cmd_format='{EXE} {IN} {OUT}')
removeseqs = MultiMap(removeseqs, inputs=[self.uchime_accnos_files,self.fasta_files,self.names_files,self.groups_files],\
removeseqs = MultiMap(removeseqs, inputs=[self.accnos_files,self.fasta_files,self.names_files,self.groups_files],\
outputs=[self.stdout,self.pick_names_files,self.pick_fasta_files,self.pick_groups_files])
elif self.names_files and not self.groups_files:
removeseqs = ShellFunction(self.get_exec_path("mothur") + ' "#remove.seqs(accnos=$1,fasta=$2,name=$3,dups='+self.dups+',outputdir='+self.output_directory+\
'/)" > $4',cmd_format='{EXE} {IN} {OUT}')
removeseqs = MultiMap(removeseqs, inputs=[self.uchime_accnos_files,self.fasta_files,self.names_files],\
removeseqs = MultiMap(removeseqs, inputs=[self.accnos_files,self.fasta_files,self.names_files],\
outputs=[self.stdout,self.pick_fasta_files,self.pick_names_files])
else:
removeseqs = ShellFunction(self.get_exec_path("mothur") + ' "#remove.seqs(accnos=$1,fasta=$2,dups='+self.dups+',outputdir='+self.output_directory+\
'/)" > $3',cmd_format='{EXE} {IN} {OUT}')
removeseqs = MultiMap(removeseqs, inputs=[self.uchime_accnos_files,self.fasta_files],outputs=[self.stdout,self.pick_fasta_files])
\ No newline at end of file
removeseqs = MultiMap(removeseqs, inputs=[self.accnos_files,self.fasta_files],outputs=[self.stdout,self.pick_fasta_files])
\ No newline at end of file
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