org.strbio.mol.lib
Interface GapModel

All Known Implementing Classes:
GapAffine, GapConstant, GapDistanceDependent, GapModelAdapter, GapRAF

public interface GapModel

Interface for gap penalties for alignment. Default versions of some functions are given in GapModelAdapter.

  Version 1.1, 7/1/99 - changed describeBriefly to printParameters,
    moved describe() to org.strbio.io.Describable interface
  Version 1.0, 2/25/99 - original version
  

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

Method Summary
 void finished(Polymer seq, Polymer fold)
          Do anything after align/comparison?
 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.
 boolean isEndGapFoldOK()
          See if aligning the end of the fold vs a gap is OK (not penalized)
 boolean isEndGapSeqOK()
          See if aligning the end of the sequence vs a gap is OK (not penalized)
 void printParameters(Printf outfile)
          Briefly print the gap parameters, for inclusion in a line of output.
 void processGlobalMatrix(float[][] mat, int[][] nextX, int[][] nextY, Polymer seq, Polymer fold)
          This function is given a sequence and fold being aligned in a global alignment, and a S+1 x F+1 matrix containing the scores for aligning each monomer in the sequence to each monomer in the fold.
 void setOptimizableParameters(double[] x)
          set all the optimizable (double) parameters from a vector.
 void setup(Polymer seq, Polymer fold)
          Perform any last minute setup before align/comparison.
 

Method Detail

isEndGapFoldOK

boolean isEndGapFoldOK()
See if aligning the end of the fold vs a gap is OK (not penalized)


isEndGapSeqOK

boolean isEndGapSeqOK()
See if aligning the end of the sequence vs a gap is OK (not penalized)


setup

void setup(Polymer seq,
           Polymer fold)
Perform any last minute setup before align/comparison.


finished

void finished(Polymer seq,
              Polymer fold)
Do anything after align/comparison?


gapCostDeletion

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. 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
      


gapCostInsertion

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. 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
      


processGlobalMatrix

void processGlobalMatrix(float[][] mat,
                         int[][] nextX,
                         int[][] nextY,
                         Polymer seq,
                         Polymer fold)
This function is given a sequence and fold being aligned in a global alignment, and a S+1 x F+1 matrix containing the scores for aligning each monomer in the sequence to each monomer in the fold. The extra row and column will be given as zeroes; they should be used to indicate whether leaving unaligned gaps at the end of the sequence is OK. A default (unoptimized) alignment scheme is in GapModelAdapter. The integer matrices should be allocated, but blank; return value indicates path for alignment. The matrix was changed to float for speed, but it should really be doubles.


printParameters

void printParameters(Printf outfile)
Briefly print the gap parameters, for inclusion in a line of output.


getOptimizableParameters

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


setOptimizableParameters

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