Project

General

Profile

Actions

Feature #1436

open

helical rotation in a single interpolation

Added by Neil Voss about 13 years ago. Updated about 13 years ago.

Status:
Assigned
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
09/28/2011
Due date:
% Done:

0%

Estimated time:

Description

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

Actions #1

Updated by Neil Voss about 13 years ago

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.

Actions #2

Updated by Lauren Fisher about 13 years ago

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'])
+ apXmipp.breakupStackIntoSingleFiles(imgstackfile, filetype="mrc")
+ rotcmd = "s_finealign %s %i" %(self.params['rundir'], self.params['boxsize'])
+ apParam.runCmd(rotcmd, "HIP", verbose=True)
+ # read in text file containing refined angles
+ anglepath = os.path.join(self.params['rundir'], 'partfiles/angles.out')
+ f = open(anglepath, 'r')
+ angles = f.readlines()
+ # loop through parttree and add refined angle to rough angle
+ for i in range(len(parttree)):
+ partdict = parttree[i]
+ fineangle = float(angles[i])
+ newangle = float(partdict['angle'])-fineangle
+ partdict['angle'] = newangle
+ # rerun apBoxer.boxerRotate with the new parttree containing final angles
+ apBoxer.boxerRotate(imgpath, parttree, imgstackfile, self.params['boxsize'])
else:
apBoxer.boxer(imgpath, parttree, imgstackfile, self.params['boxsize'])
self.batchboxertimes.append(time.time()-t0)

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.

Actions #3

Updated by Neil Voss about 13 years ago

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.

Actions

Also available in: Atom PDF