write mrc stack error
Added by Cheri Hampton over 13 years ago
Hi, I am trying to align tilt series from command line. I get the following error:
Is there a simple way to fix this? I seem to have write permission within the directory.
Thanks,
Cheri
tomoaligner.py --session=11may26a --tiltseriesnumber=2 --projectid=14 --runname=align1 --alignmethod=protomo --cycle=1 --sample=4 --region=50 --description="help" --commit
... Time stamp: 11jun22r46
... Function name: tomoaligner
... Appion directory: /usr/local/lib/python2.6/site-packages
!!! WARNING: Using split database
Connected to database: 'ap14'
... Committing data to database
... Looking up session, 11may26a
... Looking up session, 52
!!! WARNING: run directory not defined, automatically setting it
... Run directory: appion/maui.raid/Image/11may26a/tomo/tiltseries2/align/align1
!!! WARNING: directory 'appion/maui.raid/Image/11may26a/tomo/tiltseries2/align/align1' already exists. (Because I ran it twice)
... Writing function log to: tomoaligner.log
... Found 8 processors on this machine
... Running Appion version '2.1.3'
... getting imagelist
... getting pixelsize
appion/maui.raid/Image/11may26a/tomo/tiltseries2/11may26a_002.st
... Writing MRC stack file...
Traceback (most recent call last):
File "/home/appion/myami/appion/bin/tomoaligner.py", line 343, in <module>
app.start()
File "/home/appion/myami/appion/bin/tomoaligner.py", line 213, in start
apTomo.writeTiltSeriesStack(stackdir,stackname,ordered_mrc_files)
File "/usr/local/lib/python2.6/site-packages/appionlib/apTomo.py", line 188, in writeTiltSeriesStack
apImage.writeMrcStack(stackdir,stackname,ordered_mrc_files, 1)
File "/usr/local/lib/python2.6/site-packages/appionlib/apImage/imagefile.py", line 335, in writeMrcStack
mrc.write(image,stackname)
File "/usr/local/lib/python2.6/site-packages/pyami/mrc.py", line 499, in write
fobj = open(f, 'wb')
IOError: [Errno 2] No such file or directory: 'appion/maui.raid/Image/11may26a/tomo/tiltseries2/11may26a_002.st'
Replies (8)
RE: write mrc stack error - Added by Anchi Cheng over 13 years ago
The problem is that your leginon base directory does not contain the word 'leginon' which the script searches for and replace it with appion. The python script has a bug when it runs into this situation and append appion in front of the absolute path and made it relative. In the later part of the script, the directory is changed to the rundir and it could not find the relative path from that view point.
Our scripts all assumes that appion directory is parallel to leginon before it branches into subdirectory of session name. This is something we should have warned you early on. Sorry about that.
A simple solution might be to create a soft link at /maui.raid/ to link Image/ to leginon. Give it a try.
Otherwise, I can change a few scripts in myami-2.1, you do an update and then always specify rundir when you run the command. This might not be a reliable enough solution, though because the assumption is wide-spread.
RE: write mrc stack error - Added by Cheri Hampton over 13 years ago
If I understand correctly, we create a link with the following command:
ln -s /maui.raid/Image leginon
but this still does not work.
RE: write mrc stack error - Added by Anchi Cheng over 13 years ago
What I meant is
cd /maui.raid ln -s Image leginon
Now think of it, it would still not working because database still thinks the image path is /maui.raid/Image and would parse from that string. It will be best, if you can get Harry to help you to change the image path recorded in the database to replace /Image with /leginon after you have made the soft link. Try this first only on the session you are processing on. You may need to give a new runname so that it will generate the alignment rundir correctly.
The table you would be looking for is leginondb.SessionData and the field is 'image path'
RE: write mrc stack error - Added by Anchi Cheng over 13 years ago
There was a bug fix (Issue #1098) on this issue of needing to specify the default appion path that is not related to the leginon image path. However, as it is in the trunk and may be unstable, I didn't bring it up as a possible solution. r15323 is likely to be stable as the last related change to the issue that is still compatible to 2.1 release. The last 2.1 release compatible revision in the trunk is r15644. During Hstau's visit at NRAMM from Cheri's group, we tried updating their webserver and database to r15323. It may solve the problem without changing the leginon path.
Cheri, please confirm whether the problem is solved. We could not display the webpage from here to test.
Anchi
RE: write mrc stack error - Added by Cheri Hampton over 13 years ago
OK, I've progressed. Now just need to have write permission re-granted.
cheri@oahu:~> tomoaligner.py --session=11may26a --projectid=14 --runname=align1 --tiltseriesnumber=4 --rundir=/oahu.raid/appion/11may26a/tomo/tiltseries4/align/align1 --alignmethod=protomo --cycle=1 --sample=8 --region=50 --description="xcfvgf" --commit --expId=52 --jobtype=tomoaligner
... Time stamp: 11aug12p00... Function name: tomoaligner
... Appion directory: /usr/local/lib/python2.6/site-packages
!!! WARNING: Using split database
Connected to database: 'ap14'
... Committing data to database
... Looking up session, 11may26a
... Looking up session, 52
... Run directory: /oahu.raid/appion/11may26a/tomo/tiltseries4/align/align1
Traceback (most recent call last):
File "/home/appion/myami/appion/bin/tomoaligner.py", line 342, in <module>
app = protomoAligner()
File "/usr/local/lib/python2.6/site-packages/appionlib/appionScript.py", line 88, in init
self.setupRunDirectory()
File "/usr/local/lib/python2.6/site-packages/appionlib/appionScript.py", line 293, in setupRunDirectory
apParam.createDirectory(self.params['rundir'], warning=(not self.quiet))
File "/usr/local/lib/python2.6/site-packages/appionlib/apParam.py", line 330, in createDirectory
apDisplay.printError("Could not create directory, '"+path+"'\nCheck the folder write permissions")
File "/usr/local/lib/python2.6/site-packages/appionlib/apDisplay.py", line 56, in printError
raise Exception, colorString("\n * FATAL ERROR *\n"+text+"\n\a","red")
Exception:
- FATAL ERROR ***
Could not create directory, '/oahu.raid/appion/11may26a/tomo/tiltseries4/align/align1'
Check the folder write permissions
... Looking up session, 11may26a
Exception ValueError: ValueError('id must be specified, not None',) in <bound method protomoAligner.__del__ of <__main__.protomoAligner object at 0x1412f90>> ignored
cheri@oahu:~>
RE: write mrc stack error - Added by Cheri Hampton over 13 years ago
Even after re-establishing write permission I get the following error:
cheri@oahu:~> tomoaligner.py --session=11jun02a --projectid=14 --runname=align1 --tiltseriesnumber=2 --rundir=/oahu.raid/appion/11jun02a/tomo/tiltseries2/align/align1 --alignmethod=protomo --cycle=1 --sample=8 --region=50 --description="fdghtyu" --commit --expId=54 --jobtype=tomoaligner
... Time stamp: 11aug15m32
... Function name: tomoaligner
... Appion directory: /usr/local/lib/python2.6/site-packages
!!! WARNING: Using split database
Connected to database: 'ap14'
... Committing data to database
... Looking up session, 11jun02a
... Looking up session, 54
... Run directory: /oahu.raid/appion/11jun02a/tomo/tiltseries2/align/align1
... Writing function log to: tomoaligner.log
... Found 8 processors on this machine
... Looking up session, 11jun02a
... Running Appion version 'r15323'
... getting imagelist
... getting pixelsize
Traceback (most recent call last):
File "/home/appion/myami/appion/bin/tomoaligner.py", line 343, in <module>
app.start()
File "/home/appion/myami/appion/bin/tomoaligner.py", line 211, in start
stackdir = self.params['tiltseriesdir']
KeyError: 'tiltseriesdir'
RE: write mrc stack error - Added by Anchi Cheng over 13 years ago
Cheri and Harry,
You may want to check multiply copies of appion in different directories:
From your error log,/home/appion/myami/appion/bin/tomoaligner.py has stackdir = self.params['tiltseriesdir'] on line 211. However, this same code is on line 209 if I check out the 15323 version Jim installed last week. It looks like your path is still pointing to the branch 2.1 appion bin directory. I beleive the bug you are seeing was fixed but not merged to the branch. See if getting the appion bin directory updated of r15323 code would solve the problem.
Jim left log of what he did in oahu. That should help you.
Anchi
RE: write mrc stack error - Added by Jim Pulokas over 13 years ago
My installation log may confirm this, but as I recall, I did not find a previous installation of the appion/bin files on oahu. I think I installed the new bin files in /usr/local/bin/appion or something similar. A quick check of which one you are using is to type on the command line:
which tomoaligner.pyTo confirm you are using the correct appionlib, start a python command line and enter:
import appionlib appionliband it should print out the location of the appionlib that it just imported.