From 13fe4335df882a5c39529f0a3e2b12a71bb97516 Mon Sep 17 00:00:00 2001
From: Venkat Malladi <venkat.malladi@utsouthwestern.edu>
Date: Tue, 3 Oct 2017 16:27:54 -0500
Subject: [PATCH] Update trim_reads to extrapolate the params.

---
 workflow/scripts/trim_reads.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/workflow/scripts/trim_reads.py b/workflow/scripts/trim_reads.py
index 4ab3ffe..4a2d728 100644
--- a/workflow/scripts/trim_reads.py
+++ b/workflow/scripts/trim_reads.py
@@ -8,7 +8,6 @@ import argparse
 import shutil
 import logging
 import sys
-import json
 
 EPILOG = '''
 For more details:
@@ -67,11 +66,13 @@ def trim_reads(fastq, paired):
     '''Run trim_galore on 1 or 2 files.'''
 
     if paired: # paired-end data
-        trim_command = "trim_galore --paired -q 25 --illumina --gzip --length 35 " \
-                    + " ".join(fastq)
+        trim_params = '--paired -q 25 --illumina --gzip --length 35'
+        trim_command = "trim_galore %s %s %s " \
+                    % (trim_params, fastq[0], fastq[1])
     else:
-        trim_command = "trim_galore -q 25 --illumina --gzip --length 35 " \
-                    + " ".join(fastq)
+        trim_params = '-q 25 --illumina --gzip --length 35'
+        trim_command = "trim_galore %s %s " \
+                    % (trim_params, fastq[0])
 
     logger.info("Running trim_galore with %s", trim_command)
 
-- 
GitLab