Skip to content

Fix RELION & RELION5 star file import for ChimeraX 1.10.1#53

Merged
uermel merged 2 commits into
mainfrom
uermel/fix-relion-star-import
Jun 16, 2026
Merged

Fix RELION & RELION5 star file import for ChimeraX 1.10.1#53
uermel merged 2 commits into
mainfrom
uermel/fix-relion-star-import

Conversation

@uermel

@uermel uermel commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Fixes #43. Supersedes #44.

Problem

ChimeraX 1.10.1 ships a newer pandas where the starfile reader returns string columns (e.g. rlnMicrographName) as the pandas extension StringDtype instead of numpy object. np.issubdtype() only understands numpy dtypes, so classifying the "additional" columns during import raises:

TypeError: Cannot interpret '<StringDtype(na_value=nan)>' as a data type

Fix

Replace the check with pandas' public pd.api.types.is_numeric_dtype(), which correctly handles both numpy dtypes and pandas extension dtypes.

The identical check existed in both star-file readers, so the fix is applied in both:

Credit to @bwmr for the root-cause analysis and the original fix in #43/#44; their commit is preserved here. This PR bundles the matching RELION5 fix so #43 is fully resolved (rebased onto current main, which now includes #39 and #52).

🤖 Generated with Claude Code

bwmr and others added 2 commits June 16, 2026 15:53
Use pandas type to work with newer versions
The RELION5 star-file reader had the same np.issubdtype(df.dtypes[key],
np.number) check that fails on pandas StringDtype columns under ChimeraX
1.10.1 (issue #43). Use pandas' is_numeric_dtype here too so RELION5
imports are covered by the same fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Opening Relion 3-style .star file results in type checking error in ChimeraX 1.10.1

2 participants