org.strbio.mol.lib
Class BackbonePotential

java.lang.Object
  extended by org.strbio.mol.lib.BackbonePotential

public class BackbonePotential
extends java.lang.Object

methods for handling the 2ary prediction dependent backbone pseudopotential.

  Version 1.4, 6/7/99 - changed name from JMCPotential to BackbonePotential,
    documented things more
  Version 1.3, 9/1/98 - fixed bug in AVG_RESIDUE ref state
  Version 1.2, 8/3/98 - made ref an integer with 3 choices of state.
  Version 1.1, 7/20/98 - added sigma
  Version 1.0, 3/31/98 - original version
  

Version:
1.4, 6/7/99
Author:
JMC

Field Summary
static int AVG_RESIDUE
          Reference state is average residue.
static int AVG_RESIDUE_SAME_TYPE
          Reference state is average residue of the same type as the residue being tested (GPN only).
 int ref
          reference state.
 boolean separate
          separate GPN?
 double sigma
          Scale GPN in Sippl-like manner?
static int UNIFORM
          Reference state is uniform probability.
 
Constructor Summary
BackbonePotential()
          Create a new potential object with no data.
BackbonePotential(java.lang.String filename)
          Create and load in from a file.
 
Method Summary
 void clear()
          delete all info
 void create(boolean doalpha, int binsize, java.lang.String filename)
          Create histograms by binning angles from a file.
 DMatrix getHistogram(char type, int which)
          Get a raw histogram for a given residue type. 0 = all, 1 = helix, 2 = sheet, 3 = coil.
 void load(java.io.BufferedReader infile)
          load histograms from an open Reader... format should be all_raw, all_h, all_e, all_c, gly_raw, gly_h...
 void load(java.lang.String filename)
          load histograms from a file... format should be all_raw, all_h, all_e, all_c, gly_raw, gly_h...
static void main(java.lang.String[] argv)
          Does what the C++ program 'anglehist' used to do, except slower... also does the smoothing in advance as the histograms are created.
 DMatrix makeEnergyHist(char type, double pH, double pE)
          returns energy histogram for a residue with helix probability pH, and strand probability pE.
 DMatrix makeEnergyHist(char type, double pH, double pE, double offset, double scale)
          returns energy histogram for a residue with helix probability pH, and strand probability pE.
 void save(java.lang.String filename)
          save histograms from a file... format is be all_raw, all_h, all_e, all_c, gly_raw, gly_h...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIFORM

public static final int UNIFORM
Reference state is uniform probability.

See Also:
Constant Field Values

AVG_RESIDUE

public static final int AVG_RESIDUE
Reference state is average residue.

See Also:
Constant Field Values

AVG_RESIDUE_SAME_TYPE

public static final int AVG_RESIDUE_SAME_TYPE
Reference state is average residue of the same type as the residue being tested (GPN only).

See Also:
Constant Field Values

ref

public int ref
reference state.


separate

public boolean separate
separate GPN? Default is true.


sigma

public double sigma
Scale GPN in Sippl-like manner? If zero, does not. Separate must also be true for this to work.

Constructor Detail

BackbonePotential

public BackbonePotential()
Create a new potential object with no data. Default is to use average residue as the reference state. Use load() to load the data.


BackbonePotential

public BackbonePotential(java.lang.String filename)
Create and load in from a file.

Method Detail

clear

public final void clear()
delete all info


load

public final void load(java.io.BufferedReader infile)
load histograms from an open Reader... format should be all_raw, all_h, all_e, all_c, gly_raw, gly_h...


load

public final void load(java.lang.String filename)
load histograms from a file... format should be all_raw, all_h, all_e, all_c, gly_raw, gly_h...


save

public final void save(java.lang.String filename)
save histograms from a file... format is be all_raw, all_h, all_e, all_c, gly_raw, gly_h...


create

public final void create(boolean doalpha,
                         int binsize,
                         java.lang.String filename)
Create histograms by binning angles from a file.

Parameters:
doalpha - do alpha/tau instead of phi/psi
binsize - bin size in degrees
filename - a file containing proteins

makeEnergyHist

public final DMatrix makeEnergyHist(char type,
                                    double pH,
                                    double pE,
                                    double offset,
                                    double scale)
returns energy histogram for a residue with helix probability pH, and strand probability pE. Coil probability is implicitly 1.0 - pH - pE.

Parameters:
type - residue type
pH - helix probability (0.0 - 1.0)
pE - strand probability (0.0 - 1.0)
offset - offset the returned matrix by this much
scale - scale the returned matrix by this much
Throws:
java.lang.IllegalArgumentException - if matrices not yet loaded

getHistogram

public final DMatrix getHistogram(char type,
                                  int which)
Get a raw histogram for a given residue type. 0 = all, 1 = helix, 2 = sheet, 3 = coil.


makeEnergyHist

public final DMatrix makeEnergyHist(char type,
                                    double pH,
                                    double pE)
returns energy histogram for a residue with helix probability pH, and strand probability pE. Coil probability is implicitly 1.0 - pH - pE.

Parameters:
type - residue type
pH - helix probability (0.0 - 1.0)
pE - strand probability (0.0 - 1.0)

main

public static final void main(java.lang.String[] argv)
Does what the C++ program 'anglehist' used to do, except slower... also does the smoothing in advance as the histograms are created. Needs 2 parameters: an input file name and an output file name. Optional parameters, which must come later, are -bin N to change the bin size from the default 5, and -alpha to do alpha instead of phi/psi.