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

add new components

parent 860a14ad
......@@ -53,24 +53,29 @@ class RNAdiversity (Workflow):
'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])
# 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")
# OTUs approach
distseqs = self.add_component("MothurDistSeqs", [removeseqs.pick_fasta_files])
cluster = self.add_component("MothurCluster", [distseqs.dist_files,removeseqs.pick_names_files])
# manque le sub sample avec le count pour normaliser les OTUs
# makeshared = self.add_component("MothurMakeShared", [cluster.an_list_files,removeseqs.pick_groups_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")
# Alpha diversity analysis
# manque le summary.single
# manque le rarefaction.single
# Beta diversity analysis
# treeshared = self.add_component("MothurTreeShared", [makeshared.an_shared_files])
# 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")
# OTUs approach
distseqs = self.add_component("MothurDistSeqs", [removeseqs.pick_fasta_files])
cluster = self.add_component("MothurCluster", [distseqs.dist_files,removeseqs.pick_names_files])
# manque le sub sample avec le count pour normaliser les OTUs
makeshared = self.add_component("MothurMakeShared", [cluster.an_list_files,removeseqs.pick_groups_files])
# countseqs = self.add_component("MothurCountSeqs", [removeseqs.pick_names_files,removeseqs.pick_groups_files])
# subsample = self.add_component("MothurSubSample", kwargs={'fasta_files':fasta,'count_seqs_files':countseqs.count_seqs_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")
# # Alpha diversity analysis
# # manque le summary.single apres un makeshared
summarysingle = self.add_component("MothurSummarySingle", [makeshared.an_shared_files])
# # manque le rarefaction.single apres makeshared
rarefactionsingle = self.add_component("MothurRarefactionSingle", [makeshared.an_shared_files])
# # Beta diversity analysis
treeshared = self.add_component("MothurTreeShared", [makeshared.an_shared_files])
# pour l'analyse d'OTU peut etre mettre en place direct EspritTree
\ No newline at end of file
from jflow.component import Component
from jflow.iotypes import OutputFile, OutputFileList, InputFile, InputFileList, Formats
from jflow.abstraction import MultiMap
from weaver.function import ShellFunction
class MothurRarefactionSingle(Component):
def define_parameters(self, shared_files, label="unique-0.10-0.05-0.03", freq=100):
"""
:param shared_files: shared files to process
:type shared_files: str
:param label :
:type label : st
:param freq :
:type freq : int
"""
#define parameters
self.label = label
self.freq = freq
#define input files
self.shared_files = InputFileList(shared_files)
#define output files
self.rarefaction_single_files = OutputFileList(self.get_outputs('{basename_woext}.groups.rarefaction', self.shared_files))
self.stdout = OutputFileList(self.get_outputs('{basename_woext}.stdout', self.shared_files))
def process(self):
print ">>>Process rarefaction.single"
treeshared = ShellFunction(self.get_exec_path("mothur") + ' "#rarefaction.single(shared=$1,label='+self.label+',freq='+str(self.freq)+',outputdir='+self.output_directory+'/)\
" > $2',cmd_format='{EXE} {IN} {OUT}')
treeshared = MultiMap(treeshared, inputs=[self.shared_files], outputs=[self.stdout,self.rarefaction_single_files])
\ No newline at end of file
from jflow.component import Component
from jflow.iotypes import OutputFile, OutputFileList, InputFile, InputFileList, Formats
from jflow.abstraction import MultiMap
from weaver.function import ShellFunction
class MothurSummarySingle(Component):
def define_parameters(self, shared_files, calc="simpson-npshannon-shannon-jack-ace-chao", label="unique-0.10-0.05-0.03"):
"""
:param shared_files: shared files to process
:type shared_files: str
:param calc :
:type calc : str
:param label :
:type label : st
"""
#define parameters
self.calc = calc
self.label = label
#define input files
self.shared_files = InputFileList(shared_files)
#define output files
self.summary_single_files = OutputFileList(self.get_outputs('{basename_woext}.groups.summary', self.shared_files))
self.stdout = OutputFileList(self.get_outputs('{basename_woext}.stdout', self.shared_files))
def process(self):
print ">>>Process summary.single"
treeshared = ShellFunction(self.get_exec_path("mothur") + ' "#summary.single(shared=$1,calc='+self.calc+',label='+self.label+',outputdir='+self.output_directory+'/)" > $2',\
cmd_format='{EXE} {IN} {OUT}')
treeshared = MultiMap(treeshared, inputs=[self.shared_files], outputs=[self.stdout,self.summary_single_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