Class CIFFilter

java.lang.Object
ffx.potential.parsers.SystemFilter
ffx.potential.parsers.CIFFilter

public class CIFFilter extends SystemFilter
The CIFFilter class parses CIF coordinate (*.CIF) files.
Since:
1.0
Author:
Aaron J. Nessler
  • Field Details

    • MAX_COVALENT_RADIUS

      public static final double MAX_COVALENT_RADIUS
      Maximum atomic covalent radius for CDK Rebonder Tool
      See Also:
    • MIN_BOND_DISTANCE

      public static final double MIN_BOND_DISTANCE
      Minimum 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 file
      molecularAssembly - Active assembly
      forceField - 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 file
      molecularAssemblies - Active assemblies
      forceField - 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 files
      molecularAssembly - Active assembly
      forceField - Force field for save file.
      properties - Properties for save file.
  • Method Details

    • bondAtoms

      public static int bondAtoms(Atom[] atoms, double bondTolerance)
      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 class SystemFilter
    • collectAtoms

      public static void collectAtoms(Atom seed, ArrayList<Atom> atoms)
      Finds all atoms that are bonded to one another. See potential/Utilities/collectAtoms
      Parameters:
      seed - Starting atom.
      atoms - that are bonded.
    • findMaxLessIndex

      public int findMaxLessIndex(ArrayList<ArrayList<Atom>> xyzAtomLists, int currentList)
      Find the maximum index that is less than those contained in current model.
      Parameters:
      xyzAtomLists - ArrayList containing ArrayList of atoms in each entity
      currentList - Entity of currently being used.
      Returns:
      Maximum index that is less than indices in current entity.
    • getAtomElement

      public static String getAtomElement(Atom atom)
      Parse atom name to determine atomic element.
      Parameters:
      atom - Atom whose element we desire
      Returns:
      String specifying atom element.
    • getCreatedFileNames

      public String[] 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 class SystemFilter
      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 the close method is called.
      Specified by:
      readNext in class SystemFilter
      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 the close method is called.
      Specified by:
      readNext in class SystemFilter
      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 the close method is called.
      Specified by:
      readNext in class SystemFilter
      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 the close method is called.
      Specified by:
      readNext in class SystemFilter
      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 generator
      atom - 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

      public void setSgName(String sgName)
      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

      public boolean writeFile(File saveFile, boolean append)
      Save a CIF file for the given molecular assembly.
      Overrides:
      writeFile in class SystemFilter
      Parameters:
      saveFile - a File object.
      append - a boolean.
      Returns:
      whether conversion was successful.
    • writeFile

      public boolean writeFile(File saveFile, boolean append, String[] extraLines)
      Save a CIF file for the given molecular assembly.
      Specified by:
      writeFile in class SystemFilter
      Parameters:
      saveFile - a File object.
      append - a boolean.
      extraLines - Additional lines to append to a comments section, or null.
      Returns:
      whether conversion was successful.
    • writeOutputFile

      public boolean writeOutputFile(MolecularAssembly ma)
      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.