Skip to content

Commit

Permalink
Merge pull request #272 from mjo22/211-starfile-writer
Browse files Browse the repository at this point in the history
Small bug in how the name of the mrcs was defined inside the starfiles
  • Loading branch information
mjo22 authored Sep 20, 2024
2 parents f1b8df8 + 3367a4a commit a94b121
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cryojax/data/_relion/_starfile_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,19 @@ def write_starfile_with_particle_parameters(
n_batches = n_images // mrc_batch_size
n_remainder = n_images % mrc_batch_size

relative_mrcs_path_prefix = str(filename).split(".")[0]
image_names = []

for step in range(n_batches):
mrc_filename = _get_filename(step, n_char=6)
mrc_relative_path = relative_mrcs_path_prefix + mrc_filename + ".mrcs"
mrc_relative_path = mrc_filename + ".mrcs"
image_names += [
_get_filename(i + 1, n_char=6) + "@" + mrc_relative_path
for i in range(mrc_batch_size)
]

if n_remainder > 0:
mrc_filename = _get_filename(n_batches, n_char=6)
mrc_relative_path = relative_mrcs_path_prefix + mrc_filename + ".mrcs"
mrc_relative_path = mrc_filename + ".mrcs"
image_names += [
_get_filename(i + 1, n_char=6) + "@" + mrc_relative_path
for i in range(n_remainder)
Expand Down

0 comments on commit a94b121

Please sign in to comment.