Package org.jmol.adapter.readers.more
Class JcampdxReader
- java.lang.Object
-
- org.jmol.adapter.smarter.AtomSetCollectionReader
-
- org.jmol.adapter.readers.molxyz.MolReader
-
- org.jmol.adapter.readers.more.JcampdxReader
-
- All Implemented Interfaces:
javajs.api.GenericLineReader,JmolJDXMOLReader
public class JcampdxReader extends MolReader implements JmolJDXMOLReader
A preliminary reader for JCAMP-DX files having ##$MODELS= and ##$PEAKS= records Designed by Robert Lancashire and Bob Hanson specifications (by example here): ##$MODELS= -- All XML data should be line-oriented in the above fashion. Leading spaces will be ignored. -- Any number ofacetophenone DSViewer 3D 0 17 17 0 0 0 0 0 0 0 0999 V2000 ... 17 14 1 0 0 0 M END 17 1 Energy: -1454.38826 Freq: 3199.35852 C -1.693100 0.007800 0.000000 -0.000980 0.000120 0.000000 ... segments can be present -- The first model is referred to as the "base" model -- The base model: -- will generally be of type MOL, but any known type is acceptable -- will be used to generate bonding for later models that have no bonding information -- will be the only model for NMR -- Additional models can represent vibrations (XYZ format) or MS fragmentation (MOL format, probably) ##$PEAKS= -- peak record must be a single line of information because Jmol will use line.trim() as a key to pass information to JSpecView....
-
-
Field Summary
Fields Modifier and Type Field Description private javajs.util.Lst<java.lang.String[]>acdAssignmentsprivate java.lang.StringacdMolFileprivate java.lang.StringallTypesprivate JmolJDXMOLParsermprprivate intnPeaksprivate java.lang.Stringnucleusprivate javajs.util.Lst<java.lang.String>peakDataprivate intselectedModelprivate java.lang.Stringtitleprivate java.lang.Stringtype-
Fields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, 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, isSequential, isTrajectory, latticeCells, latticeScaling, line, lstNCS, matUnitCellOrientation, modelNumber, ms, mustFinalizeModelSet, next, out, packingError, prevline, ptLine, ptSupercell, reader, readerName, reverseModels, sgName, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr
-
-
Constructor Summary
Constructors Constructor Description JcampdxReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPeakData(java.lang.String info)private voidaddType(int imodel, java.lang.String type)sets an auxiliaryInfo string to "HNMR 13CNMR" or "IR" or "MS"private java.lang.StringaddTypeStr(java.lang.String types, java.lang.String type)booleancheckLine()voidfinalizeSubclassReader()optional reader-specific method run first.private intfindModelById(java.lang.String modelID)voidinitializeReader()voidprocessModelData(java.lang.String data, java.lang.String id, java.lang.String type, java.lang.String base, java.lang.String last, float modelScale, float vibScale, boolean isFirst)private voidprocessPeakData()integrate therecords into the associated models, and delete unreferenced n.m models private voidprocessPeakSelectAtom(int i, java.lang.String key, java.lang.String data)private booleanprocessPeakSelectModel(int i, java.lang.String title)private voidremoveAtomSet(int imodel)note that sets must be iterated from LAST to FIRST not a general method -- would mess up if we had unit cellsprivate voidsetBonding(AtomSetCollection a, int ibase)add bonding to a set of ModelData based on a MOL file only if the this set has no bonding alreadyvoidsetSpectrumPeaks(int nH, java.lang.String piUnitsX, java.lang.String piUnitsY)private voidupdateModelIDs(java.lang.String id, int model0, boolean isFirst)The first model set is allowed to be a single model and given no extension.-
Methods inherited from class org.jmol.adapter.readers.molxyz.MolReader
addMolAtom, addMolBond, finalizeReaderMR, fixOrder
-
Methods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addJmolScript, addPrimitiveLatticeVector, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymmetryAndSetTrajectory, applySymTrajASCR, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jmol.api.JmolJDXMOLReader
discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, rd
-
-
-
-
Field Detail
-
selectedModel
private int selectedModel
-
mpr
private JmolJDXMOLParser mpr
-
acdMolFile
private java.lang.String acdMolFile
-
nPeaks
private int nPeaks
-
acdAssignments
private javajs.util.Lst<java.lang.String[]> acdAssignments
-
title
private java.lang.String title
-
nucleus
private java.lang.String nucleus
-
type
private java.lang.String type
-
peakData
private javajs.util.Lst<java.lang.String> peakData
-
allTypes
private java.lang.String allTypes
-
-
Method Detail
-
initializeReader
public void initializeReader() throws java.lang.Exception- Overrides:
initializeReaderin classMolReader- Throws:
java.lang.Exception
-
checkLine
public boolean checkLine() throws java.lang.Exception
-
finalizeSubclassReader
public void finalizeSubclassReader() throws java.lang.ExceptionDescription copied from class:AtomSetCollectionReaderoptional reader-specific method run first.- Overrides:
finalizeSubclassReaderin classMolReader- Throws:
java.lang.Exception
-
processModelData
public void processModelData(java.lang.String data, java.lang.String id, java.lang.String type, java.lang.String base, java.lang.String last, float modelScale, float vibScale, boolean isFirst) throws java.lang.Exception- Specified by:
processModelDatain interfaceJmolJDXMOLReader- Throws:
java.lang.Exception
-
setBonding
private void setBonding(AtomSetCollection a, int ibase)
add bonding to a set of ModelData based on a MOL file only if the this set has no bonding already- Parameters:
a-ibase-
-
updateModelIDs
private void updateModelIDs(java.lang.String id, int model0, boolean isFirst)The first model set is allowed to be a single model and given no extension. All other model sets are given .1 .2 .3 ... extensions to their IDs.- Parameters:
id-model0-isFirst-
-
addPeakData
public void addPeakData(java.lang.String info)
- Specified by:
addPeakDatain interfaceJmolJDXMOLReader
-
processPeakData
private void processPeakData()
integrate therecords into the associated models, and delete unreferenced n.m models
-
findModelById
private int findModelById(java.lang.String modelID)
-
addType
private void addType(int imodel, java.lang.String type)sets an auxiliaryInfo string to "HNMR 13CNMR" or "IR" or "MS"- Parameters:
imodel-type-
-
addTypeStr
private java.lang.String addTypeStr(java.lang.String types, java.lang.String type)
-
processPeakSelectAtom
private void processPeakSelectAtom(int i, java.lang.String key, java.lang.String data)
-
processPeakSelectModel
private boolean processPeakSelectModel(int i, java.lang.String title)
-
setSpectrumPeaks
public void setSpectrumPeaks(int nH, java.lang.String piUnitsX, java.lang.String piUnitsY)- Specified by:
setSpectrumPeaksin interfaceJmolJDXMOLReader
-
removeAtomSet
private void removeAtomSet(int imodel)
note that sets must be iterated from LAST to FIRST not a general method -- would mess up if we had unit cells- Parameters:
imodel-
-
-