Skip to content

Commit

Permalink
Updated to recent changes in metapool
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cowart committed Nov 4, 2024
1 parent 45131f1 commit 4665ee8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 35 deletions.
8 changes: 4 additions & 4 deletions sequence_processing_pipeline/Pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ def __init__(self, configuration_file_path, run_id, input_file_path,
# Optional lane_number parameter is ignored for Amplicon
# runs, as the only valid value is 1.
else:
# assume user_input_file_path references a sample-sheet.
self.sample_sheet = self._validate_sample_sheet(input_file_path)
self.mapping_file = None

if lane_number is not None:
# confirm that the lane_number is a reasonable value.
lane_number = int(lane_number)
Expand All @@ -270,6 +266,10 @@ def __init__(self, configuration_file_path, run_id, input_file_path,
# with overwritten Lane number.
set_lane_number_in_sheet(input_file_path, lane_number)

# assume user_input_file_path references a sample-sheet.
self.sample_sheet = self._validate_sample_sheet(input_file_path)
self.mapping_file = None

self._configure_profile()

def get_software_configuration(self, software):
Expand Down
6 changes: 4 additions & 2 deletions sequence_processing_pipeline/TellReadJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class TellReadJob(Job):
def __init__(self, run_dir, output_path, sample_sheet_path, queue_name,
node_count, wall_time_limit, jmem, modules_to_load,
qiita_job_id, label, reference_base,
reference_map, tmp1_path, sing_script_path, lane,
cores_per_task):
reference_map, tmp1_path, sing_script_path, cores_per_task):
"""
ConvertJob provides a convenient way to run bcl-convert or bcl2fastq
on a directory BCL files to generate Fastq files.
Expand Down Expand Up @@ -61,6 +60,9 @@ def __init__(self, run_dir, output_path, sample_sheet_path, queue_name,
self.sing_script_path = sing_script_path
self.tmp1_path = tmp1_path

sheet = load_sample_sheet(self.sample_sheet_path)
lane = sheet.samples[0].Lane

# force self.lane_number to be int. raise an Error if it's not.
tmp = int(lane)
if tmp < 1 or tmp > 8:
Expand Down
30 changes: 1 addition & 29 deletions sequence_processing_pipeline/tests/test_TellReadJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,13 @@ def setUp(self):
self.cores_per_task = "4"

def test_creation(self):
# confirm only sensible lane numbers are allowed.
with self.assertRaisesRegex(ValueError,
"'-1' is not a valid lane number"):
TellReadJob(self.run_dir, self.output_path, self.sample_sheet_path,
self.queue_name, self.node_count, self.wall_time_limit,
self.jmem, self.modules_to_load, self.qiita_job_id,
self.label, self.reference_base, self.reference_map,
self.tmp1_path, self.sing_script_path, -1,
self.cores_per_task)

with self.assertRaisesRegex(ValueError,
"'0' is not a valid lane number"):
TellReadJob(self.run_dir, self.output_path, self.sample_sheet_path,
self.queue_name, self.node_count, self.wall_time_limit,
self.jmem, self.modules_to_load, self.qiita_job_id,
self.label, self.reference_base, self.reference_map,
self.tmp1_path, self.sing_script_path, 0,
self.cores_per_task)

with self.assertRaisesRegex(ValueError,
"'9' is not a valid lane number"):
TellReadJob(self.run_dir, self.output_path, self.sample_sheet_path,
self.queue_name, self.node_count, self.wall_time_limit,
self.jmem, self.modules_to_load, self.qiita_job_id,
self.label, self.reference_base, self.reference_map,
self.tmp1_path, self.sing_script_path, 9,
self.cores_per_task)

# test basic good-path
job = TellReadJob(self.run_dir, self.output_path,
self.sample_sheet_path, self.queue_name,
self.node_count, self.wall_time_limit,
self.jmem, self.modules_to_load, self.qiita_job_id,
self.label, self.reference_base, self.reference_map,
self.tmp1_path, self.sing_script_path, self.lane,
self.tmp1_path, self.sing_script_path,
self.cores_per_task)

job._generate_job_script()
Expand Down

0 comments on commit 4665ee8

Please sign in to comment.