From: <ha...@us...> - 2008-05-22 22:25:02
|
Revision: 9407 http://jmol.svn.sourceforge.net/jmol/?rev=9407&view=rev Author: hansonr Date: 2008-05-22 15:24:55 -0700 (Thu, 22 May 2008) Log Message: ----------- 11.5.38 -- CIF reading of B factors Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java trunk/Jmol/src/org/jmol/symmetry/UnitCell.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java 2008-05-22 13:26:57 UTC (rev 9406) +++ trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/CifReader.java 2008-05-22 22:24:55 UTC (rev 9407) @@ -663,7 +663,7 @@ if (atom.anisoBorU == null) atom.anisoBorU = new float[8]; atom.anisoBorU[7] = parseFloat(loopData[j]); - atom.anisoBorU[6] = 1; // U not B + atom.anisoBorU[6] = 8; // Ortep Type 8: D = 2pi^2, C = 2, a*b* } } break; @@ -689,7 +689,7 @@ atom.anisoBorU = new float[8]; int iType = (propertyOf[i] - ANISO_U11) % 6; atom.anisoBorU[iType] = parseFloat(field); - atom.anisoBorU[6] = 1; // U not B + atom.anisoBorU[6] = 8; // D = 2pi^2, C = 2, a*b* break; case ANISO_B11: case ANISO_B22: @@ -697,12 +697,11 @@ case ANISO_B12: case ANISO_B13: case ANISO_B23: - /* if (atom.anisoBorU == null) - atom.anisoBorU = new float[8]; + if (atom.anisoBorU == null) + atom.anisoBorU = new float[8]; int iTypeB = (propertyOf[i] - ANISO_B11) % 6; - atom.anisoBorU[iTypeB] = parseFloat(field) / EIGHT_PI_SQUARED; - atom.anisoBorU[6] = 1; // still U - */ + atom.anisoBorU[iTypeB] = parseFloat(field); + atom.anisoBorU[6] = 4; // Ortep Type 4: D = 1/4, C = 2, a*b* break; } } @@ -732,9 +731,7 @@ } return true; } - -// final private static float EIGHT_PI_SQUARED = (float) (8 * Math.PI * Math.PI); - + //////////////////////////////////////////////////////////////// // bond data //////////////////////////////////////////////////////////////// Modified: trunk/Jmol/src/org/jmol/symmetry/UnitCell.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/UnitCell.java 2008-05-22 13:26:57 UTC (rev 9406) +++ trunk/Jmol/src/org/jmol/symmetry/UnitCell.java 2008-05-22 22:24:55 UTC (rev 9407) @@ -207,28 +207,76 @@ final static double twoP2 = 2 * Math.PI * Math.PI; - Object[] getEllipsoid(float[] parBorU, boolean isU) { - //returns {Vector3f[3] unitVectors, float[3] lengths} - //from J.W. Jeffery, Methods in X-Ray Crystallography, Appendix VI, - // Academic Press, 1971 + Object[] getEllipsoid(float[] parBorU) { + /* + * + * returns {Vector3f[3] unitVectors, float[3] lengths} + * from J.W. Jeffery, Methods in X-Ray Crystallography, Appendix VI, + * Academic Press, 1971 + * + * comparing with Fischer and Tillmanns, Acta Cryst C44 775-776, 1988, + * these are really BETA values. Note that - // comparing with Fischer and Tillmanns, Acta Cryst C44 775-776, 1988, - // these are really BETA values, almost -- at least by this definition - // there is a factor of 2 in the cross terms. - // THIS FACTOR IS NECESSARY for agreement with Mercury. - // + T = exp(-2 pi^2 (a*b* U11h^2 + b*b* U22k^2 + c*c* U33l^2 + + 2 a*b* U12hk + 2 a*c* U13hl + 2 b*c* U23kl)) + + * (ORTEP type 8) is the same as + + T = exp{-2 pi^2^ sum~i~[sum~j~(U~ij~ h~i~ h~j~ a*~i~ a*~j~)]} + + * http://ndbserver.rutgers.edu/mmcif/dictionaries/html/cif_mm.dic/Items/_atom_site.aniso_u[1][2].html + * + * Ortep: + * +Anisotropic temperature factor Types 0, 1, 2, 3, and 10 use the following formula for the +complete temperature factor. + +Base^(-D(b11h2 + b22k2 + b33l2 + cb12hk + cb13hl + cb23kl)) + +The coefficients bij (i,j = 1,2,3) of the various types are defined with the following constant settings. + +Type 0: Base = e, c = 2, D = 1 +Type 1: Base = e, c = 1, D = l +Type 2: Base = 2, c = 2, D = l +Type 3: Base = 2, c = 1, D = l + +Anisotropic temperature factor Types 4, 5, 8, and 9 use the following formula for the +complete temperature factor, in which a1* , a2*, a3* are reciprocal cell dimensions. + +exp[ -D(a1*2U11h2 + a2*2U22k2 + a3*2U33l2 + C a1*a2*U12hk + C a1*a3 * U13hl + C a2*a3 * U23kl)] + +The coefficients Uij (i,j = 1,2,3) of the various types are defined with the following constant settings. + +Type 4: C = 2, D = 1?4 +Type 5: C = 1, D = 1?4 +Type 8: C = 2, D = 2p2 +Type 9: C = 1, D = 2p2 + + */ + float[] lengths = new float[6]; // last three are for factored lengths if (parBorU[0] == 0) { // this is iso lengths[1] = (float) Math.sqrt(parBorU[7]); return new Object[] { null, lengths }; } - double B11 = parBorU[0] * (isU ? twoP2 * a_ * a_ : 1); - double B22 = parBorU[1] * (isU ? twoP2 * b_ * b_ : 1); - double B33 = parBorU[2] * (isU ? twoP2 * c_ * c_ : 1); - double B12 = parBorU[3] * (isU ? twoP2 * a_ * b_ * 2 : 1); - double B13 = parBorU[4] * (isU ? twoP2 * a_ * c_ * 2 : 1); - double B23 = parBorU[5] * (isU ? twoP2 * b_ * c_ * 2 : 1); + int ortepType = (int) parBorU[6]; + boolean isFractional = (ortepType == 4 || ortepType == 5 + || ortepType == 8 || ortepType == 9); + double cc = 2 - (ortepType % 2); + double dd = (ortepType == 8 || ortepType == 9 || ortepType == 10 ? twoP2 + : ortepType == 4 || ortepType == 5 ? 0.25 + : ortepType == 2 || ortepType == 3 ? Math.log(2) + : 1 ); + // types 6 and 7 not supported + + double B11 = parBorU[0] * dd * (isFractional ? a_ * a_ : 1); + double B22 = parBorU[1] * dd * (isFractional ? b_ * b_ : 1); + double B33 = parBorU[2] * dd * (isFractional ? c_ * c_ : 1); + double B12 = parBorU[3] * dd * (isFractional ? a_ * b_ : 1) * cc; + double B13 = parBorU[4] * dd * (isFractional ? a_ * c_ : 1) * cc; + double B23 = parBorU[5] * dd * (isFractional ? b_ * c_ : 1) * cc; + // set bFactor = (U11*U22*U33) parBorU[7] = (float) Math.pow(B11 / twoP2 / a_ / a_ * B22 / twoP2 / b_ / b_ * B33 / twoP2 / c_ / c_, 0.3333); @@ -247,6 +295,7 @@ Bcart[4] = 2 * c * c * cB_ * cosBeta * B33 + b * c * cosGamma * B23 + a * c * cB_ * B13; Bcart[5] = 2 * c * c * cA_ * cB_ * B33 + b * c * cB_ * sinGamma * B23; + Vector3f unitVectors[] = new Vector3f[3]; for (int i = 0; i < 3; i++) unitVectors[i] = new Vector3f(); @@ -268,7 +317,7 @@ return null; if (data == null) data = new Data(); - return data.getEllipsoid(parBorU, parBorU[6] != 0); + return data.getEllipsoid(parBorU); } private void calcNotionalMatrix() { Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2008-05-22 13:26:57 UTC (rev 9406) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2008-05-22 22:24:55 UTC (rev 9407) @@ -26,6 +26,7 @@ # -- bypasses inter-group bonding check when creating polymers # new feature: set drawPicking now enables measuring among atoms and DRAW points # -- not saved -- just transient measurements +# new feature: CIF reading of B factors for thermal ellipsoids # code: refactoring of biopolyer resolver This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |