java.lang.Object
org.xmlcml.legacy.DynamicAligner
- public class DynamicAligner
- extends java.lang.Object
dynamic alignment of sequences (in the general sense) based on Kruskal's
description - would be better in a different package
|
Field Summary |
static int |
BY_TYPE
penalty on basis of type (e.g. |
(package private) int |
cont
|
static int |
INDIVIDUAL
penalty on basis of score (e.g. |
static int |
LEFT
|
(package private) int[] |
len
|
(package private) double[][] |
matrix
|
(package private) double[][] |
penalties
|
(package private) int[][] |
pointers
|
(package private) int[][] |
seq
|
static int |
UP
|
static int |
UPLEFT
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UP
public static final int UP
- See Also:
- Constant Field Values
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
UPLEFT
public static final int UPLEFT
- See Also:
- Constant Field Values
BY_TYPE
public static final int BY_TYPE
- penalty on basis of type (e.g. letter or aminoacid)
- See Also:
- Constant Field Values
INDIVIDUAL
public static final int INDIVIDUAL
- penalty on basis of score (e.g. string alignment)
- See Also:
- Constant Field Values
seq
int[][] seq
len
int[] len
penalties
double[][] penalties
pointers
int[][] pointers
matrix
double[][] matrix
cont
int cont
DynamicAligner
public DynamicAligner()
DynamicAligner
public DynamicAligner(int[][] seq,
double[][] penalties)
throws NonSquareException,
java.lang.IllegalArgumentException
- create a DynamicAligner from a substitution matrix
DynamicAligner
public DynamicAligner(java.lang.String s1,
java.lang.String s2,
double[][] penalties)
throws java.lang.Exception
setPenalties
public void setPenalties(double[][] penalties)
getInts
private static int[][] getInts(java.lang.String s1,
java.lang.String s2)
align
public void align(double gap)
- this does the alignment; the gap penalty should be given
fillMatrices
void fillMatrices(double gap,
int cont)
getDistance
public double getDistance()
- return the distance between the two sequences (i.e. the sum of the PAM elements
for each pair + the gaps)
extractAlignment
public IntArray[] extractAlignment()
- get the two sequences as gapped arrays of integers (e.g. 0,1,2,3,-1,-1,4,-1,5)
where the -1 represent gaps and the nonzero numers are serial numbers of the
sequences
main
public static void main(java.lang.String[] args)
throws java.lang.Exception