From 9347dd26c47d8eeb586bbe9023c06983a462ac3a Mon Sep 17 00:00:00 2001 From: Sabrina Yan <9669990+violetbrina@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:33:51 +1100 Subject: [PATCH] test(filter_evens.py,cpg_flow_test/stages.py): print inputs --- cpg_flow_test/jobs/filter_evens.py | 4 ++++ cpg_flow_test/stages.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cpg_flow_test/jobs/filter_evens.py b/cpg_flow_test/jobs/filter_evens.py index d8104e2..c4ee400 100644 --- a/cpg_flow_test/jobs/filter_evens.py +++ b/cpg_flow_test/jobs/filter_evens.py @@ -1,5 +1,6 @@ from typing import Any +from cpg_flow.stage import Stage, StageInput from cpg_flow.targets.sequencing_group import SequencingGroup from hailtop.batch import Batch from hailtop.batch.job import Job @@ -7,6 +8,8 @@ def filter_evens( b: Batch, + inputs: StageInput, + previous_stage: Stage, sequencing_groups: list[SequencingGroup], input_files: dict[str, dict[str, Any]], sg_outputs: dict[str, dict[str, Any]], @@ -20,6 +23,7 @@ def filter_evens( for sg in sequencing_groups: # type: ignore job = b.new_job(name=title + ': ' + sg.id) input_file_path = input_files[sg.id]['cumulative'] + input_file_path = inputs.as_path(sg, previous_stage, 'cumulative') no_evens_input_file = b.read_input(input_file_path) no_evens_output_file_path = str(sg_outputs[sg.id]) sg_output_files.append(no_evens_output_file_path) diff --git a/cpg_flow_test/stages.py b/cpg_flow_test/stages.py index c7f8e48..e408f77 100644 --- a/cpg_flow_test/stages.py +++ b/cpg_flow_test/stages.py @@ -117,9 +117,14 @@ def queue_jobs(self, cohort: Cohort, inputs: StageInput) -> StageOutput | None: input_files = inputs.as_dict_by_target(CumulativeCalc) b = get_batch() + print('-----INPUTS-----') + print(inputs) + sg_outputs = self.expected_outputs(cohort) no_evens_output_path = str(sg_outputs['no_evens']) - job_no_evens = filter_evens(b, cohort.get_sequencing_groups(), input_files, sg_outputs, no_evens_output_path) + job_no_evens = filter_evens( + b, inputs, CumulativeCalc, cohort.get_sequencing_groups(), input_files, sg_outputs, no_evens_output_path, + ) jobs = [job_no_evens]