I'm trying to read a density file. The docs (http://salilab.org/modeller/manual/node414.html) suggest that this should work
>>> m = modeller.density(modeller.environ(), "file.mrc", 10) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __init__() takes exactly 2 arguments (4 given)
Instead, I've tried:
>>> m = modeller.density(modeller.environ()) >>> m.read("file.mrc",10) read_data> Reading electron density of the main map readlinef__W> File: file.mrc, Line: 1 Modeller will only read the first 400 characters of this line.
readlinef__W> File: file.mrc, Line: 3 Modeller will only read the first 400 characters of this line.
forrtl: severe (64): input conversion error, unit -5, file Internal Formatted Read
Any suggestions what I'm doing wrong?
Chris
On 6/6/14, 7:53 AM, chris.wood@stfc.ac.uk wrote: >>>> m = modeller.density(modeller.environ(), "file.mrc", 10)
The constructor takes keyword arguments, not positional args (this makes for more readable code anyway). Plus it generally makes sense to keep the environ object around. So what you want here is e = modeller.environ() m = modeller.density(e, file="file.mrc", resolution=10, em_density_format='MRC')
Note you need to specify the file format, otherwise it defaults to XPLOR, and obviously an MRC file isn't valid XPLOR format ;)
Ben Webb, Modeller Caretaker
Oops - I should learn to read docs more carefully (and count the number of stars in a function call)! [Using the environ() in the contructor was just for my test script; I'll move it out for production code]
Cheers, Chris ________________________________________ From: Modeller Caretaker [modeller-care@salilab.org] Sent: 06 June 2014 17:04 To: Wood, Chris (STFC,RAL,SC); modeller_usage@salilab.org Subject: Re: [modeller_usage] Reading density files
On 6/6/14, 7:53 AM, chris.wood@stfc.ac.uk wrote: >>>> m = modeller.density(modeller.environ(), "file.mrc", 10)
The constructor takes keyword arguments, not positional args (this makes for more readable code anyway). Plus it generally makes sense to keep the environ object around. So what you want here is e = modeller.environ() m = modeller.density(e, file="file.mrc", resolution=10, em_density_format='MRC')
Note you need to specify the file format, otherwise it defaults to XPLOR, and obviously an MRC file isn't valid XPLOR format ;)
Ben Webb, Modeller Caretaker -- modeller-care@salilab.org http://www.salilab.org/modeller/ Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage
Additionally, is there a way to retrieve attributes of the map that are calculated / determined from the map? i.e. something analogous to retrieving the voxel_size:
>>> m = modeller.density(modeller.environ(),file="file.mrc",resolution=5,em_density_format="mrc") >>> m.resolution 5.0 >>> m.voxel_size 3.0 >>> m.px Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'density' object has no attribute 'px'
________________________________________ From: chris.wood@stfc.ac.uk [chris.wood@stfc.ac.uk] Sent: 06 June 2014 20:09 To: modeller_usage@salilab.org Subject: Re: [modeller_usage] Reading density files
Oops - I should learn to read docs more carefully (and count the number of stars in a function call)! [Using the environ() in the contructor was just for my test script; I'll move it out for production code]
Cheers, Chris ________________________________________ From: Modeller Caretaker [modeller-care@salilab.org] Sent: 06 June 2014 17:04 To: Wood, Chris (STFC,RAL,SC); modeller_usage@salilab.org Subject: Re: [modeller_usage] Reading density files
On 6/6/14, 7:53 AM, chris.wood@stfc.ac.uk wrote: >>>> m = modeller.density(modeller.environ(), "file.mrc", 10)
The constructor takes keyword arguments, not positional args (this makes for more readable code anyway). Plus it generally makes sense to keep the environ object around. So what you want here is e = modeller.environ() m = modeller.density(e, file="file.mrc", resolution=10, em_density_format='MRC')
Note you need to specify the file format, otherwise it defaults to XPLOR, and obviously an MRC file isn't valid XPLOR format ;)
Ben Webb, Modeller Caretaker -- modeller-care@salilab.org http://www.salilab.org/modeller/ Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage -- Scanned by iCritical.
_______________________________________________ modeller_usage mailing list modeller_usage@salilab.org https://salilab.org/mailman/listinfo/modeller_usage
On 6/9/14, 3:56 AM, chris.wood@stfc.ac.uk wrote: > Additionally, is there a way to retrieve attributes of the map that > are calculated / determined from the map? i.e. something analogous to > retrieving the voxel_size:
px, py and pz currently aren't exposed to Python, but it's pretty easy to do so. I added a patch at https://salilab.org/modeller/wiki/Patches
Ben Webb, Modeller Caretaker
participants (2)
-
chris.wood@stfc.ac.uk
-
Modeller Caretaker