Skip to content

Commit dea4fd9

Browse files
committed
fix demux_just_fwd params
1 parent 27f49d1 commit dea4fd9

File tree

3 files changed

+38
-41
lines changed

3 files changed

+38
-41
lines changed

src/sequence_processing_pipeline/Commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ def cli():
206206
@click.option('--output', type=click.Path(exists=True), required=True)
207207
@click.option('--task', type=int, required=True)
208208
@click.option('--maxtask', type=int, required=True)
209-
def demux_just_fwd(id_map_fp, fp_fp, out_d, task, maxtask):
210-
with open(id_map_fp, 'r') as f:
209+
def demux_just_fwd(id_map, infile, output, task, maxtask):
210+
with open(id_map, 'r') as f:
211211
id_map = f.readlines()
212212
id_map = [line.strip().split('\t') for line in id_map]
213213

214214
# fp needs to be an open file handle.
215215
# ensure task and maxtask are proper ints when coming from cmd-line.
216-
with open(fp_fp, 'r') as fp:
217-
demux_just_fwd_processing(id_map, fp, out_d, int(task), int(maxtask))
216+
with open(infile, 'r') as fp:
217+
demux_just_fwd_processing(id_map, fp, output, int(task), int(maxtask))
218218

219219

220220
def demux_just_fwd_processing(id_map, fp, out_d, task, maxtask):

src/sequence_processing_pipeline/Pipeline.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,6 @@ def _configure_profile(self):
445445
f"{self.assay_type}) was not found. Please notify"
446446
" an administrator")
447447

448-
print(f'Profile selected: {selected_profile}')
449-
450448
self.config_profile = selected_profile
451449

452450
def _directory_check(self, directory_path, create=False):

tests/test_PacBioWorflow.py

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
from unittest import main
1010
from os import makedirs
1111
from os.path import dirname, abspath, join, exists
12-
from metapool.sample_sheet import (PROTOCOL_NAME_PACBIO_SMRT)
13-
from qp_klp.Assays import ASSAY_NAME_METAGENOMIC
12+
from shutil import copyfile
1413
from shutil import rmtree
1514
from pathlib import Path
16-
from qiita_client.testing import PluginTestCase
17-
from sequence_processing_pipeline.PipelineError import PipelineError
1815
import pandas as pd
16+
from metapool.sample_sheet import (PROTOCOL_NAME_PACBIO_SMRT)
17+
from sequence_processing_pipeline.PipelineError import PipelineError
18+
from qp_klp.Assays import ASSAY_NAME_METAGENOMIC
19+
from qiita_client.testing import PluginTestCase
1920

2021

2122
class WorkflowFactoryTests(PluginTestCase):
@@ -49,23 +50,22 @@ def _inject_data(self, wf):
4950
makedirs(convert_dir, exist_ok=True)
5051
makedirs(reports_dir, exist_ok=True)
5152
Path(f'{convert_dir}/job_completed').touch()
52-
# tellread_dir = f'{self.output_dir}/TellReadJob'
53-
# nuqc_dir = f'{self.output_dir}/NuQCJob'
54-
# fastqc_dir = f'{self.output_dir}/FastQCJob/logs/'
55-
# multiqc_dir = f'{self.output_dir}/MultiQCJob/logs/'
56-
# genprep_dir = (f'{self.output_dir}/GenPrepFileJob/'
57-
# '211021_A00000_0000_SAMPLE/')
58-
# makedirs(nuqc_dir, exist_ok=True)
59-
# makedirs(fastqc_dir, exist_ok=True)
60-
# makedirs(multiqc_dir, exist_ok=True)
61-
# makedirs(genprep_dir, exist_ok=True)
62-
# # now let's create the required project folders
63-
# for project in wf.pipeline.get_project_info():
64-
# sp = project['project_name']
65-
# makedirs(f'{convert_dir}/{sp}', exist_ok=True)
66-
# makedirs(f'{nuqc_dir}/filtered_sequences/{sp}', exist_ok=True)
67-
# makedirs(f'{genprep_dir}/{sp}/filtered_sequences/',
68-
# exist_ok=True)
53+
nuqc_dir = f'{self.output_dir}/NuQCJob'
54+
fastqc_dir = f'{self.output_dir}/FastQCJob/logs/'
55+
multiqc_dir = f'{self.output_dir}/MultiQCJob/logs/'
56+
genprep_dir = (f'{self.output_dir}/GenPrepFileJob/'
57+
'211021_A00000_0000_SAMPLE/')
58+
makedirs(nuqc_dir, exist_ok=True)
59+
makedirs(fastqc_dir, exist_ok=True)
60+
makedirs(multiqc_dir, exist_ok=True)
61+
makedirs(genprep_dir, exist_ok=True)
62+
# now let's create the required project folders
63+
for project in wf.pipeline.get_project_info():
64+
sp = project['project_name']
65+
makedirs(f'{convert_dir}/{sp}', exist_ok=True)
66+
makedirs(f'{nuqc_dir}/filtered_sequences/{sp}', exist_ok=True)
67+
makedirs(f'{genprep_dir}/{sp}/filtered_sequences/',
68+
exist_ok=True)
6969

7070
# # then loop over samples and stage all fastq.gz files
7171
dstats = []
@@ -74,28 +74,25 @@ def _inject_data(self, wf):
7474
sp = sample["Sample_Project"]
7575
dstats.append({'SampleID': sn, '# Reads': 2})
7676
dname = f'{convert_dir}/{sp}'
77-
makedirs(dname, exist_ok=True)
7877
Path(f'{dname}/{sn}_R1.fastq.gz').touch()
7978
with open(f'{dname}/{sn}_R1.counts.txt', 'w') as f:
8079
f.write("2")
8180

82-
# # NuQCJob
83-
# dname = f'{nuqc_dir}/filtered_sequences/{sp}'
84-
# copyfile(self.gz_source, f'{dname}/{rp}_L001_R1_001.fastq.gz')
85-
# copyfile(self.gz_source, f'{dname}/{rp}_L001_R2_001.fastq.gz')
81+
# NuQCJob
82+
dname = f'{nuqc_dir}/filtered_sequences/{sp}'
83+
copyfile(self.gz_source, f'{dname}/{sn}_R1.fastq.gz')
8684

87-
# # GenPrepFileJob
88-
# gprep_base = f'{genprep_dir}/{sp}/filtered_sequences/{rp}'
89-
# Path(f'{gprep_base}_L001_R1_001.fastq.gz').touch()
90-
# Path(f'{gprep_base}_L001_R2_001.fastq.gz').touch()
85+
# GenPrepFileJob
86+
gprep_base = f'{genprep_dir}/{sp}/filtered_sequences/{sn}'
87+
Path(f'{gprep_base}_R1.fastq.gz').touch()
9188

9289
pd.DataFrame(dstats).set_index('SampleID').to_csv(
9390
f'{reports_dir}/Demultiplex_Stats.csv')
9491

95-
# # generating the "*.completed" files
96-
# for i in range(len(samples)*3):
97-
# Path(f'{fastqc_dir}/FastQCJob_{i}.completed').touch()
98-
# Path(f'{multiqc_dir}/MultiQCJob_{i}.completed').touch()
92+
# generating the "*.completed" files
93+
for i in range(len(samples)*3):
94+
Path(f'{fastqc_dir}/FastQCJob_{i}.completed').touch()
95+
Path(f'{multiqc_dir}/MultiQCJob_{i}.completed').touch()
9996

10097
def test_pacbio_metagenomic_workflow_creation(self):
10198
kwargs = {"uif_path": "tests/data/sample-sheets/metagenomic/"
@@ -118,7 +115,9 @@ def test_pacbio_metagenomic_workflow_creation(self):
118115
self.assertEqual(wf.assay_type, ASSAY_NAME_METAGENOMIC)
119116

120117
self._inject_data(wf)
121-
# ConvertJob/ConvertJob.sh
118+
119+
# we can add some checks/tests of the initial scripts (mainly Convert)
120+
# but not doing now as is not required
122121

123122
# Metagenomic is a valid data type in the default qiita test
124123
# database but job-id: 78901 doesn't exist; however, if we get

0 commit comments

Comments
 (0)