I have just been trying out Jmol and found a problem with the SHELX reader.
The problem is that it balks on reading atom co-ordinates lines such as

H   1    0.0 0.0 0.0  0

in the particular case where the element has only 1 letter in its chemical
symbol and there is no number following.  For example:

TITL   Converted by XX2shx - Keith Refson
CELL  1.54180   8.619649   8.627482     6.9505   79.93961   103.2911   120.0852
LATT -1
SFAC Mg O
Mg     1   1.0071635310000  1.0103068320000  0.0143757880000 0
O      2   0.1412130180000  0.2240108100000  0.1585782800000 0
O      2   0.8725146790000  0.7986771140000  0.8727733560000 0
END

fails, but

TITL   Converted by XX2shx - Keith Refson
CELL  1.54180   8.619649   8.627482     6.9505   79.93961   103.2911   120.0852
LATT -1
SFAC Mg O
Mg     1   1.0071635310000  1.0103068320000  0.0143757880000 0
O1     2   0.1412130180000  0.2240108100000  0.1585782800000 0
O2     2   0.8725146790000  0.7986771140000  0.8727733560000 0
END

reads in correctly.

There's an error in the source logic in procedure assumeAtomRecord()

    if (atomName.length() > 1 &&
        Character.isDigit(atomName.charAt(1))) {
      // one letter code elementSymbol
      char symbol = atomName.charAt(0);
      if (symbol == 'Q' || symbol == 'q')
        return;     // ignore atoms named Q
      elementSymbol = "" + symbol;
    } else {
      elementSymbol = atomName.substring(0, 2);
    }

which jumps to the "else" clause if a single digit element symbol is not
followed by a digit.

Keith Refson

--
Dr Keith Refson,
Building R3
Rutherford Appleton Laboratory
Chilton
Didcot                          kr AT isise             
Oxfordshire OX11 0QX            DOT nd DOT rl DOT ac DOT uk


------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Jmol-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to