io.xplor
Class OutXPlor

java.lang.Object
  extended byio.TrajectoryWriter
      extended byio.xplor.OutXPlor

public class OutXPlor
extends TrajectoryWriter

Output X-PLOR crystallographic map files.

For a definition of the X-PLOR file format, see e.g. the X-PLOR 98 manual, as currently available at http://www.scripps.edu/rc/softwaredocs/msi/xplor981/formats.html

A quick repetition of the X-PLOR crystallographic map format (which we will refer to as the xplor format from now on): these files consist of a header, the density array and a footer.

The header consists of:

The density array consists of

The footer consists of

Author:
Vincent Kraeutler

Field Summary
(package private) static PrintfFormat xPlorDoubleFormat
           
(package private) static PrintfFormat xPlorIntFormat
           
 
Fields inherited from class io.TrajectoryWriter
outFile
 
Constructor Summary
OutXPlor(java.lang.String title)
           
OutXPlor(java.lang.String fileName, java.lang.String title)
           
 
Method Summary
static java.lang.String makeCellSpecs(double[] cellSpecs)
           
static java.lang.String makeFooter(double[][][] grid)
           
static java.lang.String makeGridSpecs(int[] gridSpecs)
           
static java.lang.String makeHeader(int[] gridSpecs, double[] cellSpecs)
           
static java.lang.String makeTitle(java.lang.String title)
           
 void writeDensityArray(double[][][] grid)
           
 void writeFrame(double time, int step, double[][] positions, double[] box, java.lang.String[] atomNames, java.lang.String[] residueNames, int[] residueNumbers)
          Format-agnostic trajectory writer.
 void writeMap(int[] gridSpecs, double[] cellSpecs, double[][][] grid)
          write an X-PLOR crystallographic map
 void writeTitle(java.lang.String title)
          write more or less proper header information (author, title...)
 
Methods inherited from class io.TrajectoryWriter
getWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xPlorIntFormat

static final PrintfFormat xPlorIntFormat

xPlorDoubleFormat

static final PrintfFormat xPlorDoubleFormat
Constructor Detail

OutXPlor

public OutXPlor(java.lang.String title)
         throws java.io.IOException

OutXPlor

public OutXPlor(java.lang.String fileName,
                java.lang.String title)
         throws java.io.IOException
Method Detail

makeTitle

public static java.lang.String makeTitle(java.lang.String title)

makeGridSpecs

public static java.lang.String makeGridSpecs(int[] gridSpecs)

makeCellSpecs

public static java.lang.String makeCellSpecs(double[] cellSpecs)

makeHeader

public static java.lang.String makeHeader(int[] gridSpecs,
                                          double[] cellSpecs)

writeDensityArray

public void writeDensityArray(double[][][] grid)
                       throws java.lang.IllegalArgumentException,
                              java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.io.IOException

makeFooter

public static java.lang.String makeFooter(double[][][] grid)

writeMap

public void writeMap(int[] gridSpecs,
                     double[] cellSpecs,
                     double[][][] grid)
              throws java.io.IOException
write an X-PLOR crystallographic map

Parameters:
gridSpecs - the grid layout (see class definition for details)
cellSpecs - the cell layout (see class definition for details)
grid - the grid values
Throws:
java.io.IOException

writeFrame

public void writeFrame(double time,
                       int step,
                       double[][] positions,
                       double[] box,
                       java.lang.String[] atomNames,
                       java.lang.String[] residueNames,
                       int[] residueNumbers)
                throws java.io.IOException
Description copied from class: TrajectoryWriter
Format-agnostic trajectory writer. Since every format actually writes different things, we have to supply all information that might be required by any format... the implementation of simpler custom interfaces is up to the respective writer implementations.

Specified by:
writeFrame in class TrajectoryWriter
Parameters:
time - the time of the frame
step - corresponds to a given time step (g96, vmd) or model serial (pdb)
positions - the 3N coordinates
box - the 3 box dimensions (ignored by pdb)
atomNames - the N atom names
residueNames - the N residue names of the atoms
residueNumbers - the N residue numbers of the atoms
Throws:
java.io.IOException

writeTitle

public void writeTitle(java.lang.String title)
                throws java.io.IOException
Description copied from class: TrajectoryWriter
write more or less proper header information (author, title...)

Specified by:
writeTitle in class TrajectoryWriter
Parameters:
title - the title block
Throws:
java.io.IOException