Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relion5 compat #220

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/pytom_tm/entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,9 @@ def extract_candidates(argv=None):

# write out as a RELION type starfile
starfile.write(
df, job.output_dir.joinpath(f"{job.tomo_id}_particles.star"), overwrite=True
{"particles": df},
job.output_dir.joinpath(f"{job.tomo_id}_particles.star"),
overwrite=True,
)


Expand Down Expand Up @@ -1007,5 +1009,7 @@ def merge_stars(argv=None):
dataframes = [starfile.read(f) for f in files]

starfile.write(
pd.concat(dataframes, ignore_index=True), args.output_file, overwrite=True
{"particles": pd.concat(dataframes, ignore_index=True)},
args.output_file,
overwrite=True,
)
1 change: 1 addition & 0 deletions src/pytom_tm/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def extract_particles(
"rlnCoordinateY": "rlnCenteredCoordinateYAngst",
"rlnCoordinateZ": "rlnCenteredCoordinateZAngst",
"rlnMicrographName": "rlnTomoName",
"rlnDetectorPixelSize": "rlnTomoTiltSeriesPixelSize",
}
output = output.rename(columns=column_change)

Expand Down
1 change: 1 addition & 0 deletions tests/test_tmjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ def test_extraction(self):
"rlnCenteredCoordinateYAngst",
"rlnCenteredCoordinateZAngst",
"rlnTomoName",
"rlnTomoTiltSeriesPixelSize",
):
self.assertTrue(
column in df_rel5.columns,
Expand Down