From 08ad143dbec84496e915d4133e40db7e41cbc595 Mon Sep 17 00:00:00 2001 From: Migun Shakya Date: Mon, 10 Jul 2017 15:12:23 -0600 Subject: [PATCH] updating the path so that scripts/ is ahead --- pypiret/Runs/Map.py | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/pypiret/Runs/Map.py b/pypiret/Runs/Map.py index 74072ad..550fd09 100644 --- a/pypiret/Runs/Map.py +++ b/pypiret/Runs/Map.py @@ -14,7 +14,7 @@ from luigi.util import inherits, requires import subprocess from pypiret import FastQC -from plumbum.cmd import touch, bamtools +from plumbum.cmd import touch, bamtools, hisat2 # from Bio import SeqIO @@ -186,11 +186,11 @@ def program_args(self): def program_environment(self): """Environmental variables for this program.""" - return {'PATH': os.environ["PATH"] + ":" + self.bindir + "../scripts"} + return {'PATH': + self.bindir + "../scripts" + ":" + os.environ["PATH"]} # @inherits(FastQC.PairedRunQC) -class Hisat(ExternalProgramTask): +class Hisat(luigi.Task): """Mapping the QCed sequences to reference.""" fastq1 = Parameter() @@ -222,27 +222,29 @@ def output(self): """SAM file output of the mapping.""" return LocalTarget(self.outsam) - def program_args(self): + def run(self): """Run hisat2.""" if self.spliceFile is "": - return ["hisat2", - "-p", self.numCPUs, - "-x", self.indexfile, - "-1", self.fastq1, - "-2", self.fastq2, - "-S", self.outsam, - "--un-conc", self.unalned, - "2>", self.mappingLogFile] + hisat2_nosplice_option = ["-p", self.numCPUs, + "-x", self.indexfile, + "-1", self.fastq1, + "-2", self.fastq2, + "-S", self.outsam, + "--un-conc", self.unalned, + "2>", self.mappingLogFile] + hisat2_cmd = hisat2[hisat2_nosplice_option] + hisat2_cmd() else: - return ["hisat2", - "--known-splicesite-infile", self.spliceFile, - "-p", self.numCPUs, - "-x", self.indexfile, - "-1", self.fastq1, - "-2", self.fastq2, - "-S", self.outsam, - "--un-conc", self.unalned, - "2>", self.mappingLogFile] + hisat2_splice_option = ["--known-splicesite-infile", self.spliceFile, + "-p", self.numCPUs, + "-x", self.indexfile, + "-1", self.fastq1, + "-2", self.fastq2, + "-S", self.outsam, + "--un-conc", self.unalned, + "2>", self.mappingLogFile] + hisat2_cmd = hisat2[hisat2_splice_option] + hisat2_cmd() @inherits(FastQC.RunAllQC)