Commit ee86313a authored by Maria Bernard's avatar Maria Bernard
Browse files

probleme lorsqu'input ustack vide ou avec peu de données, le clustering ne...

probleme lorsqu'input ustack vide ou avec peu de données, le clustering ne fonctionne pas et ustacks ne crée pas de fichiers de sorties.
parent b1116c43
......@@ -48,7 +48,8 @@ class Ustacks (Analysis):
self.alleles = OutputFileList(self.get_outputs('{basename_woext}.alleles.tsv', self.read1_files))
self.snps = OutputFileList(self.get_outputs('{basename_woext}.snps.tsv', self.read1_files))
self.stderrs = OutputFileList(self.get_outputs('{basename_woext}.stderrs', self.read1_files))
print self.tags, self.alleles, self.snps
def define_analysis(self):
self.name = "ustacks"
self.description = "Locus prediction per individus"
......@@ -75,12 +76,15 @@ class Ustacks (Analysis):
def process(self):
for idx, input in enumerate(self.read1_files):
parts = os.path.splitext(os.path.basename(input))
indiv = parts [0]
indiv = parts[0]
if parts[1] == ".gz" :
indiv = os.path.splitext(parts[0])
indiv = re.sub( r'_1$', '', indiv)
individ = self.indiv_dic[indiv]["id"]
format = "fastq" if os.path.splitext(os.path.basename(input))[1] != ".gz" else "gzfastq"
#tmp_function=ShellFunction("echo $1 >$2", cmd_format='{IN} {OUT}')
#tmp_function(inputs = input, outputs = [self.tags[idx]])
ustacks = ShellFunction(self.get_exec_path("ustacks") + " -t " + format + " -f $1 -d -r -o " + self.output_directory + " -i " + str(individ) +
" -m " + str(self.min_cov) + " -M " + str(self.primary_mismatch) + " -N " + str(self.secondary_mismatch) +
" 2> $2", cmd_format='{EXE} {IN} {OUT}')
......
Markdown is supported
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