|
From: <ha...@us...> - 2010-01-19 03:55:44
|
Revision: 12171
http://jmol.svn.sourceforge.net/jmol/?rev=12171&view=rev
Author: hansonr
Date: 2010-01-19 03:55:37 +0000 (Tue, 19 Jan 2010)
Log Message:
-----------
11.9.20 -- VERSION -- ELECTRON DENSITY PLOTS WORKING
# new feature: isosurface CENTER option for CCP4,MRC,XPLOR files
# allows centering offsets in crystallographic grid coordinates of map file
# new feature: isosurface COLOR DENSITY option produces a point-graph of grid colored by
# grid point value rather than an isosurface
# code: restructuring of surface readers and JVXL coder
# new feature: xyz files with 9th column is atom number
# bug fix: adding hydrogens does not update atom numbers
# code: JVXL reader refactoring
# bug fix: XPLOR fix/upgrade
# bug fix: MRC/CCP4 reader not accounting for unit cell dimensions
# verified by inspection with 3hyp (Eric Martz)
# bug fix: application preferences have their own hardcoded defaults!
# setting vdw to 23%
#
# code: initial progress toward XML state definition
# code: organizing of ScriptEvaluator
#
# code: refactored jvxl.data.JvxlCoder and jvxl.readers.JvxlXmlReader
# methods to util.XmlUtil and util.XmlReader
#
# --------------------------------------------------------------
Modified Paths:
--------------
trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java
trunk/Jmol/src/org/jmol/jvxl/readers/MrcBinaryReader.java
trunk/Jmol/src/org/jmol/jvxl/readers/XplorReader.java
trunk/Jmol/src/org/jmol/viewer/Jmol.properties
Modified: trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java 2010-01-19 03:10:41 UTC (rev 12170)
+++ trunk/Jmol/src/org/jmol/jvxl/readers/MapFileReader.java 2010-01-19 03:55:37 UTC (rev 12171)
@@ -63,31 +63,25 @@
protected int mapc, mapr, maps;
protected int nx, ny, nz, mode;
- protected int a0, b0, c0;
+ protected int[] nxyzStart = new int[3];
protected int na, nb, nc;
protected float a, b, c, alpha, beta, gamma;
- protected float originX, originY, originZ;
-
+ protected Point3f origin = new Point3f();
protected Point3f adjustment = new Point3f();
- // outputs:
-
protected Point3f[] vectors = new Point3f[3];
- protected Point3f origin = new Point3f();
protected void getVectorsAndOrigin() {
Logger.info("grid parameters: nx,ny,nz: " + nx + "," + ny + "," + nz);
- Logger.info("grid parameters: nxStart,nyStart,nzStart: " + a0 + "," + b0 + "," + c0);
+ Logger.info("grid parameters: nxStart,nyStart,nzStart: "
+ + nxyzStart[0] + "," + nxyzStart[1] + "," + nxyzStart[2]);
Logger.info("grid parameters: mx,my,mz: " + na + "," + nb + "," + nc);
Logger.info("grid parameters: a,b,c,alpha,beta,gamma: " + a + "," + b + "," + c + "," + alpha + "," + beta + "," + gamma);
Logger.info("grid parameters: mapc,mapr,maps: " + mapc + "," + mapr + "," + maps);
- Logger.info("grid parameters: originX,Y,Z: " + originX + "," + originY + "," + originZ);
+ Logger.info("grid parameters: originX,Y,Z: " + origin);
-
- SymmetryInterface unitCell;
-
- unitCell = (SymmetryInterface) Interface
+ SymmetryInterface unitCell = (SymmetryInterface) Interface
.getOptionInterface("symmetry.Symmetry");
unitCell.setUnitCell(new float[] { a, b, c, alpha, beta, gamma });
@@ -109,12 +103,6 @@
s2r2c1...s2r2c9.....
etc.
- Now, nx (but NOT nxStart) refers to "column" data
- ny (but NOT nyStart) refers to "row" data
- nz (but NOT nzStart) refers to "sheet" data
-
- (These, in my opinion, should have been called "nc, nr, ns"!)
-
In Jmol, we always have x (our [0]) running slowest, so we
ultimately must make the following assignment:
@@ -125,14 +113,6 @@
We really don't care if this is actually physical "x" "y" or "z".
In fact, for a hexagonal cell these will be combinations of xyz.
- Now, we also have:
-
- na and a0, which refer to (a) unit cell direction
- nb and b0, which refer to (b) unit cell direction
- nc and c0, which refer to (c) unit cell direction
-
- mx=2 I THINK says "map fasted moving data to the second axis (b)"
-
So it goes something like this:
scale the (a) vector by 1/mx and call that vector[0]
@@ -160,102 +140,68 @@
Logger.info(" b: " + vectors[1]);
Logger.info(" c: " + vectors[2]);
-
voxelCounts[0] = nz; // slowest
voxelCounts[1] = ny;
voxelCounts[2] = nx; // fastest
+
volumetricVectors[0].set(vectors[maps - 1]);
volumetricVectors[1].set(vectors[mapr - 1]);
volumetricVectors[2].set(vectors[mapc - 1]);
- /*
-
- For the offset of the orgin, now, we must...
-
- ...scale the "unit vector" vector[0] by a0
- ...scale the "unit vector" vector[1] by b0
- ...scale the "unit vector" vector[2] by c0
- ...add those up to give origin.xyz
-
- This is only a temporary assignment, in the
- coordinate system of the unit cell.
-
- */
-
- origin.scaleAdd(a0 + adjustment.x, vectors[0], origin);
- origin.scaleAdd(b0 + adjustment.y, vectors[1], origin);
- origin.scaleAdd(c0 + adjustment.z, vectors[2], origin);
+ // only use nxyzStart if the origin is {0, 0, 0}
- Logger.info("Jmol grid origin in Cartesion coordinates: " + origin);
-
- /*
+ if (origin.x == 0 && origin.y == 0 && origin.z == 0) {
- The origin point is in reference to the Cartesian
- transform of the unit cell [a b c], but still needs
- to be set in the coordinate system of MRC fast (x) to
- slow (z). This origin remains in this system throughout
- the calculation. We do not have to convert to "real"
- coordinates until the end (in VolumeData.voxelPtToXYZ).
-
- -Bob Hanson, 1/16/2010
+ // older method -- wow! Beats me.....
- */
+ int[] xyz2crs = new int[3];
+ xyz2crs[mapc-1] = 0; // mapc = 2 ==> [1] = 0
+ xyz2crs[mapr-1] = 1; // mapr = 1 ==> [0] = 1
+ xyz2crs[maps-1] = 2; // maps = 3 ==> [2] = 2
+ int xIndex = xyz2crs[0]; // xIndex = 1
+ int yIndex = xyz2crs[1]; // yIndex = 0
+ int zIndex = xyz2crs[2]; // zIndex = 2
-
- // a few issues here with what all this means -- may not have it exactly right.
-
- float[] o = new float[3];
- o[0] = origin.x; // x --> c = 2 --> y
- o[1] = origin.y; // y --> r = 1 --> x
- o[2] = origin.z; // z --> s = 3 --> z
-
- if (originX > 0) {
- // emd_1003.map" from http://www.ebi.ac.uk/pdbe/emdb/
- // assume they mean the "center the data at this point"
- // not "put the grid origin at this coordinate"
- Logger.info("Jmol assuming positive center means the origin of data is at {-x -y -z}");
- originX = -originX;
- originY = -originY;
- originZ = -originZ;
- } else if (originX < 0) {
- // assume the standard "put the grid origin at this coordinate" -- an offset
- // not that they mean the "center the data at this point"
- Logger.info("Jmol negative center found -- uncertain here.");
- } else if (a0 == 0 && b0 == 0 && c0 == 0) {
- // emd_1004.map
- Logger.info("Jmol origin and xyz map starts are all zeros.");
+ origin.scaleAdd(nxyzStart[xIndex] + adjustment.x, vectors[0], origin);
+ origin.scaleAdd(nxyzStart[yIndex] + adjustment.y, vectors[1], origin);
+ origin.scaleAdd(nxyzStart[zIndex] + adjustment.z, vectors[2], origin);
+
}
- Logger.info("Jmol use isosurface OFFSET {x y z} if you want to shift it.");
- origin.x = originZ + o[mapc - 1];
- origin.y = originY + o[mapr - 1];
- origin.z = originX + o[maps - 1];
-
- volumetricOrigin.set(origin);
- Logger.info("Jmol origin in slow-to-fast system: " + origin + "\n");
+ volumetricOrigin.set(origin);
+
+ Logger.info("Jmol grid origin in Cartesian coordinates: " + origin);
+ Logger.info("Use isosurface OFFSET {x y z} if you want to shift it.");
/* example:
-grid parameters: nx,ny,nz: 38,90,55
-grid parameters: nxStart,nyStart,nzStart: -11,-6,-11
-grid parameters: mx,my,mz: 144,16,56
-grid parameters: a,b,c,alpha,beta,gamma: 49.475,4.8375,19.4375,90.0,96.65,90.0
+isosurface within 5 {_Fe} "1blu.ccp4";
+reading isosurface data from C:/jmol-dev/workspace/Jmol/bobtest/1blu.ccp4
+FileManager opening C:\jmol-dev\workspace\Jmol\bobtest\1blu.ccp4
+data file type was determined to be MRC-
+FileManager opening C:\jmol-dev\workspace\Jmol\bobtest\1blu.ccp4
+MRC header: mode: 2
+MRC header: dmin,dmax,dmean: -2.0043933,4.9972544,-0.0151823275
+MRC header: ispg,nsymbt: 152,0
+MRC header: rms: 0.46335652
+MRC header: labels: 1
+Created by MAPMAN V. 080625/7.8.5 at Tue Jan 19 08:04:40 2010 for A. Nonymous
+MRC header: bytes read: 1024
+
+cutoff set to (dmean + 2*rms) = 0.91153073
+grid parameters: nx,ny,nz: 73,60,66
+grid parameters: nxStart,nyStart,nzStart: -12,23,-32
+grid parameters: mx,my,mz: 78,78,114
+grid parameters: a,b,c,alpha,beta,gamma: 52.0,52.0,77.1875,90.0,90.0,120.0
grid parameters: mapc,mapr,maps: 2,1,3
grid parameters: originX,Y,Z: 0.0,0.0,0.0
+Jmol unit cell vectors:
+ a: (0.6666667, 0.0, 0.0)
+ b: (-0.33333337, 0.57735026, 0.0)
+ c: (-2.9596254E-8, -5.1262216E-8, 0.6770833)
+Jmol grid origin in Cartesian coordinates: (19.333334, -6.9282017, -21.666666)
+Jmol origin in slow-to-fast system: (19.333334, -6.9282017, -21.666666)
-MRC unit cell vectors:
- a: (0.34357637, 0.0, 0.0)
- b: (0.0, 0.30234376, 0.0)
- c: (-0.040195342, 0.0, 0.34476298)
-MRC origin in unit cell coordinates: (-3.3371913, -1.8140624, -3.7923927)
-MRC origin in slow-to-fast (Jmol) sytem: (-1.8140624, -3.3371913, -3.7923927)
-
-voxel grid origin:(-1.8140624, -3.3371913, -3.7923927)
-voxel grid count/vector:55 -0.040195342 -1.692914E-8 0.34476298
-voxel grid count/vector:90 0.34357637 0.0 0.0
-voxel grid count/vector:38 -1.3215866E-8 0.30234376 0.0
-JVXL read: 55 x 90 x 38 data points
-
*/
}
Modified: trunk/Jmol/src/org/jmol/jvxl/readers/MrcBinaryReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/jvxl/readers/MrcBinaryReader.java 2010-01-19 03:10:41 UTC (rev 12170)
+++ trunk/Jmol/src/org/jmol/jvxl/readers/MrcBinaryReader.java 2010-01-19 03:55:37 UTC (rev 12171)
@@ -97,7 +97,7 @@
float rms;
int nlabel;
- nx = binarydoc.readInt();
+ nx = binarydoc.readInt(); // CCP4 "extent[0-2]"
ny = binarydoc.readInt();
nz = binarydoc.readInt();
@@ -105,14 +105,21 @@
Logger.info("MRC header: mode: " + mode);
- a0 = binarydoc.readInt();
- b0 = binarydoc.readInt();
- c0 = binarydoc.readInt();
+ nxyzStart[0] = binarydoc.readInt(); // CCP4 "nxyzstart[0-2]"
+ nxyzStart[1] = binarydoc.readInt();
+ nxyzStart[2] = binarydoc.readInt();
- na = binarydoc.readInt();
+ na = binarydoc.readInt(); // CCP4 "grid[0-2]"
nb = binarydoc.readInt();
nc = binarydoc.readInt();
+ if (na == 0)
+ na = nx - 1;
+ if (nb == 0)
+ nb = ny - 1;
+ if (nc == 0)
+ nc = nz - 1;
+
a = binarydoc.readFloat();
b = binarydoc.readFloat();
c = binarydoc.readFloat();
@@ -120,11 +127,11 @@
beta = binarydoc.readFloat();
gamma = binarydoc.readFloat();
- mapc = binarydoc.readInt();
+ mapc = binarydoc.readInt(); // CCP4 "crs2xyz[0-2]
mapr = binarydoc.readInt();
maps = binarydoc.readInt();
- dmin = binarydoc.readFloat();
+ dmin = binarydoc.readFloat();
dmax = binarydoc.readFloat();
dmean = binarydoc.readFloat();
@@ -138,9 +145,9 @@
binarydoc.readByteArray(extra);
- originX = binarydoc.readFloat();
- originY = binarydoc.readFloat();
- originZ = binarydoc.readFloat();
+ origin.x = binarydoc.readFloat(); // CCP4 "origin2k"
+ origin.y = binarydoc.readFloat();
+ origin.z = binarydoc.readFloat();
binarydoc.readByteArray(map);
binarydoc.readByteArray(machst);
@@ -177,14 +184,14 @@
}
Logger.info("MRC header: bytes read: " + binarydoc.getPosition()
- + "\n\nMRC/Jmol interpretation: \n");
+ + "\n");
// setting the cutoff to mean + 2 x RMS seems to work
// reasonably well as a default.
if (params.cutoffAutomatic) {
params.cutoff = rms * 2 + dmean;
- Logger.info("MRC/Jmol cutoff set to (dmean + 2*rms) = " + params.cutoff);
+ Logger.info("Cutoff set to (dmean + 2*rms) = " + params.cutoff);
}
getVectorsAndOrigin();
Modified: trunk/Jmol/src/org/jmol/jvxl/readers/XplorReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/jvxl/readers/XplorReader.java 2010-01-19 03:10:41 UTC (rev 12170)
+++ trunk/Jmol/src/org/jmol/jvxl/readers/XplorReader.java 2010-01-19 03:55:37 UTC (rev 12171)
@@ -115,16 +115,16 @@
jvxlFileHeaderBuffer.append("Xplor data\nJmol " + Viewer.getJmolVersion() + '\n');
na = parseInt(getLine());
- a0 = parseInt();
- nx = parseInt() - a0 + 1;
+ nxyzStart[0] = parseInt();
+ nx = parseInt() - nxyzStart[0] + 1;
nb = parseInt();
- b0 = parseInt();
- ny = parseInt() - b0 + 1;
+ nxyzStart[1] = parseInt();
+ ny = parseInt() - nxyzStart[1] + 1;
nc = parseInt();
- c0 = parseInt();
- nz = parseInt() - c0 + 1;
+ nxyzStart[2] = parseInt();
+ nz = parseInt() - nxyzStart[2] + 1;
a = parseFloat(getLine());
b = parseFloat();
@@ -143,7 +143,7 @@
nBlock = voxelCounts[2] * voxelCounts[1];
if (params.cutoffAutomatic) {
- params.cutoff = (boundingBox == null ? 5.0f : 1.6f);
+ params.cutoff = (boundingBox == null ? 3.0f : 1.6f);
Logger.info("XplorReader: setting cutoff to default value of " + params.cutoff + (boundingBox == null ? " (no BOUNDBOX parameter)" : ""));
}
Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-01-19 03:10:41 UTC (rev 12170)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-01-19 03:55:37 UTC (rev 12171)
@@ -1,7 +1,7 @@
# Developers: to add a description of changes you have made,
# add it on a line starting with # below the "version=..." line
-version=11.9.20_dev
+version=11.9.20
# new feature: isosurface CENTER option for CCP4,MRC,XPLOR files
# allows centering offsets in crystallographic grid coordinates of map file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|