From: Michael T H. <mic...@us...> - 2003-01-25 17:28:55
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory sc8-pr-cvs1:/tmp/cvs-serv21842 Modified Files: ProteinProp.java Log Message: most predefined sets now functioning Index: ProteinProp.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ProteinProp.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ProteinProp.java 22 Jan 2003 15:02:57 -0000 1.5 --- ProteinProp.java 25 Jan 2003 17:28:52 -0000 1.6 *************** *** 33,36 **** --- 33,37 ---- public String recordPdb; byte resid; + byte atomID; public ProteinProp(String recordPdb) { *************** *** 39,42 **** --- 40,45 ---- Integer resInt = (Integer)htResidue.get(recordPdb.substring(17, 20)); resid = (resInt != null) ? (byte)resInt.intValue() : -1; + Integer atomInt = (Integer)htAtom.get(getName()); + atomID = (atomInt != null) ? (byte)atomInt.intValue() : -1; } *************** *** 61,64 **** --- 64,77 ---- } + public byte getAtomID() { + return atomID; + } + + public String getAtomName() { + if (atomID > -1) + return atomNames[atomID]; + return getName(); + } + public boolean isResidueNameMatch(String strWildcard) { if (strWildcard.length() != 3) { *************** *** 101,108 **** } - public boolean isAmino() { - return resid != -1 && resid < 23; - } - static String[] residues = { // tabel taken from rasmol source molecule.h --- 114,117 ---- *************** *** 144,147 **** --- 153,201 ---- for (int i = 0; i < residues.length; ++i) { htResidue.put(residues[i], new Integer(i)); + } + } + + public final static int ATOM_BACKBONE_MIN = 0; + public final static int ATOM_BACKBONE_MAX = 3; + public final static int ATOM_SHAPELY_MAX = 7; + public final static int ATOM_NUCLEIC_BACKBONE_MIN = 7; + public final static int ATOM_NICLEIC_BACKBONE_MAX = 18; + + static String[] atomNames = { + "N", // 0 + "CA", + "C", + "O", // 3 + "C'", // 4 + "OT", + "S", + "P", // 7 + "O1P", + "O2P", + "O5*", + "C5*", + "C4*", + "O4*", + "C3*", + "O3*", + "C2*", + "O2*", + "C1*", + "CA2", + "SG", + "N1", + "N2", + "N3", + "N4", + "N6", + "O2", + "O4", + "O6" + }; + + private static Hashtable htAtom = new Hashtable(); + static { + for (int i = 0; i < atomNames.length; ++i) { + htAtom.put(atomNames[i], new Integer(i)); } } |