Commit 4b3ee261 authored by Penom Nom's avatar Penom Nom
Browse files

maj screenseqs

parent bb725773
......@@ -21,13 +21,19 @@ from jflow.abstraction import MultiMap
from weaver.function import PythonFunction, ShellFunction
def screen_seqs(*files):
def screen_seqs(exec_path, output_directory, processors, criteria,*files):
import os
exec_path = files[-4]
output_directory = files[-3]
processors = files[-2]
criteria = files[-1]
# exec_path = files[-4]
# output_directory = files[-3]
# processors = files[-2]
# criteria = files[-1]
# define files
print ">>>>>>>>>>>>>>>>"
print exec_path
print output_directory
print processors
print criteria
print files
log_summary_files = files[0]
align_path = files[1]
......@@ -36,13 +42,13 @@ def screen_seqs(*files):
if line.startswith(str(criteria)+"%-tile:"):
start, end = line.split()[1:3]
# if names files and groups files are True
if len (files[:-4]) == 8:
if len (files) == 8:
trim_names_path = files [2]
groups_path = files [3]
cmd = str(exec_path)+' "#screen.seqs(fasta='+str(align_path)+',name='+str(trim_names_path)+',group='+str(groups_path)+',outputdir='+str(output_directory)+'/,start='+str(start)+\
',end='+str(end)+',processors='+str(processors)+')"'
# if names files is True but without groups files
elif len(files[:-4]) == 6:
elif len(files) == 6:
trim_names_path = files [2]
cmd = str(exec_path)+' "#screen.seqs(fasta='+str(align_path)+',name='+str(trim_names_path)+',outputdir='+str(output_directory)+'/,start='+str(start)+\
',end='+str(end)+',processors='+str(processors)+')"'
......@@ -99,5 +105,5 @@ class MothurScreenSeqs(Component):
inputs_filter = [input for input in [self.log, self.align_files, self.names_files, self.groups_files] if input is not None]
outputs_filter = [output for output in [self.good_align_files,self.bad_accnos_files,self.good_names_files, self.good_groups_files] if output is not None]
ARG = " ".join([str(x) for x in [self.get_exec_path("mothur"),self.output_directory,self.processors,self.criteria]])
screenseqs = PythonFunction(screen_seqs,cmd_format='{EXE} {IN} {OUT} '+ARG)
screenseqs = PythonFunction(screen_seqs,cmd_format="{EXE} " + ARG + " {IN} {OUT}")
screenseqs = MultiMap(screenseqs,inputs=inputs_filter,outputs=outputs_filter)
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