Importing old alignments from imod question

76 views
Skip to first unread message

Doulin Shepherd

unread,
Sep 10, 2025, 9:59:52 AMSep 10
to Warp
Hello everyone,

Is there a way to flip the sign of the tilt angles when importing alignment information from IMOD?

I have a dataset of about 500 manually aligned tilt series from an older project that I would like to process in WARP. If I create the tomostar files using the "--dont-invert" flag, I can directly use the old alignment information, but the resulting tomograms have the wrong geometric handedness, even though the defocus handedness is correct (some how).

I vaguely recall that the Windows version of WARP had an option to invert the angles when importing from IMOD, but after checking the current flags for importing alignments, I couldn't find one. I'm assuming this option is no longer available.

The description for ts_import states, "Create .tomostar files based on a combination of MDOC files, aligned frame series, and optional tilt series alignments from IMOD or AreTomo." I was hoping this function would include the feature I need, but there doesn't seem to be an option to use ts_import with IMOD alignments.

It appears I might have to realign and repick all 500 tomograms, but I am really hoping that there is way to avoid that.

Cheers,
Doulin

Alister Burt

unread,
Sep 10, 2025, 10:22:05 AMSep 10
to Shepherd Doulin, Warp
Hey Doulin,

I assume you ran ts_import with tilt angle inversion, generated stacks and then found that your old alignments didn’t produce properly aligned tomograms - is this correct?

If so, the problem you’re seeing is because inversion of angles used to happen at alignment import time, after ts_stack generation and now happens during ts_import, prior to ts_stack generation. Because stacks are created in order of sorted tilt angles your xf metadata are now in the wrong order.

Sorry about this, it’s an example of annoying complexity you can’t really know how to deal with unless you have a relatively deep understanding of the internals (which is not a reasonable expectation for a user) - you should be able to fix it by 
- running ts_import with the default tilt angle inversion enables (no —dont_invert flag)
- reversing the order of lines in your xf and tlt files

Once done, you will need to ensure consistent tomogram origin positioning to be able to use your picks - tomogram dimensions are stored in the tilt series settings file 

Cheers,

Alister


Sent from mobile - apologies for brevity

On Sep 10, 2025, at 06:59, Doulin Shepherd <doulin....@gmail.com> wrote:

Hello everyone,
--
You received this message because you are subscribed to the Google Groups "Warp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to warp-em+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/warp-em/25878434-6b9a-480b-bd66-7df64e6d1e24n%40googlegroups.com.
Message has been deleted

Doulin Shepherd

unread,
Sep 12, 2025, 12:32:19 AMSep 12
to Warp

Hi Alister,

Thanks for the quick reply.

Yes, I had initially tried to import them without the "--dont_invert" flag, and things went very bad, very quickly. I had assumed the flag would be an option during the alignment import, but that only applied to Windows Warp.

Thank you for the the suggestion. I thought the .xf file would need a more complex alteration, so if it's just a simple reorder, I'm more than happy with that.

Cheers,
Doulin

Pranav Shah

unread,
Sep 12, 2025, 12:32:23 AMSep 12
to Shepherd Doulin, Warp
FWIW, the geometric handedness inversion is an annoying but ultimately
harmless* problem, but in the grand scheme of things it would be
really useful to not have found out after the fact.

*T&Cs apply: It is harmless if the resolution is sufficiently high
that one can see the helical symmetry of an alpha helix or if there is
any prior information on the molecule eg crystal/SPA structure.
However, this isnt a given with STA maps.
Best,
Pranav
--
Pranav Shah
Postdoctoral Research Fellow.

Division of Structural Biology,
Wellcome Trust Centre for Human Genetics,
University of Oxford,
Roosevelt Drive, Oxford OX3 7BN,
UK
> To view this discussion visit https://groups.google.com/d/msgid/warp-em/A53648EB-24A7-4810-9D8B-863DA2624608%40gmail.com.

Huy Bui

unread,
Sep 12, 2025, 9:04:21 PMSep 12
to Warp
Hi Doulin,

I wrote a script for this. It works very well for our data but I cannot be sure about other microscopes because I saw some microscopes are different. Our microscope behaves exactly like the standard tutorial data from the Brigg group. 

For ts_import, I don't use dont_invert
During ts_stack generation, you need to use the pixel size as unbinned one (same pixel size as used in IMOD for tilt alignment)

Then you can use my script here for import xf & .tlt file

This script will invert the angle in the tilt file from IMOD and copy to the corresponding TS folder in warp_tiltseries/tiltstack 

copy_xf_tlt_files_to_warp.py TS_001/align.com TS_001/TS_001.xf TS_001/TS_001.tlt warp_tiltseries/tiltstack/TS_001


sh copy_xf_tlt_files_to_warp_batch.sh TS_0*
 
With TS_0* is the pattern of all your tilt series.
To do this, the script must be run at the main folder, same level as warp_tiltseries or tomostar and all the TS IMOD folder is at the same level. You can link so all the aligned tilt series at the same level to run the script.

After copying all the .xf and .tlt file, you can do the import.

WarpTools ts_import_alignments \
--settings warp_tiltseries.settings \
--alignments warp_tiltseries/tiltstack/ \
--alignment_angpix 2.12

The alignment angpix should be unbinned. Same as the one you used in ts_stack and IMOD.

Do CTF, check for defocus handedness and generate tomograms like normal. In my case, everything that I pick is pretty good, perhaps 1-2 pixel off due to Warp prefer even pixel size for the generated tomogram. This is still good enough for all the coordinates.

Good luck,
Huy

Doulin Shepherd

unread,
Sep 15, 2025, 7:03:16 AMSep 15
to Warp

Hi Pranav,

I've always wondered about this, so it's nice to get some confirmation on the relative importance of geometric handedness. I've never been able to get a good average from Warp/M and/or Relion 4/5 with this dataset, so I'm a bit paranoid about all the parameters.

Thanks, Huy!

This, and honestly all the scripts in that repo, will be really useful!


Reply all
Reply to author
Forward
0 new messages