|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.strbio.mol.Alignment
public class Alignment
An Alignment is a simple representation of an alignment between two polymers.
Version 1.5, 1/7/03 - added inverse Version 1.4, 2/12/02 - added stripGaps, makeSameLength, stripCommonGaps improved printModeller Version 1.3, 8/31/99 - added avgScoreWith*Gaps to calculate score for any arbitrary AlignmentParameters Version 1.23, 8/30/99 - made arrayToPolymers do stripGaps first Version 1.22, 6/25/99 - added AlignmentParameters function calls Version 1.21, 6/23/99 - added lastScore Version 1.2, 4/21/99 - made seq, fold part of this object. The polymers themselves are not copied, so this isn't too wasteful. Version 1.13, 4/15/99 - added nID, pctAligned Version 1.12, 4/2/99 - added pctID Version 1.11, 3/31/99 - added nAligned Version 1.1, 3/5/99 - added makeFromSuperposition, using JDB's alignment algorithm. Version 1.01, 12/2/98 - changed name to Alignment; old Alignment is now AlignmentSet. Version 1.0, 11/3/98 - original version
Field Summary | |
---|---|
Polymer |
fold
the fold in the alignment. |
double |
lastScore
last total score for when this alignment was made. |
static double |
LONGEST_DISTANCE_CUTOFF
The longest distance 2 aligned CA atoms can be apart in the makeFromSuperposition* algorithms: currently 6 A. |
Polymer |
seq
the sequence in the alignment. |
protected int[] |
sfArray
A vector containing the current alignment. |
static int |
SHORTEST_ALIGNMENT_LENGTH
The smallest number of consecutive monomers that can be aligned: currently 2. |
Constructor Summary | |
---|---|
Alignment()
making a new alignment sets everything to null. |
|
Alignment(Alignment av)
make a new alignment from another one. |
|
Alignment(int seqLength)
make a new alignment vector of a given length, setting all entries to unaligned. |
|
Alignment(int[] v)
make a new alignment from an integer array. |
|
Alignment(Polymer s,
Polymer f)
make a new alignment with a seq and fold. |
|
Alignment(Polymer s,
Polymer f,
int[] v)
make a new alignment from two polymers and an integer array. |
Method Summary | |
---|---|
int |
aligned(int i)
returns number of fold monomer alignmed to seq monomer i, or -1 if aligned to a gap. |
void |
arrayToPolymers()
Sets up gaps in two Polymers to match this vector. |
double[] |
ASns(Alignment correct,
int tolerance)
calculate alignment sensitivity, as in CASP2. |
double[] |
ASpc(Alignment correct,
int tolerance)
calculate alignment specificity, as in CASP2. |
double |
averageScore(ScoreList sl)
Returns average score of all pairs of aligned monomers. |
double |
avgScoreWithGaps(AlignmentParameters ap)
Returns average score for all pairs of aligned monomers. |
double |
avgScoreWithoutGaps(AlignmentParameters ap)
Returns average score for all pairs of aligned monomers. |
double[] |
compare(Alignment av,
int tolerance)
compares two alignments. |
void |
filterByDistance()
This uses the default cutoff (LONGEST_DISTANCE_CUTOFF). |
void |
filterByDistance(double cutoff)
Check all aligned pairs of residues; remove any with CA-CA distance greater than CUTOFF. |
void |
filterByLength()
This uses the default cutoff (SHORTEST_ALIGNMENT_LENGTH). |
void |
filterByLength(int cutoff)
Check all aligned pairs of residues; remove any stretches of alignment shorter than SHORTEST_ALIGNMENT_LENGTH. |
int[] |
foldToSeq()
Return a vector of which fold monomer is related to which sequence monomer. |
int[] |
foldToSeq(int foldLength)
Return a vector of which fold monomer is related to which sequence monomer. |
double |
globalAlign(AlignmentParameters ap)
Do the global alignment, returning the score (which is also stored in lastScore) |
double |
globalAlign(AlignmentParameters ap,
Alignment nail)
Do the global alignment, returning the score (which is also stored in lastScore) |
Alignment |
inverse()
invert alignment, returning fold->seq alignment |
protected void |
loadOld(java.lang.String in_file,
int seqLength,
int foldLength)
load an Alignment out of a simple format file; contains pairs of numbers indicating which res in the sequence aligns to which res in the fold. |
static Alignment |
makeFromSuperposition(Protein seq,
Protein fold)
Make from 2 superimposed proteins, using JDB's method. 1) Make table of everything in (fold) which is <= CUTOFF angstroms from each residue in (seq). 2) Get longest consecutive stretch, and set them as aligned; remove these residues from future consideration. 3) Repeat until nothing is left that has any matches. |
static Alignment |
makeFromSuperpositionDP(Protein seq,
Protein fold)
Make from a superposition, using dynamic programming. |
void |
makeSameLength()
pad both seqs to same length |
int |
minimumFoldLength()
Return the last monomer in the fold which is aligned to something in the sequence. |
int |
nAligned()
Returns the number of aligned positions. |
int |
nID()
Returns the number of identical residues in the alignment. |
double |
pctAligned()
Returns the percent aligned residues in the alignment. |
double |
pctAlignedLongest()
Returns the percent aligned residues in the alignment, relative to the longer of the two sequences. |
double |
pctID()
Returns the percent identical residues in the alignment. |
void |
polymersToArray()
Sets up array based on alignment in Polymers. |
void |
print(Printf outfile,
boolean showgaps)
prints out both sequences with alternating seq and fold lines. |
void |
printModeller(Printf outfile)
prints both sequences in a format Modeller likes. |
void |
printRelative(Alignment b,
Printf outfile)
prints out both sequences with alternating seq and fold lines, and also shows relation relative to another alignment (i.e. the correct alignment) |
double |
RMS()
RMS of aligned CA positions. |
void |
saveCASP(Printf outfile)
Save alignment in CASP format, to open file. |
void |
saveCASP(java.lang.String filename)
Save alignment in CASP format, creating new file. |
void |
saveOld(java.lang.String filename)
Saves alignment to a file in old format. |
int[] |
seqToFold()
Returns a copy of the seq to fold array. |
void |
setAligned(int i,
int j)
Sets seq monomer i to be aligned to fold monomer j. |
void |
setUnaligned(int i)
Sets seq monomer i to be unaligned. |
double[] |
shift(Alignment av)
calculate average alignment shift, as in CASP2. |
static char |
shiftToChar(int shift)
Convert an alignment shift to an ascii character for printing. |
void |
stats(Printf outfile)
get statistics on the alignment. |
void |
stripCommonGaps()
Strip common gaps in the two sequences |
void |
stripGaps()
Strip all gaps in the two sequences |
char[][] |
toCharArrays()
Saves alignment in 2 char[] arrays (sequence and fold), so it can be printed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] sfArray
public double lastScore
public Polymer seq
public Polymer fold
public static final double LONGEST_DISTANCE_CUTOFF
public static final int SHORTEST_ALIGNMENT_LENGTH
Constructor Detail |
---|
public Alignment()
public Alignment(Polymer s, Polymer f)
public Alignment(int seqLength)
public Alignment(Polymer s, Polymer f, int[] v)
public Alignment(int[] v)
public Alignment(Alignment av)
Method Detail |
---|
public int aligned(int i)
public void setAligned(int i, int j)
public void setUnaligned(int i)
public final int nID()
public final double pctID()
public final double pctAligned()
public final double pctAlignedLongest()
public final double[] compare(Alignment av, int tolerance)
public final double[] ASpc(Alignment correct, int tolerance)
public final double[] ASns(Alignment correct, int tolerance)
public final double[] shift(Alignment av)
public final double RMS()
public final int[] foldToSeq(int foldLength)
public final int minimumFoldLength()
public final Alignment inverse()
public final int[] foldToSeq()
public final int[] seqToFold()
public final void arrayToPolymers()
public final void polymersToArray()
public final void stripGaps()
public final void makeSameLength()
public final void stripCommonGaps()
protected final void loadOld(java.lang.String in_file, int seqLength, int foldLength)
public final int nAligned()
public final double averageScore(ScoreList sl)
public final double avgScoreWithoutGaps(AlignmentParameters ap)
public final double avgScoreWithGaps(AlignmentParameters ap)
public static final char shiftToChar(int shift)
public final void printRelative(Alignment b, Printf outfile) throws java.io.IOException
java.io.IOException
public final char[][] toCharArrays()
public final void print(Printf outfile, boolean showgaps) throws java.io.IOException
java.io.IOException
public final double globalAlign(AlignmentParameters ap, Alignment nail)
public final double globalAlign(AlignmentParameters ap)
public static final Alignment makeFromSuperposition(Protein seq, Protein fold)
public static final Alignment makeFromSuperpositionDP(Protein seq, Protein fold)
public final void filterByDistance(double cutoff)
public final void filterByLength(int cutoff)
public final void filterByDistance()
public final void filterByLength()
public final void saveOld(java.lang.String filename) throws java.io.IOException
java.io.IOException
public final void saveCASP(java.lang.String filename) throws java.io.IOException
java.io.IOException
public final void saveCASP(Printf outfile) throws java.io.IOException
java.io.IOException
public final void printModeller(Printf outfile) throws java.io.IOException
java.io.IOException
public final void stats(Printf outfile) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |