Skip to content

Commit

Permalink
Merge pull request #24 from flatironinstitute/iss18_notebook_plots
Browse files Browse the repository at this point in the history
Iss18 notebook plots
  • Loading branch information
geoffwoollard authored Jun 26, 2024
2 parents 6a00320 + a71457e commit ff0d571
Show file tree
Hide file tree
Showing 4 changed files with 596 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config_files/config_plotting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gt_metadata: path/to/metadata.csv

map2map_results:
- path/to/map2map_results_1.pkl
- path/to/map2map_results_2.pkl

dist2dist_results:
pkl_fnames:
- path/to/dist2dist_results_1.pkl
- path/to/dist2dist_results_2.pkl
pkl_globs:
- string/path/with/wildcards/and/regex/filestem*_field1[0-9].pkl
- string/path/with/wildcards/and/regex/filestem*_field1[0-9]_field2[0-9].pkl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
)


def sort_by_transport(cost):
m,n = cost.shape
_, transport = compute_wasserstein_between_distributions_from_weights_and_cost(np.ones(m) / m, np.ones(n)/n, cost)
indices = np.argsort((transport * np.arange(m)[...,None]).sum(0))
return cost[:,indices], indices, transport


def compute_wasserstein_between_distributions_from_weights_and_cost(
weights_a, weights_b, cost, numItermax=1000000
):
Expand Down
6 changes: 6 additions & 0 deletions src/cryo_challenge/_ploting/plotting_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import numpy as np

def res_at_fsc_threshold(fscs, threshold=0.5):
res_fsc_half = np.argmin(fscs > threshold, axis=-1)
fraction_nyquist = 0.5*res_fsc_half / fscs.shape[-1]
return res_fsc_half, fraction_nyquist
570 changes: 570 additions & 0 deletions tutorials/5_tutorial_plotting.ipynb

Large diffs are not rendered by default.

0 comments on commit ff0d571

Please sign in to comment.