Package ffx.potential.parsers
Class CIFFilter
java.lang.Object
ffx.potential.parsers.SystemFilter
ffx.potential.parsers.CIFFilter
The CIFFilter class parses CIF coordinate (*.CIF) files.
- Since:
- 1.0
- Author:
- Aaron J. Nessler
-
Nested Class Summary
Nested classes/interfaces inherited from class ffx.potential.parsers.SystemFilter
SystemFilter.Versioning
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Maximum atomic covalent radius for CDK Rebonder Toolstatic final double
Minimum bond distance for CDK Rebonder ToolFields inherited from class ffx.potential.parsers.SystemFilter
atomList, bondList, dieOnMissingAtom, fileRead, files, fileType, forceField, lambdaPattern, properties, standardizeAtomNames, systems, vdwH
-
Constructor Summary
ConstructorDescriptionCIFFilter
(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, boolean saveCIF) Constructor for CIFFilter on a single file and a single assembly.CIFFilter
(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, boolean saveCIF) Constructor for CIFFilter on a single file and multiple assemblies.CIFFilter
(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, boolean saveCIF) Constructor for CIFFilter on a multiple files and a single assembly. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Add bonds between atoms.void
Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.static void
collectAtoms
(Atom seed, ArrayList<Atom> atoms) Finds all atoms that are bonded to one another.static String
getAtomElement
(Atom atom) Parse atom name to determine atomic element.String[]
Obtain a list of output files written from the conversion.boolean
readFile()
This method is different for each subclass and must be overridden.boolean
readNext()
Reads the next snapshot of an archive into the activeMolecularAssembly.boolean
readNext
(boolean resetPosition) Reads the next snapshot of an archive into the activeMolecularAssembly.boolean
readNext
(boolean resetPosition, boolean print) Reads the next snapshot of an archive into the activeMolecularAssembly.boolean
readNext
(boolean resetPosition, boolean print, boolean parse) Reads the next snapshot of an archive into the activeMolecularAssembly.static void
setAtomTypes
(org.openscience.cdk.config.AtomTypeFactory factory, org.openscience.cdk.interfaces.IAtom atom) Specify the atom types for atoms created by factory.void
setBondTolerance
(double bondTolerance) Set buffer value when bonding atoms together.void
setFixLattice
(boolean fixLattice) Determine whether lattice parameters can be manipulated to follow lattice system constraints.void
Override the space group of a CIF conversion based on space group name.void
setSgNum
(int sgNum) Override the space group of a CIF conversion based on space group number.void
setZprime
(int zPrime) Override the number of copies in the asymmetric unit (Z').boolean
Save a CIF file for the given molecular assembly.boolean
Save a CIF file for the given molecular assembly.boolean
Write CIF files for multiple File objects.boolean
Write an output file.void
Write a properties file.Methods inherited from class ffx.potential.parsers.SystemFilter
applyAtomProperties, atomListToSet, countNumModels, fileRead, getActiveMolecularSystem, getAtomList, getFile, getFiles, getLastReadLambda, getMolecularAssemblyArray, getRemarkLines, getSnapshot, getType, previousVersion, setFile, setFileRead, setFiles, setForceField, setProperties, setType, setVersioning, version
-
Field Details
-
MAX_COVALENT_RADIUS
public static final double MAX_COVALENT_RADIUSMaximum atomic covalent radius for CDK Rebonder Tool- See Also:
-
MIN_BOND_DISTANCE
public static final double MIN_BOND_DISTANCEMinimum bond distance for CDK Rebonder Tool- See Also:
-
-
Constructor Details
-
CIFFilter
public CIFFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, boolean saveCIF) Constructor for CIFFilter on a single file and a single assembly.- Parameters:
file
- Input filemolecularAssembly
- Active assemblyforceField
- Force field for save file.properties
- Properties for save file.
-
CIFFilter
public CIFFilter(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, boolean saveCIF) Constructor for CIFFilter on a single file and multiple assemblies.- Parameters:
file
- Input filemolecularAssemblies
- Active assembliesforceField
- Force field for save file.properties
- Properties for save file.
-
CIFFilter
public CIFFilter(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, boolean saveCIF) Constructor for CIFFilter on a multiple files and a single assembly.- Parameters:
files
- Input filesmolecularAssembly
- Active assemblyforceField
- Force field for save file.properties
- Properties for save file.
-
-
Method Details
-
bondAtoms
Add bonds between atoms.- Parameters:
atoms
- To potentially be bonded together.
-
closeReader
public void closeReader()Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.- Specified by:
closeReader
in classSystemFilter
-
collectAtoms
Finds all atoms that are bonded to one another. See potential/Utilities/collectAtoms- Parameters:
seed
- Starting atom.atoms
- that are bonded.
-
getAtomElement
Parse atom name to determine atomic element.- Parameters:
atom
- Atom whose element we desire- Returns:
- String specifying atom element.
-
getCreatedFileNames
Obtain a list of output files written from the conversion. Used in file not committed to Git...- Returns:
- String[] containing output file names.
-
readFile
public boolean readFile()This method is different for each subclass and must be overridden.Parse the CIF File
- Specified by:
readFile
in classSystemFilter
- Returns:
- a boolean.
-
readNext
public boolean readNext()Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until theclose
method is called.- Specified by:
readNext
in classSystemFilter
- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition) Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until theclose
method is called.- Specified by:
readNext
in classSystemFilter
- Parameters:
resetPosition
- Resets to first frame.- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition, boolean print) Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until theclose
method is called.- Specified by:
readNext
in classSystemFilter
- Parameters:
resetPosition
- Resets to first frame.print
- Flag to print.- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition, boolean print, boolean parse) Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until theclose
method is called.- Specified by:
readNext
in classSystemFilter
- Parameters:
resetPosition
- Resets to first frame.print
- Flag to print.parse
- Parse data in file. May want to skip structures for parallel jobs.- Returns:
- If next model read.
-
setAtomTypes
public static void setAtomTypes(org.openscience.cdk.config.AtomTypeFactory factory, org.openscience.cdk.interfaces.IAtom atom) Specify the atom types for atoms created by factory.- Parameters:
factory
- Atom generatoratom
- Atom of interest
-
setBondTolerance
public void setBondTolerance(double bondTolerance) Set buffer value when bonding atoms together.- Parameters:
bondTolerance
- Value added to VdW radii when determining bonding.
-
setFixLattice
public void setFixLattice(boolean fixLattice) Determine whether lattice parameters can be manipulated to follow lattice system constraints.- Parameters:
fixLattice
- True if lattices should be fixed.
-
setSgName
Override the space group of a CIF conversion based on space group name.- Parameters:
sgName
- Name of the desired space group
-
setSgNum
public void setSgNum(int sgNum) Override the space group of a CIF conversion based on space group number.- Parameters:
sgNum
- Number of the desired space group
-
setZprime
public void setZprime(int zPrime) Override the number of copies in the asymmetric unit (Z').- Parameters:
zPrime
- Number of the desired space group
-
writeFiles
public boolean writeFiles()Write CIF files for multiple File objects.- Returns:
- whether conversion was successful.
-
writeFile
Save a CIF file for the given molecular assembly.- Overrides:
writeFile
in classSystemFilter
- Parameters:
saveFile
- aFile
object.append
- a boolean.- Returns:
- whether conversion was successful.
-
writeFile
Save a CIF file for the given molecular assembly.- Specified by:
writeFile
in classSystemFilter
- Parameters:
saveFile
- aFile
object.append
- a boolean.extraLines
- Additional lines to append to a comments section, or null.- Returns:
- whether conversion was successful.
-
writeOutputFile
Write an output file.- Returns:
- Whether file was written successfully.
-
writePropertiesFile
public void writePropertiesFile(String dir, String fileName, String spacegroup, List<MSNode> entities) Write a properties file.- Parameters:
dir
- String for directory location.fileName
- String for file name.spacegroup
- String for space group.entities
- List of MSNodes in assembly.
-