org.strbio.mol.lib
Class GapAffine

java.lang.Object
  extended by org.strbio.mol.lib.GapModelAdapter
      extended by org.strbio.mol.lib.GapConstant
          extended by org.strbio.mol.lib.GapAffine
All Implemented Interfaces:
Description, GapModel
Direct Known Subclasses:
GapDistanceDependent

public class GapAffine
extends GapConstant
implements Description

Affine gap penalties. (cost = gapI + (n-1) * gapE)

  Version 1.1, 7/1/99 - conforms to GapModel 1.1 interface
  Version 1.0, 2/25/99 - original version
  

Version:
1.1, 7/1/99
Author:
JMC

Field Summary
 double gapE
          Gap extention penalty.
 
Fields inherited from class org.strbio.mol.lib.GapConstant
endGapFoldOK, endGapSeqOK, gapI
 
Constructor Summary
GapAffine(double gapi, double gape)
          Set the penalties.
GapAffine(double gapi, double gape, boolean seqEndGapOK, boolean foldEndGapOK)
          Set the penalties.
 
Method Summary
 void describe(Printf outfile)
          the default function describes only ends.
 double gapCostDeletion(Polymer seq, Polymer fold, int seqi, int seqj, int foldi, int foldj)
          This function should return the gap cost for aligning residues seqi and foldi, then seqj and foldj.
 double gapCostInsertion(Polymer seq, Polymer fold, int seqi, int seqj, int foldi, int foldj)
          This function should return the gap cost for aligning residues seqi and foldi, then seqj and foldj.
 double[] getOptimizableParameters()
          get all the optimizable (double) parameters as a vector.
 void printParameters(Printf outfile)
          default printParameters function does nothing.
 void processGlobalMatrix(float[][] mat, int[][] nextX, int[][] nextY, Polymer seq, Polymer fold)
          This function is optimized for affine gap penalties.
 void setOptimizableParameters(double[] x)
          set all the optimizable (double) parameters from a vector.
 
Methods inherited from class org.strbio.mol.lib.GapConstant
describeBriefly, isEndGapFoldOK, isEndGapSeqOK
 
Methods inherited from class org.strbio.mol.lib.GapModelAdapter
calculateFirstPosition, dealWithEndPenalties, describeEnds, finished, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gapE

public double gapE
Gap extention penalty.

Constructor Detail

GapAffine

public GapAffine(double gapi,
                 double gape)
Set the penalties. Ends treated like standard n-w.


GapAffine

public GapAffine(double gapi,
                 double gape,
                 boolean seqEndGapOK,
                 boolean foldEndGapOK)
Set the penalties.

Method Detail

gapCostDeletion

public double gapCostDeletion(Polymer seq,
                              Polymer fold,
                              int seqi,
                              int seqj,
                              int foldi,
                              int foldj)
Description copied from interface: GapModel
This function should return the gap cost for aligning residues seqi and foldi, then seqj and foldj. foldi and foldj should not be consecutive; seqi and seqj should if you're doing needleman-wunsch alignments. i and j are 0-based integers, with no relation to n in Monomer. -1 means off the end. Otherwise, j should always be higher than i.
      seq:   i.....j
      fold:  ixxxxxj
      

Specified by:
gapCostDeletion in interface GapModel
Overrides:
gapCostDeletion in class GapConstant

gapCostInsertion

public double gapCostInsertion(Polymer seq,
                               Polymer fold,
                               int seqi,
                               int seqj,
                               int foldi,
                               int foldj)
Description copied from interface: GapModel
This function should return the gap cost for aligning residues seqi and foldi, then seqj and foldj. seqi and seqj should not be consecutive; foldi and foldj should if you're doing needleman-wunsch alignments. i and j are 0-based integers, with no relation to n in Monomer. -1 means off the end. Otherwise, j should always be higher than i.
      seq:   ixxxxxj
      fold:  i.....j
      

Specified by:
gapCostInsertion in interface GapModel
Overrides:
gapCostInsertion in class GapConstant

processGlobalMatrix

public void processGlobalMatrix(float[][] mat,
                                int[][] nextX,
                                int[][] nextY,
                                Polymer seq,
                                Polymer fold)
This function is optimized for affine gap penalties.

Specified by:
processGlobalMatrix in interface GapModel
Overrides:
processGlobalMatrix in class GapConstant

describe

public void describe(Printf outfile)
Description copied from class: GapModelAdapter
the default function describes only ends.

Specified by:
describe in interface Description
Overrides:
describe in class GapConstant

printParameters

public void printParameters(Printf outfile)
Description copied from class: GapModelAdapter
default printParameters function does nothing.

Specified by:
printParameters in interface GapModel
Overrides:
printParameters in class GapModelAdapter

getOptimizableParameters

public double[] getOptimizableParameters()
get all the optimizable (double) parameters as a vector.

Specified by:
getOptimizableParameters in interface GapModel
Overrides:
getOptimizableParameters in class GapConstant

setOptimizableParameters

public void setOptimizableParameters(double[] x)
set all the optimizable (double) parameters from a vector.

Specified by:
setOptimizableParameters in interface GapModel
Overrides:
setOptimizableParameters in class GapConstant