leginon-org / leginon-redmine-archive

1 stars 0 forks source link

helical rotation in a single interpolation #1436

Open leginonbot opened 8 months ago

leginonbot commented 8 months ago

Author Name: Neil Voss (@vosslab) Original Redmine Issue: 1436, https://emg.nysbc.org/redmine/issues/1436 Original Date: 2011-09-28 Original Assignee: Lauren Fisher


I'm working on getting stack creation to do the helical rotation in a single interpolation, but I was wondering if I could enlist your help to figure out how incorporate this with your new apBoxer stuff. Right now the way I find the best angle is diffract each filament and rotate them through a range of fine angles until the intensity at the equator is maximized. I have a C shell script to do this, but I'm trying to figure out which stage to insert it in the python scripts. If I put it in makestack2.py after apBoxer.boxerRotate, then the roughly rotated stack will need to be broken up into mrc files, run through my script to get the fine angle for each filament, then the 2 angles can be combined, and apBoxer rerun with the final angles so it applies only a single interpolation. The problems I see with this are it's clunky (writing a stack, breaking it up, and rewriting it), and it's a little tricky getting the angles from my c shell script back into python (the only way I see to do this is write it to a text file and read the angles in). It would be much cleaner and easier if the second angle could be found in boxerRotate and added with the first angle before the stack was written, but I don't know how to do this with an image array. Is there a way to write the array to an mrc file, run the c shell script to find the final angle, then recalculate the array before writing it to the stack? Do you have any thoughts or suggestions on the best way to tackle this? Thanks so much!!

~Lauren

leginonbot commented 8 months ago

Original Redmine Comment Author Name: Neil Voss (@vosslab) Original Date: 2011-09-28T23:03:54Z


Hi Lauren, I would probably do this as post stack feature like center particles. You sort the stack particles by image (they already are) figure out all the angles and then go back to the original image using the apBoxer command. ApBoxer takes an image and a list of x,y,angle coordinates and creates a new box.

WAIT, I guess this is complicated by CTF correction. We probably need to modularize the CTF stuff.

Okay, modified idea. Do this as post stack feature like center particles, but instead of creating a new stack, create a new particle picking run with angles posted in the database. Then you could run makestack separately without integrating yet another feature into makestack. I am worried that makestack is becoming incredibly hard to maintain.

How is your alignment in Fourier space working, because I've implemented Radon transforms into the pipeline (see apRadon.py), which I know Gabe was using offline to align his filaments -- I've been pretty happy with it -- at least it is quick. If you have python 2.5 or larger it has parallel processing built in.

leginonbot commented 8 months ago

Original Redmine Comment Author Name: Lauren Fisher (Lauren Fisher) Original Date: 2011-10-12T20:52:10Z


Hi Neil, I agree with you that makestack is becoming pretty bulky and hard to maintain. I can work on making the fine alignment a post stack feature or add it under the Particle Alignments page. I am only working at AMI 1 day a week now, so I apologize if my updates are few and far between and this process is drawn out. In the meantime, here is the code I wrote in makestack2.py to do the single interpolation (I did svn diff so you can see exactly what I added). It's not the most efficient process and I know the code is getting clunky, but it works. So do you think I should scrap it or check it in until I get a separate alignment protocol integrated?

@ t0 = time.time() if self.params['rotate'] is True: apBoxer.boxerRotate(imgpath, parttree, imgstackfile, self.params['boxsize'])

Right now the way I do the Fourier space alignment (s_finealign) is diffract the short helical repeat, background subtract and collapse the power spectrum, then calculate the height of the peak at the equator. Each filament is run through a range of angles using the Suprim program rota4 until the equatorial peak is maximized and the corresponding angle is applied to the filament. This procedure is time consuming, but it works really well. However, I am definitely up to new suggestions if you have something that works well and is more efficient.

leginonbot commented 8 months ago

Original Redmine Comment Author Name: Neil Voss (@vosslab) Original Date: 2011-10-13T11:35:46Z


Hi Lauren,

If it works, there is no reason to redo it, but for any future considerations I would try to avoid adding more to makestack. And I cannot think of anyway to really break make stack apart, but it definitely needs some reorganization for readability sake.