diff --git a/src/depiction_targeted_preproc/pipeline_config/artifacts_mapping.py b/src/depiction_targeted_preproc/pipeline_config/artifacts_mapping.py index 0708bb1..0fe2521 100644 --- a/src/depiction_targeted_preproc/pipeline_config/artifacts_mapping.py +++ b/src/depiction_targeted_preproc/pipeline_config/artifacts_mapping.py @@ -10,6 +10,7 @@ "qc/plot_marker_presence.pdf", "qc/plot_peak_density_combined.pdf", "qc/plot_peak_density_grouped.pdf", + "qc/plot_peak_counts_per_spectrum.pdf", "qc/plot_peak_counts_per_mass_range.pdf", "qc/plot_scan_direction.pdf", ], @@ -24,7 +25,6 @@ "qc/plot_marker_presence_cv.pdf", # "qc/plot_spectra_for_marker.pdf", # "qc/plot_sample_spectra_before_after.pdf", - "qc/plot_peak_counts.pdf", "cluster_default_kmeans.hdf5", # "cluster_default_stats_kmeans.csv", "cluster_default_kmeans.png", diff --git a/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_mass_range.py b/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_mass_range.py index 684381a..b2c0666 100644 --- a/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_mass_range.py +++ b/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_mass_range.py @@ -10,7 +10,7 @@ from depiction.persistence import ImzmlReadFile from depiction_targeted_preproc.pipeline_config.model import PipelineParameters from depiction_targeted_preproc.workflow.qc.plot_calibration_map import get_mass_groups -from depiction_targeted_preproc.workflow.qc.plot_peak_counts import get_peak_counts +from depiction_targeted_preproc.workflow.qc.plot_peak_counts_per_spectrum import get_peak_counts def qc_plot_peak_counts_per_mass_range( diff --git a/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts.py b/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_spectrum.py similarity index 93% rename from src/depiction_targeted_preproc/workflow/qc/plot_peak_counts.py rename to src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_spectrum.py index 2d715cf..72f7c52 100644 --- a/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts.py +++ b/src/depiction_targeted_preproc/workflow/qc/plot_peak_counts_per_spectrum.py @@ -11,7 +11,7 @@ def get_peak_counts(read_peaks: ImzmlReadFile, mass_groups: pl.DataFrame, n_jobs: int) -> pl.DataFrame: - # TODO parallelize, over all + # TODO parallelize, over all !!!FIXME collect = [] with read_peaks.reader() as reader: for i_spectrum in range(1000): @@ -26,7 +26,7 @@ def get_peak_counts(read_peaks: ImzmlReadFile, mass_groups: pl.DataFrame, n_jobs return pl.DataFrame(collect) -def qc_plot_peak_counts( +def qc_plot_peak_counts_per_spectrum( imzml_peaks: Annotated[Path, Option()], output_pdf: Annotated[Path, Option()], config_path: Annotated[Path, Option()], @@ -49,4 +49,4 @@ def qc_plot_peak_counts( if __name__ == "__main__": - typer.run(qc_plot_peak_counts) + typer.run(qc_plot_peak_counts_per_spectrum) diff --git a/src/depiction_targeted_preproc/workflow/rules/rules_qc.smk b/src/depiction_targeted_preproc/workflow/rules/rules_qc.smk index 41d4d53..15f2a4a 100644 --- a/src/depiction_targeted_preproc/workflow/rules/rules_qc.smk +++ b/src/depiction_targeted_preproc/workflow/rules/rules_qc.smk @@ -127,14 +127,14 @@ rule qc_plot_spectra_for_marker: " --output-pdf {output.pdf}" -rule qc_plot_peak_counts: +rule qc_plot_peak_counts_per_spectrum: input: imzml=multiext("{sample}/corrected.peaks", ".imzML", ".ibd"), config="{sample}/pipeline_params.yml", output: - pdf="{sample}/qc/plot_peak_counts.pdf", + pdf="{sample}/qc/plot_peak_counts_per_spectrum.pdf", shell: - "python -m depiction_targeted_preproc.workflow.qc.plot_peak_counts" + "python -m depiction_targeted_preproc.workflow.qc.plot_peak_counts_per_spectrum" " --config-path {input.config} --imzml-peaks {input.imzml[0]}" " --output-pdf {output.pdf}"