Class PDBFilter

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

public final class PDBFilter extends SystemFilter
The PDBFilter class parses data from a Protein DataBank (*.PDB) file. The following records are recognized: ANISOU, ATOM, CONECT, CRYST1, END, HELIX, HETATM, LINK, SHEET, SSBOND, REMARK. The rest are currently ignored.
Since:
1.0
Author:
Michael J. Schnieders
See Also:
  • Constructor Details

    • PDBFilter

      public PDBFilter(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties)
      Constructor for PDBFilter.
      Parameters:
      files - a List object.
      molecularAssembly - a MolecularAssembly object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
    • PDBFilter

      public PDBFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties)
      Parse the PDB File from a URL.
      Parameters:
      file - a File object.
      molecularAssembly - a MolecularAssembly object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
    • PDBFilter

      public PDBFilter(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties)
      Parse the PDB File from a URL.
      Parameters:
      file - a File object.
      molecularAssemblies - a List object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
    • PDBFilter

      public PDBFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, List<Integer> resNumberList)
      Constructor for PDBFilter with residue numbers.
      Parameters:
      file - a List object.
      molecularAssembly - a MolecularAssembly object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
      resNumberList - a List of integer residue numbers for constant pH rotamer optimization.
  • Method Details

    • toPDBAtomLine

      public static String toPDBAtomLine(Atom atom)
      Simple method useful for converting files to PDB format.
      Parameters:
      atom - a Atom object.
      Returns:
      Returns a PDB ATOM or HETATM record for the passed Atom.
    • setConstantPH

      public void setConstantPH(boolean constantPH)
    • setRotamerTitration

      public void setRotamerTitration(boolean rotamerTitration)
    • clearSegIDs

      public void clearSegIDs()
      clearSegIDs
    • 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
    • countNumModels

      public int countNumModels()
      Overrides:
      countNumModels in class SystemFilter
    • getAltLocs

      public List<Character> getAltLocs()
      Get the list of alternate locations encountered.
      Returns:
      the alternate location list.
    • getLastReadLambda

      public OptionalDouble getLastReadLambda()
      Gets the last read lambda value read by the filter, if any.
      Overrides:
      getLastReadLambda in class SystemFilter
      Returns:
      Last lambda value read by this filter.
    • getRemarkLines

      public String[] getRemarkLines()
      Returns all the remark lines found by the last readFile call.
      Overrides:
      getRemarkLines in class SystemFilter
      Returns:
      Remark lines from the last readFile call.
    • getSnapshot

      public int getSnapshot()
      Description copied from class: SystemFilter
      Return snapshot number.
      Overrides:
      getSnapshot in class SystemFilter
      Returns:
      The snapshot number.
    • mutate

      public void mutate(List<PDBFilter.Mutation> mutations)
      Mutate residue(s) as the PDB file is being parsed.
      Parameters:
      mutations - a List object.
    • readFile

      public boolean readFile()
      Parse the PDB File
      Specified by:
      readFile in class SystemFilter
      Returns:
      a boolean.
    • readNext

      public boolean readNext()
      Reads the next model if applicable (currently, ARC and PDB files only).
      Specified by:
      readNext in class SystemFilter
      Returns:
      If next model read.
    • readNext

      public boolean readNext(boolean resetPosition)
      Reads the next model if applicable (currently, ARC files only).
      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 model if applicable (currently, ARC files only).
      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 model if applicable (currently, ARC files only).
      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.
    • setAltID

      public void setAltID(MolecularAssembly molecularAssembly, Character altLoc)
      Specify the alternate location.
      Parameters:
      molecularAssembly - The MolecularAssembly to populate.
      altLoc - The alternate location to use.
    • setLogWrites

      public void setLogWrites(boolean logWrites)
      Sets whether this PDBFilter should log each time it saves to a file.
      Parameters:
      logWrites - a boolean.
    • setModelNumbering

      public void setModelNumbering(int modelsWritten)
      setModelNumbering.
      Parameters:
      modelsWritten - the number of models written.
    • setLMN

      public void setLMN(int[] lmn)
    • setSymOp

      public void setSymOp(int symOp)
      setSymOp.
      Parameters:
      symOp - a int.
    • writeFileAsP1

      public boolean writeFileAsP1(File file)
      Expand the current system to P1 during the save operation.
      Parameters:
      file - The file to write.
      Returns:
      Return true on a successful write.
    • writeFile

      public boolean writeFile(File saveFile, boolean append, boolean printLinear, boolean writeEnd)
      writeFile
      Parameters:
      saveFile - a File object.
      append - Whether to append to saveFile (vs over-write).
      printLinear - Ignored (remains to present a different method signature).
      writeEnd - True if this is the final model.
      Returns:
      Success of writing.
    • writeFile

      public boolean writeFile(File saveFile, boolean append, Set<Atom> toExclude, boolean writeEnd, boolean versioning)
      writeFile
      Parameters:
      saveFile - a File object to save to.
      append - Whether to append to saveFile (vs over-write).
      toExclude - A Set of Atoms to exclude from writing.
      writeEnd - True if this is the final model.
      versioning - True if the file being saved to should be versioned. False if the file being saved to should be overwritten.
      Returns:
      Success of writing.
    • writeFile

      public boolean writeFile(File saveFile, boolean append, Set<Atom> toExclude, boolean writeEnd, boolean versioning, String[] extraLines)
      writeFile
      Parameters:
      saveFile - a File object to save to.
      append - Whether to append to saveFile (vs over-write).
      toExclude - A Set of Atoms to exclude from writing.
      writeEnd - True if this is the final model.
      versioning - True if the file being saved to should be versioned. False if the file being saved to should be overwritten.
      extraLines - Extra comment/header lines to write.
      Returns:
      Success of writing.
    • writeFile

      public boolean writeFile(File saveFile, boolean append)
      This method is different for each subclass and must be overridden.

      If the append flag is true, "saveFile" will be appended to. Otherwise, the default versioning scheme will be applied.

      Write out the Atomic information in PDB format.

      Overrides:
      writeFile in class SystemFilter
      Parameters:
      saveFile - a File object.
      append - a boolean.
      Returns:
      a boolean.
    • writeFile

      public boolean writeFile(File saveFile, boolean append, String[] extraLines)
      Description copied from class: SystemFilter
      This method is different for each subclass and must be overridden.

      If the append flag is true, "saveFile" will be appended to. Otherwise, the default versioning scheme will be applied.

      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:
      a boolean.
    • writeFile

      public boolean writeFile(File saveFile, boolean append, boolean versioning)
      Writes out the atomic information in PDB format.
      Parameters:
      saveFile - The file to save information to.
      append - True if the current data should be appended to the saveFile (as in arc files).
      versioning - True if the saveFile should be versioned. False if the saveFile should be overwritten.
      Returns:
      Success of writing.
    • writeFileWithHeader

      public boolean writeFileWithHeader(File saveFile, String header, boolean append)
      writeFileWithHeader.
      Parameters:
      saveFile - a File object.
      header - a String object.
      append - a boolean.
      Returns:
      a boolean.
    • writeFileWithHeader

      public boolean writeFileWithHeader(File saveFile, String header)
      writeFileWithHeader.
      Parameters:
      saveFile - a File object.
      header - a String object.
      Returns:
      a boolean.
    • writeFileWithHeader

      public boolean writeFileWithHeader(File saveFile, StringBuilder header)
      writeFileWithHeader.
      Parameters:
      saveFile - a File object.
      header - a StringBuilder object.
      Returns:
      a boolean.