From: <ha...@us...> - 2011-12-13 20:20:45
|
Revision: 16579 http://jmol.svn.sourceforge.net/jmol/?rev=16579&view=rev Author: hansonr Date: 2011-12-13 20:20:39 +0000 (Tue, 13 Dec 2011) Log Message: ----------- version=12.3.10_dev # bug fix: adding H atoms to mol2 file faulty Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/JmolConstants.java Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-12-13 20:20:16 UTC (rev 16578) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-12-13 20:20:39 UTC (rev 16579) @@ -3,6 +3,7 @@ version=12.3.10_dev +# bug fix: adding H atoms to mol2 file faulty # bug fix: load xxx.png;write PNGJ xxx.png (to same file as loaded) fails # new feature: compare {from} {to} FRAME # -- aligns frames automatically Modified: trunk/Jmol/src/org/jmol/viewer/JmolConstants.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/JmolConstants.java 2011-12-13 20:20:16 UTC (rev 16578) +++ trunk/Jmol/src/org/jmol/viewer/JmolConstants.java 2011-12-13 20:20:39 UTC (rev 16579) @@ -786,14 +786,16 @@ */ public static boolean getAminoAcidValenceAndCharge(String res, String name, int[] ret) { - if (res == null || res.length() == 0 || name.equals("CA") + if (res == null || res.length() == 0 || res.length() > 3 || name.equals("CA") || name.equals("CB")) return false; char ch0 = name.charAt(0); char ch1 = (name.length() == 1 ? 0 : name.charAt(1)); boolean isSp2 = false; int bondCount = ret[3]; - if (res.length() == 3) { + switch (res.length()) { + case 3: + // protein, but also carbohydrate? if (name.length() == 1) { switch (ch0) { case 'N': @@ -819,8 +821,8 @@ ret[1] = -1; } } - - } else if (name.length() > 1) { + case 1: + case 2: // dna/rna if (name.length() > 2 && name.charAt(2) == '\'') return false; @@ -828,6 +830,7 @@ case 'C': if (ch1 == '7') // T CH3 return false; + break; case 'N': switch (ch1) { case '1': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |