# 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:
  `GenericLineReader`

Direct Known Subclasses:
  `BCIFReader, 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)

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final String`
`CAT_ASSEM`
`protected static final String`
`CAT_CHEMCOMP`
`protected static final String`
`CAT_COMPBOND`
`protected static final String`
`CAT_NCS`
`protected static final String`
`CAT_OPER`
`protected static final String`
`CAT_SEQUENCEDIF`
`protected static final String`
`CAT_SHEET`
`protected static final String`
`CAT_STRUCSITE`
`protected static final String`
`CAT_STRUCTCONF`
`protected static final String`
`CAT_STRUCTCONN`
`protected boolean`
`done`
`protected Map<String,String>`
`htHetero`
`protected Map<String, Map<String,Object>>`
`htSites`
`protected boolean`
`isBiomolecule`
`protected Lst<Map<String,Object>>`
`vBiomolecules`

### Fields inherited from class CifReader

`ac, CAT_ATOM_SITE, CAT_ATOM_SITES, CAT_ATOM_TYPE, CAT_CELL, EMPTY, firstChar, htGroup1, iHaveDesiredModel, isCourseGrained, isLigand, isLoop, isMagCIF, isMMCIF, isSpinCIF, lastDataSetName, maxSerial, modelMap, nAtoms, nAtoms0, NONE, pdbID, skipping, symops, thisDataSetName, useAuthorChainID`

### Fields inherited from class AtomSetCollectionReader

`addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, baseBondIndex, binaryDoc, bsFilter, bsModels, calculationType, CELL_TYPE_CONVENTIONAL, CELL_TYPE_PRIMITIVE, CELL_TYPE_SUPER, cellSlop, centroidPacked, checkNearAtoms, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filteredPrecision, filterHetero, floatifyJavaDouble, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isSUPERCELL, isTrajectory, latticeCells, latticeScaling, latticeType, line, lowPrecision, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noMinimize, noPack, optimize2D, out, paramsCentroid, paramsLattice, precision, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, slabXY, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr`

## Constructor Summary

Constructors
Constructor
Description
`MMCifReader()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addAssembly(String[] assem)`
`protected void`
`addHetero(String groupName, String hetName, String groupType, boolean doCheck, boolean addNote)`
`protected void`
`addMatrix(String id, M4 m4, boolean isNCS)`
`protected void`
`checkFilterAssembly(String id, Map<String,Object> info)`
`protected int`
`checkPDBModelField(int modelField, int currentModelNo)`
`protected boolean`
`checkSubclassSymmetry()`
/////////////////////////////////////////////////////////////
`protected boolean`
`finalizeSubclass()`
`protected int`
`incrementModel(int modelNo)`
`protected void`
`initSubclass()`
`protected int`
`parseIntFieldTok(byte tok)`
`protected boolean`
`processAssemblyGenBlock()`
`protected boolean`
`processChemCompLoopBlock()`
a general name definition field.
`protected boolean`
`processCompBondLoopBlock()`
`protected boolean`
`processSequence()`
get canonical 1-letter DNA/RNA sequence code from 3-letter code.
`protected boolean`
`processStructConfLoopBlock()`
identifies ranges for HELIX and TURN
`protected boolean`
`processStructConnLoopBlock()`
`protected boolean`
`processStructOperListBlock(boolean isNCS)`
`protected boolean`
`processStructSheetRangeLoopBlock()`
identifies sheet ranges
`protected boolean`
`processStructSiteBlock()`
identifies structure sites
`boolean`
`processSubclassAtom(Atom atom, String assemblyId, String strChain)`
`protected void`
`processSubclassEntry()`
`protected boolean`
`processSubclassLoopBlock()`
`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 ...

### Methods inherited from class CifReader

`addCifAtom, addHeader, applySymmetryAndSetTrajectory, checkAllFieldsPresent, doPreSymmetry, fieldProperty, filterCIFAtom, finalizeSubclassReader, finalizeSubclassSymmetry, fullTrim, getBondOrder, getCifDataParser, getFieldString, getFloatColumnData, initializeReader, isFieldValid, isLoopKey, isNull, newModel, nextAtomSet, parseCartesianField, parseFloatField, parseIntField, parseLoopParameters, processAtomTypeLoopBlock, processCellParameter, processCitationListBlock, processLoopBlock, processUnitCellTransformMatrix, setSymmetryOperator, skipLoop, skipLoopKeyword`

### Methods inherited from class AtomSetCollectionReader

`addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addMoreUnitCellInfo, addSites, addSiteScript, appendLoadNote, applySymTrajASCR, checkAndRemoveFilterKey, 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, fixDoubleA, fixFloatA, fixFloatPt, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getPackingRangeValue, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parsePrecision, 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, setPrecision, setSpaceGroupName, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR, warnSkippingOperation`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### isBiomolecule

protected boolean isBiomolecule

### vBiomolecules

protected Lst<Map<String,Object>> vBiomolecules

### htSites

protected Map<String, Map<String,Object>> htSites

### htHetero

protected Map<String,String> htHetero

### CAT_NCS

protected static final String CAT_NCS

See Also:
  - Constant Field Values

### CAT_OPER

protected static final String CAT_OPER

See Also:
  - Constant Field Values

### CAT_ASSEM

protected static final String CAT_ASSEM

See Also:
  - Constant Field Values

### CAT_SEQUENCEDIF

protected static final String CAT_SEQUENCEDIF

See Also:
  - Constant Field Values

### CAT_CHEMCOMP

protected static final String CAT_CHEMCOMP

See Also:
  - Constant Field Values

### CAT_STRUCTCONF

protected static final String CAT_STRUCTCONF

See Also:
  - Constant Field Values

### CAT_SHEET

protected static final String CAT_SHEET

See Also:
  - Constant Field Values

### CAT_STRUCSITE

protected static final String CAT_STRUCSITE

See Also:
  - Constant Field Values

### CAT_STRUCTCONN

protected static final String CAT_STRUCTCONN

See Also:
  - Constant Field Values

### CAT_COMPBOND

protected static final String CAT_COMPBOND

See Also:
  - Constant Field Values

### done

protected boolean done

## Constructor Details

### MMCifReader

public MMCifReader()

## Method Details

### initSubclass

protected void initSubclass()

Overrides:
  `initSubclass` in class `CifReader`

### processSubclassEntry

protected void processSubclassEntry() throws Exception

Overrides:
  `processSubclassEntry` in class `CifReader`
Throws:
  `Exception`

### processSubclassLoopBlock

protected boolean processSubclassLoopBlock() throws Exception

Overrides:
  `processSubclassLoopBlock` in class `CifReader`
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:
  `finalizeSubclass` in class `CifReader`
Throws:
  `Exception`

### checkSubclassSymmetry

protected boolean checkSubclassSymmetry()
/////////////////////////////////////////////////////////////

Overrides:
  `checkSubclassSymmetry` in class `CifReader`

### processSequence

protected boolean processSequence() throws Exception
get canonical 1-letter DNA/RNA sequence code from 3-letter code. For example, "2MG" --> "G"

Returns:
  true
Throws:
  `Exception`

### processAssemblyGenBlock

protected boolean processAssemblyGenBlock() throws Exception

Throws:
  `Exception`

### addAssembly

protected void addAssembly(String[] assem) throws Exception

Throws:
  `Exception`

### checkFilterAssembly

protected void checkFilterAssembly(String id, Map<String,Object> info)

### processStructOperListBlock

protected boolean processStructOperListBlock(boolean isNCS) throws Exception

Throws:
  `Exception`

### addMatrix

protected void addMatrix(String id, M4 m4, boolean isNCS)

### processChemCompLoopBlock

protected boolean processChemCompLoopBlock() throws Exception
a general name definition field. Not all hetero

Returns:
  true if successful; false to skip
Throws:
  `Exception`

### addHetero

protected void addHetero(String groupName, String hetName, String groupType, boolean doCheck, boolean addNote)

### processStructConfLoopBlock

protected boolean processStructConfLoopBlock() throws Exception
identifies ranges for HELIX and TURN

Returns:
  true if successful; false to skip
Throws:
  `Exception`

### parseIntFieldTok

protected int parseIntFieldTok(byte tok)

### processStructSheetRangeLoopBlock

protected boolean processStructSheetRangeLoopBlock() throws Exception
identifies sheet ranges

Returns:
  true if successful; false to skip
Throws:
  `Exception`

### processStructSiteBlock

protected boolean processStructSiteBlock() throws Exception
identifies structure sites

Returns:
  true if successful; false to skip
Throws:
  `Exception`

### processStructConnLoopBlock

protected boolean processStructConnLoopBlock() throws Exception

Throws:
  `Exception`

### processCompBondLoopBlock

protected boolean processCompBondLoopBlock() throws Exception

Throws:
  `Exception`

### processSubclassAtom

public boolean processSubclassAtom(Atom atom, String assemblyId, String strChain)

Overrides:
  `processSubclassAtom` in class `CifReader`
Parameters:
  `atom` -
  `assemblyId` -
  `strChain` -
Returns:
  true if valid atom

### checkPDBModelField

protected int checkPDBModelField(int modelField, int currentModelNo) throws Exception

Overrides:
  `checkPDBModelField` in class `CifReader`
Parameters:
  `modelField` -
  `currentModelNo` -
Returns:
  new currentModelNo
Throws:
  `Exception`

### incrementModel

protected int incrementModel(int modelNo) throws Exception

Throws:
  `Exception`