Package org.jmol.adapter.readers.cif
Class MMCifReader
- java.lang.Object
-
- org.jmol.adapter.smarter.AtomSetCollectionReader
-
- org.jmol.adapter.readers.cif.CifReader
-
- org.jmol.adapter.readers.cif.MMCifReader
-
- All Implemented Interfaces:
javajs.api.GenericLineReader
- Direct Known Subclasses:
MMTFReader
public class MMCifReader extends CifReader
mmCIF files are recognized prior to class creation. Required fields include one of: _entry.id _database_PDB_ _pdbx_ _chem_comp.pdbx_type _audit_author.name _atom_site.- Author:
- Bob Hanson (hansonr@stolaf.edu)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jmol.adapter.readers.cif.CifReader
CifReader.Parser
-
-
Field Summary
Fields Modifier and Type Field Description private static byteASSEM_IDprivate static byteASSEM_LISTprivate static byteASSEM_OPERSprivate static String[]assemblyFieldsprivate Map<String,javajs.util.BS>assemblyIdAtomsprivate static byteBEG_ASYM_IDprivate static byteBEG_INS_CODEprivate static byteBEG_SEQ_IDprivate booleanbyChainprivate booleanbySymopprivate int[]chainAtomCountprivate Map<String,int[]>chainAtomCountsprivate Map<String,javajs.util.P3>chainAtomMapprivate javajs.util.P3chainSumprivate static byteCHEM_COMP_BOND_AROMATIC_FLAGprivate static byteCHEM_COMP_BOND_ATOM_ID_1private static byteCHEM_COMP_BOND_ATOM_ID_2private static byteCHEM_COMP_BOND_IDprivate static byteCHEM_COMP_BOND_VALUE_ORDERprivate static byteCHEM_COMP_IDprivate static byteCHEM_COMP_NAMEprivate static String[]chemCompBondFieldsprivate static String[]chemCompFieldsprivate static byteCONF_TYPE_IDprotected booleandoneprivate booleandoSetBondsprivate static byteEND_ASYM_IDprivate static byteEND_INS_CODEprivate static byteEND_SEQ_IDprivate static StringFAMILY_ASSEM_CATprivate static StringFAMILY_CHEMCOMP_CATprivate static StringFAMILY_COMPBONDprivate static StringFAMILY_COMPBOND_CATprivate static StringFAMILY_NCSprivate static StringFAMILY_NCS_CATprivate static StringFAMILY_OPERprivate static StringFAMILY_OPER_CATprivate static StringFAMILY_SEQUENCEDIF_CATprivate static StringFAMILY_SHEETprivate static StringFAMILY_SHEET_CATprivate static StringFAMILY_STRUCSITEprivate static StringFAMILY_STRUCSITE_CATprivate static StringFAMILY_STRUCTCONFprivate static StringFAMILY_STRUCTCONF_CATprivate static StringFAMILY_STRUCTCONNprivate static StringFAMILY_STRUCTCONN_CATprivate static byteHELIX_CLASSprivate Map<String,javajs.util.M4>htBiomtsprivate Map<String,javajs.util.Lst<Object[]>>htBondMapprotected Map<String,String>htHeteroprotected Map<String,Map<String,Object>>htSitesprotected booleanisBiomoleculeprivate booleanisLigandBondBug(package private) javajs.util.M4midentprivate intmodelIndexprivate StringmodelStringsprivate static String[]ncsoperFieldsprivate static byteOPER_IDprivate static byteOPER_XYZprivate static String[]operFieldsprivate booleanrequiresSortingprivate static byteSERIAL_NOprivate static byteSHEET_IDprivate static byteSITE_ASYM_IDprivate static byteSITE_COMP_IDprivate static byteSITE_IDprivate static byteSITE_INS_CODEprivate static byteSITE_SEQ_IDprivate static byteSTRAND_IDprivate static byteSTRUCT_CONN_ALT1private static byteSTRUCT_CONN_ALT2private static byteSTRUCT_CONN_ASYM1private static byteSTRUCT_CONN_ASYM2private static byteSTRUCT_CONN_ATOM1private static byteSTRUCT_CONN_ATOM2private static byteSTRUCT_CONN_COMP1private static byteSTRUCT_CONN_COMP2private static byteSTRUCT_CONN_ORDERprivate static byteSTRUCT_CONN_SEQ1private static byteSTRUCT_CONN_SEQ2private static byteSTRUCT_CONN_SYMM1private static byteSTRUCT_CONN_SYMM2private static byteSTRUCT_CONN_TYPEprivate static byteSTRUCT_IDprivate static byteSTRUCT_REF_G1private static byteSTRUCT_REF_G3private static String[]structConfFieldsprivate static String[]structConnFieldsprivate StringstructConnListprivate javajs.util.Lst<Object[]>structConnMapprivate static String[]structRefFieldsprivate static String[]structSheetRangeFieldsprivate static String[]structSiteFieldsprivate intthisChainprotected javajs.util.Lst<Map<String,Object>>vBiomolecules-
Fields inherited from class org.jmol.adapter.readers.cif.CifReader
ac, cifParser, col2key, data, FAMILY_ATOM, field, firstChar, haveCellWaveVector, haveHAtoms, htGroup1, iHaveDesiredModel, isCourseGrained, isLigand, isMagCIF, isMMCIF, key, key0, key2col, lastDataSetName, maxSerial, modelMap, nAtoms, nAtoms0, NONE, pdbID, skipping, subParser, thisDataSetName, useAuthorChainID
-
Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, binaryDoc, bsFilter, bsModels, calculationType, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, line, lstNCS, matUnitCellOrientation, modDim, modelNumber, ms, mustFinalizeModelSet, next, out, packingError, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr
-
-
Constructor Summary
Constructors Constructor Description MMCifReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAssembly(String[] assem)protected voidaddHetero(String groupName, String hetName, boolean doCheck, boolean addNote)protected voidaddMatrix(String id, javajs.util.M4 m4, boolean isNCS)private voidaddStructure(Structure structure)protected voidcheckFilterAssembly(String id, Map<String,Object> info)protected intcheckPDBModelField(int modelField, int currentModelNo)protected booleancheckSubclassSymmetry()private voidcreateParticle(String id)private StringcrossBinary(String ops1, String ops2)private StringdecodeAssemblyOperators(String ops)protected booleanfinalizeSubclass()private javajs.util.M4getOpMatrix(String ops)protected intincrementModel(int modelNo)protected voidinitSubclass()private booleanprocessAssemblyGenBlock()private voidprocessBonds(javajs.util.Lst<Object[]> cmap, Map<Object,Integer> map, boolean isStructConn)private booleanprocessChemCompLoopBlock()a general name definition field.private booleanprocessCompBondLoopBlock()private booleanprocessSequence()get canonical 1-letter DNA/RNA sequence code from 3-letter code.private booleanprocessStructConfLoopBlock()identifies ranges for HELIX and TURNprivate booleanprocessStructConnLoopBlock()private booleanprocessStructOperListBlock(boolean isNCS)private booleanprocessStructSheetRangeLoopBlock()identifies sheet rangesprivate booleanprocessStructSiteBlock()identifies structure sitesbooleanprocessSubclassAtom(Atom atom, String assemblyId, String strChain)protected voidprocessSubclassEntry()protected booleanprocessSubclassLoopBlock()private intsetBiomolecule(Map<String,Object> biomolecule, javajs.util.BS bsAll)private voidsetBiomolecules()private voidsetBonds()Note that setting bonds from _struct_conn is only done if we have updated CIF files, which include _chem_comp_bond.private voidsetHetero()protected voidsortAssemblyModels()issue here is that mmCIF assembly atoms can be in different blocks by chain: Model1:Chain1 Model2:Chain1 Model1:Chain2 Model2:Chain2 ...-
Methods inherited from class org.jmol.adapter.readers.cif.CifReader
addHeader, applySymmetryAndSetTrajectory, checkAllFieldsPresent, doPreSymmetry, fieldProperty, filterCIFAtom, finalizeSubclassReader, finalizeSubclassSymmetry, getBondOrder, getCifDataParser, getField, initializeReader, isNull, newModel, nextAtomSet, parseLoopParameters, parseLoopParametersFor, processAtomSiteLoopBlock, processLoopBlock
-
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymTrajASCR, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLine, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, processDOM, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
-
-
-
Field Detail
-
isBiomolecule
protected boolean isBiomolecule
-
byChain
private boolean byChain
-
bySymop
private boolean bySymop
-
thisChain
private int thisChain
-
modelIndex
private int modelIndex
-
chainSum
private javajs.util.P3 chainSum
-
chainAtomCount
private int[] chainAtomCount
-
isLigandBondBug
private boolean isLigandBondBug
-
mident
javajs.util.M4 mident
-
requiresSorting
private boolean requiresSorting
-
OPER_ID
private static final byte OPER_ID
- See Also:
- Constant Field Values
-
OPER_XYZ
private static final byte OPER_XYZ
- See Also:
- Constant Field Values
-
FAMILY_NCS_CAT
private static final String FAMILY_NCS_CAT
- See Also:
- Constant Field Values
-
FAMILY_NCS
private static final String FAMILY_NCS
- See Also:
- Constant Field Values
-
ncsoperFields
private static final String[] ncsoperFields
-
FAMILY_OPER_CAT
private static final String FAMILY_OPER_CAT
- See Also:
- Constant Field Values
-
FAMILY_OPER
private static final String FAMILY_OPER
- See Also:
- Constant Field Values
-
operFields
private static final String[] operFields
-
ASSEM_ID
private static final byte ASSEM_ID
- See Also:
- Constant Field Values
-
ASSEM_OPERS
private static final byte ASSEM_OPERS
- See Also:
- Constant Field Values
-
ASSEM_LIST
private static final byte ASSEM_LIST
- See Also:
- Constant Field Values
-
FAMILY_ASSEM_CAT
private static final String FAMILY_ASSEM_CAT
- See Also:
- Constant Field Values
-
assemblyFields
private static final String[] assemblyFields
-
FAMILY_SEQUENCEDIF_CAT
private static final String FAMILY_SEQUENCEDIF_CAT
- See Also:
- Constant Field Values
-
STRUCT_REF_G3
private static final byte STRUCT_REF_G3
- See Also:
- Constant Field Values
-
STRUCT_REF_G1
private static final byte STRUCT_REF_G1
- See Also:
- Constant Field Values
-
structRefFields
private static final String[] structRefFields
-
CHEM_COMP_ID
private static final byte CHEM_COMP_ID
- See Also:
- Constant Field Values
-
CHEM_COMP_NAME
private static final byte CHEM_COMP_NAME
- See Also:
- Constant Field Values
-
FAMILY_CHEMCOMP_CAT
private static final String FAMILY_CHEMCOMP_CAT
- See Also:
- Constant Field Values
-
chemCompFields
private static final String[] chemCompFields
-
CONF_TYPE_ID
private static final byte CONF_TYPE_ID
- See Also:
- Constant Field Values
-
BEG_ASYM_ID
private static final byte BEG_ASYM_ID
- See Also:
- Constant Field Values
-
BEG_SEQ_ID
private static final byte BEG_SEQ_ID
- See Also:
- Constant Field Values
-
BEG_INS_CODE
private static final byte BEG_INS_CODE
- See Also:
- Constant Field Values
-
END_ASYM_ID
private static final byte END_ASYM_ID
- See Also:
- Constant Field Values
-
END_SEQ_ID
private static final byte END_SEQ_ID
- See Also:
- Constant Field Values
-
END_INS_CODE
private static final byte END_INS_CODE
- See Also:
- Constant Field Values
-
STRUCT_ID
private static final byte STRUCT_ID
- See Also:
- Constant Field Values
-
SERIAL_NO
private static final byte SERIAL_NO
- See Also:
- Constant Field Values
-
HELIX_CLASS
private static final byte HELIX_CLASS
- See Also:
- Constant Field Values
-
FAMILY_STRUCTCONF_CAT
private static final String FAMILY_STRUCTCONF_CAT
- See Also:
- Constant Field Values
-
FAMILY_STRUCTCONF
private static final String FAMILY_STRUCTCONF
- See Also:
- Constant Field Values
-
structConfFields
private static final String[] structConfFields
-
SHEET_ID
private static final byte SHEET_ID
- See Also:
- Constant Field Values
-
STRAND_ID
private static final byte STRAND_ID
- See Also:
- Constant Field Values
-
FAMILY_SHEET_CAT
private static final String FAMILY_SHEET_CAT
- See Also:
- Constant Field Values
-
FAMILY_SHEET
private static final String FAMILY_SHEET
- See Also:
- Constant Field Values
-
structSheetRangeFields
private static final String[] structSheetRangeFields
-
SITE_ID
private static final byte SITE_ID
- See Also:
- Constant Field Values
-
SITE_COMP_ID
private static final byte SITE_COMP_ID
- See Also:
- Constant Field Values
-
SITE_ASYM_ID
private static final byte SITE_ASYM_ID
- See Also:
- Constant Field Values
-
SITE_SEQ_ID
private static final byte SITE_SEQ_ID
- See Also:
- Constant Field Values
-
SITE_INS_CODE
private static final byte SITE_INS_CODE
- See Also:
- Constant Field Values
-
FAMILY_STRUCSITE_CAT
private static final String FAMILY_STRUCSITE_CAT
- See Also:
- Constant Field Values
-
FAMILY_STRUCSITE
private static final String FAMILY_STRUCSITE
- See Also:
- Constant Field Values
-
structSiteFields
private static final String[] structSiteFields
-
STRUCT_CONN_ASYM1
private static final byte STRUCT_CONN_ASYM1
- See Also:
- Constant Field Values
-
STRUCT_CONN_SEQ1
private static final byte STRUCT_CONN_SEQ1
- See Also:
- Constant Field Values
-
STRUCT_CONN_COMP1
private static final byte STRUCT_CONN_COMP1
- See Also:
- Constant Field Values
-
STRUCT_CONN_ATOM1
private static final byte STRUCT_CONN_ATOM1
- See Also:
- Constant Field Values
-
STRUCT_CONN_ALT1
private static final byte STRUCT_CONN_ALT1
- See Also:
- Constant Field Values
-
STRUCT_CONN_SYMM1
private static final byte STRUCT_CONN_SYMM1
- See Also:
- Constant Field Values
-
STRUCT_CONN_ASYM2
private static final byte STRUCT_CONN_ASYM2
- See Also:
- Constant Field Values
-
STRUCT_CONN_SEQ2
private static final byte STRUCT_CONN_SEQ2
- See Also:
- Constant Field Values
-
STRUCT_CONN_COMP2
private static final byte STRUCT_CONN_COMP2
- See Also:
- Constant Field Values
-
STRUCT_CONN_ATOM2
private static final byte STRUCT_CONN_ATOM2
- See Also:
- Constant Field Values
-
STRUCT_CONN_ALT2
private static final byte STRUCT_CONN_ALT2
- See Also:
- Constant Field Values
-
STRUCT_CONN_SYMM2
private static final byte STRUCT_CONN_SYMM2
- See Also:
- Constant Field Values
-
STRUCT_CONN_TYPE
private static final byte STRUCT_CONN_TYPE
- See Also:
- Constant Field Values
-
STRUCT_CONN_ORDER
private static final byte STRUCT_CONN_ORDER
- See Also:
- Constant Field Values
-
FAMILY_STRUCTCONN_CAT
private static final String FAMILY_STRUCTCONN_CAT
- See Also:
- Constant Field Values
-
FAMILY_STRUCTCONN
private static final String FAMILY_STRUCTCONN
- See Also:
- Constant Field Values
-
structConnFields
private static final String[] structConnFields
-
structConnMap
private javajs.util.Lst<Object[]> structConnMap
-
structConnList
private String structConnList
-
doSetBonds
private boolean doSetBonds
-
CHEM_COMP_BOND_ID
private static final byte CHEM_COMP_BOND_ID
- See Also:
- Constant Field Values
-
CHEM_COMP_BOND_ATOM_ID_1
private static final byte CHEM_COMP_BOND_ATOM_ID_1
- See Also:
- Constant Field Values
-
CHEM_COMP_BOND_ATOM_ID_2
private static final byte CHEM_COMP_BOND_ATOM_ID_2
- See Also:
- Constant Field Values
-
CHEM_COMP_BOND_VALUE_ORDER
private static final byte CHEM_COMP_BOND_VALUE_ORDER
- See Also:
- Constant Field Values
-
CHEM_COMP_BOND_AROMATIC_FLAG
private static final byte CHEM_COMP_BOND_AROMATIC_FLAG
- See Also:
- Constant Field Values
-
FAMILY_COMPBOND_CAT
private static final String FAMILY_COMPBOND_CAT
- See Also:
- Constant Field Values
-
FAMILY_COMPBOND
private static final String FAMILY_COMPBOND
- See Also:
- Constant Field Values
-
chemCompBondFields
private static final String[] chemCompBondFields
-
modelStrings
private String modelStrings
-
done
protected boolean done
-
-
Method Detail
-
initSubclass
protected void initSubclass()
- Overrides:
initSubclassin classCifReader
-
processSubclassEntry
protected void processSubclassEntry() throws Exception- Overrides:
processSubclassEntryin classCifReader- Throws:
Exception
-
processSubclassLoopBlock
protected boolean processSubclassLoopBlock() throws Exception- Overrides:
processSubclassLoopBlockin classCifReader- Throws:
Exception
-
sortAssemblyModels
protected void sortAssemblyModels()
issue here is that mmCIF assembly atoms can be in different blocks by chain: Model1:Chain1 Model2:Chain1 Model1:Chain2 Model2:Chain2 ... and so assigned to too many atom sets.
-
finalizeSubclass
protected boolean finalizeSubclass() throws Exception- Overrides:
finalizeSubclassin classCifReader- Throws:
Exception
-
checkSubclassSymmetry
protected boolean checkSubclassSymmetry()
- Overrides:
checkSubclassSymmetryin classCifReader
-
setBonds
private void setBonds()
Note that setting bonds from _struct_conn is only done if we have updated CIF files, which include _chem_comp_bond.
-
processBonds
private void processBonds(javajs.util.Lst<Object[]> cmap, Map<Object,Integer> map, boolean isStructConn)
-
processSequence
private boolean processSequence() throws Exceptionget canonical 1-letter DNA/RNA sequence code from 3-letter code. For example, "2MG" → "G"- Returns:
- true
- Throws:
Exception
-
processAssemblyGenBlock
private boolean processAssemblyGenBlock() throws Exception- Throws:
Exception
-
processStructOperListBlock
private boolean processStructOperListBlock(boolean isNCS) throws Exception- Throws:
Exception
-
addMatrix
protected void addMatrix(String id, javajs.util.M4 m4, boolean isNCS)
-
processChemCompLoopBlock
private boolean processChemCompLoopBlock() throws Exceptiona general name definition field. Not all hetero- Returns:
- true if successful; false to skip
- Throws:
Exception
-
addHetero
protected void addHetero(String groupName, String hetName, boolean doCheck, boolean addNote)
-
processStructConfLoopBlock
private boolean processStructConfLoopBlock() throws Exceptionidentifies ranges for HELIX and TURN- Returns:
- true if successful; false to skip
- Throws:
Exception
-
addStructure
private void addStructure(Structure structure)
-
processStructSheetRangeLoopBlock
private boolean processStructSheetRangeLoopBlock() throws Exceptionidentifies sheet ranges- Returns:
- true if successful; false to skip
- Throws:
Exception
-
processStructSiteBlock
private boolean processStructSiteBlock() throws Exceptionidentifies structure sites- Returns:
- true if successful; false to skip
- Throws:
Exception
-
setBiomolecules
private void setBiomolecules()
-
createParticle
private void createParticle(String id)
-
getOpMatrix
private javajs.util.M4 getOpMatrix(String ops)
-
processStructConnLoopBlock
private boolean processStructConnLoopBlock() throws Exception- Throws:
Exception
-
processCompBondLoopBlock
private boolean processCompBondLoopBlock() throws Exception- Throws:
Exception
-
processSubclassAtom
public boolean processSubclassAtom(Atom atom, String assemblyId, String strChain)
- Overrides:
processSubclassAtomin classCifReader- Returns:
- true if valid atom
-
checkPDBModelField
protected int checkPDBModelField(int modelField, int currentModelNo) throws Exception- Overrides:
checkPDBModelFieldin classCifReader- Returns:
- new currentModelNo
- Throws:
Exception
-
setHetero
private void setHetero()
-
-