Skip to content

Commit 5682d7b

Browse files
author
Tobias Andermann
committed
added cores flag to quality_check function
1 parent b345b74 commit 5682d7b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

secapr/quality_check.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ def add_arguments(parser):
3131
default=None,
3232
help='The directory containing fastq files'
3333
)
34+
parser.add_argument(
35+
'--cores',
36+
type=int,
37+
default=1,
38+
help='Number of computational cores for parallelization of computation.'
39+
)
3440
parser.add_argument(
3541
'--output',
3642
required=True,
@@ -114,9 +120,9 @@ def plot_fastqc_results(fastqc_out_folder):
114120
def main(args):
115121
# Set working directory
116122
out_folder = args.output
123+
cores = args.cores
117124
if not os.path.exists(out_folder):
118125
os.makedirs(out_folder)
119-
120126
# Get list of all fastq-files
121127
input_folder = args.input
122128
matches = []
@@ -134,7 +140,7 @@ def main(args):
134140

135141
# run FASTQC
136142
fastqc_cmd = [
137-
'fastqc -o %s -f fastq $(cat %s)' %(out_folder,fastq_list_path)
143+
'fastqc -t %i -o %s -f fastq $(cat %s)' %(cores,out_folder,fastq_list_path)
138144
]
139145
with open(os.path.join(out_folder, "fastqc_screen_out.txt"), 'w') as log_err_file:
140146
p = subprocess.Popen(fastqc_cmd, stdout=log_err_file, stderr=log_err_file, shell=True)

0 commit comments

Comments
 (0)