Skip to content

Commit

Permalink
rename the old plot too
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Jun 28, 2024
1 parent 7f56bdb commit 877e483
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()],
Expand All @@ -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)
6 changes: 3 additions & 3 deletions src/depiction_targeted_preproc/workflow/rules/rules_qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit 877e483

Please sign in to comment.