Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Jun 19, 2024
1 parent cbc42bc commit ee716b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# TODO configure shifts


class SyntheticMSIDataGenerator:
"""Helper that creates synthetic MSI data."""

Expand Down
4 changes: 2 additions & 2 deletions src/depiction_targeted_preproc/pipeline_config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class SimulateParameters(Model):
image_height: int = 100
n_labels: int = 30
bin_width_ppm: float = 100.0
target_mass_min: float = 850.
target_mass_max: float = 1900.
target_mass_min: float = 850.0
target_mass_max: float = 1900.0


class PipelineArtifact(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def qc_plot_calibration_map(

vis_shifts = VisualizeMassShiftMap(models=models, coordinates=coords_2d)
# TODO fix same_scale
fig, axs = vis_shifts.plot_test_mass_maps_and_histograms(test_masses=test_masses, same_scale=True, int_limits=(-.25, .25))
fig, axs = vis_shifts.plot_test_mass_maps_and_histograms(
test_masses=test_masses, same_scale=True, int_limits=(-0.25, 0.25)
)
fig.savefig(output_pdf)
fig.clear()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def qc_plot_calibration_map_v2(
fig, axs = plt.subplots(2, 1, figsize=(10, 20))

# show the map
mass_shifts.isel(c=0).plot.imshow(x="x", y="y", ax=axs[0], cmap="coolwarm", vmin=-0.5, vmax=+.5)
mass_shifts.isel(c=0).plot.imshow(x="x", y="y", ax=axs[0], cmap="coolwarm", vmin=-0.5, vmax=+0.5)
axs[0].set_aspect("equal")
test_mass = mass_shifts.coords["c"][0]
axs[0].set_title(f"Computed shift for test mass {test_mass:.2f}")

# show the histogram
# TODO the clipping could be misleading (as it's not indicated)
mass_shifts.isel(c=0).clip(-.5, .5).plot.hist(ax=axs[1], bins=100, color="gray")
mass_shifts.isel(c=0).clip(-0.5, 0.5).plot.hist(ax=axs[1], bins=100, color="gray")
axs[1].set_title("Histogram of computed shifts")

plt.savefig(output_pdf, bbox_inches="tight")
Expand Down

0 comments on commit ee716b2

Please sign in to comment.