org.strbio.mol.lib
Class GapModelAdapter

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

public abstract class GapModelAdapter
extends java.lang.Object
implements GapModel, Description

Default implementation of GapModel.

  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

Constructor Summary
GapModelAdapter()
           
 
Method Summary
 void calculateFirstPosition(float[][] mat, int[][] nextX, int[][] nextY, Polymer seq, Polymer fold)
           
 void dealWithEndPenalties(float[][] mat, Polymer seq, Polymer fold)
          This fills in the matrix with impossible penalties, if we want to disallow gaps at the ends.
 void describe(Printf outfile)
          the default function describes only ends.
 void describeEnds(Printf outfile)
          describe how ends are treated.
 void finished(Polymer seq, Polymer fold)
          Default is no finish.
 double[] getOptimizableParameters()
          by default, nothing is optimizable.
 void printParameters(Printf outfile)
          default printParameters function does nothing.
 void processGlobalMatrix(float[][] mat, int[][] nextX, int[][] nextY, Polymer seq, Polymer fold)
          This function will handle any gap model, but very slowly.
 void setOptimizableParameters(double[] x)
          by default, nothing is optimizable.
 void setup(Polymer seq, Polymer fold)
          Default is no setup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.strbio.mol.lib.GapModel
gapCostDeletion, gapCostInsertion, isEndGapFoldOK, isEndGapSeqOK
 

Constructor Detail

GapModelAdapter

public GapModelAdapter()
Method Detail

dealWithEndPenalties

public void dealWithEndPenalties(float[][] mat,
                                 Polymer seq,
                                 Polymer fold)
This fills in the matrix with impossible penalties, if we want to disallow gaps at the ends.


calculateFirstPosition

public void calculateFirstPosition(float[][] mat,
                                   int[][] nextX,
                                   int[][] nextY,
                                   Polymer seq,
                                   Polymer fold)

processGlobalMatrix

public void processGlobalMatrix(float[][] mat,
                                int[][] nextX,
                                int[][] nextY,
                                Polymer seq,
                                Polymer fold)
This function will handle any gap model, but very slowly. If optimization is possible, it should be overridden so every square doesn't have to be looked at.

Specified by:
processGlobalMatrix in interface GapModel

setup

public void setup(Polymer seq,
                  Polymer fold)
Default is no setup.

Specified by:
setup in interface GapModel

finished

public void finished(Polymer seq,
                     Polymer fold)
Default is no finish.

Specified by:
finished in interface GapModel

describeEnds

public void describeEnds(Printf outfile)
describe how ends are treated.


describe

public void describe(Printf outfile)
the default function describes only ends.

Specified by:
describe in interface Description

printParameters

public void printParameters(Printf outfile)
default printParameters function does nothing.

Specified by:
printParameters in interface GapModel

getOptimizableParameters

public double[] getOptimizableParameters()
by default, nothing is optimizable.

Specified by:
getOptimizableParameters in interface GapModel

setOptimizableParameters

public void setOptimizableParameters(double[] x)
by default, nothing is optimizable.

Specified by:
setOptimizableParameters in interface GapModel