Class AFPChain
- java.lang.Object
-
- org.biojava.nbio.structure.align.model.AFPChain
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class AFPChain extends Object implements Serializable, Cloneable
A bean to contain the core of a structure alignment. The FatCat aligner class is working on the AFPChain class.- Author:
- Andreas Prlic, Aleix Lafita
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
newline
static String
UNKNOWN_ALGORITHM
-
Constructor Summary
Constructors Constructor Description AFPChain(String algorithmName)
Construction of an AFPChain needs the algorithm name, since downstream analysis methods (scores, display, etc) behave differently if the alignment is flexible (created with FatCat).AFPChain(AFPChain o)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
calcSimilarity()
Object
clone()
Creates and returns a copy of this object.boolean
equals(Object obj)
A week equality metric.int[][]
getAfpAftIndex()
int[][]
getAfpBefIndex()
int
getAfpChainLen()
int[]
getAfpChainList()
double[]
getAfpChainTwiBin()
double[]
getAfpChainTwiList()
int
getAfpChainTwiNum()
int[][]
getAfpIndex()
List<AFP>
getAfpSet()
Get the set of AFPs for this alignment.String
getAlgorithmName()
double
getAlignScore()
double
getAlignScoreUpdate()
int
getAlnbeg1()
int
getAlnbeg2()
int
getAlnLength()
char[]
getAlnseq1()
char[]
getAlnseq2()
char[]
getAlnsymb()
int[]
getBlock2Afp()
int[]
getBlockGap()
int
getBlockNum()
The number of blocks in the alignmentint
getBlockNumClu()
int
getBlockNumIni()
int
getBlockNumSpt()
int[][][]
getBlockResList()
tracks the residues of the initial blocks (before optimization)int[]
getBlockResSize()
double[]
getBlockRmsd()
Matrix[]
getBlockRotationMatrix()
double[]
getBlockScore()
Atom[]
getBlockShiftVector()
int[]
getBlockSize()
int
getCa1Length()
int
getCa2Length()
long
getCalculationTime()
int
getChainLen()
double
getChainRmsd()
Double
getConn()
int
getCoverage1()
Get the coverage of protein 1 with the alignmentint
getCoverage2()
Get the coverage of protein 2 with the alignmentString
getDescription2()
Get a textual description for the protein 2 of the alignment.Matrix
getDisTable1()
Matrix
getDisTable2()
Matrix
getDistanceMatrix()
A matrix with ca1length rows and ca2length columns.Double
getDVar()
int[]
getFocusAfpList()
int
getFocusAfpn()
int[]
getFocusRes1()
int[]
getFocusRes2()
int
getFocusResn()
int
getGapLen()
long
getId()
double
getIdentity()
The percent of residues that are sequence-identical in the alignment.long
getIoTime()
int
getMaxTra()
get the maximum nr of Twists that are allowed...int
getMinLen()
int
getMisLen()
String
getName1()
String
getName2()
double
getNormAlignScore()
int
getNrEQR()
Get the number of structurally equivalent residuesint[][][]
getOptAln()
Tracks the Atom positions in the optimal alignment.int[]
getOptLen()
The length of each blockint
getOptLength()
double[]
getOptRmsd()
String[][][]
getPdbAln()
used temporarily during XML serialization to track the PDB positions of the alignmnetdouble
getProbability()
The probability (FATCAT) or Z-score (CE) of the alignment.double
getSimilarity()
Returns the similarity score for the alignment.double
getTMScore()
Returns the tmScore of the alignment.int
getTotalLenIni()
int
getTotalLenOpt()
double
getTotalRmsdIni()
this is the init-RMSD, not the final RMSD after refinement.double
getTotalRmsdOpt()
The RMSD of the final alignment.int[]
getTwi()
String
getVersion()
int
hashCode()
boolean
isSequentialAlignment()
Get whether this alignment has the normal topology, ie the residues aligned in each block increase sequentially over the original protein.boolean
isShortAlign()
boolean
isSignificantResult()
void
setAfpAftIndex(int[][] afpAftIndex)
void
setAfpBefIndex(int[][] afpBefIndex)
void
setAfpChainLen(int afpChainLen)
void
setAfpChainList(int[] afpChainList)
void
setAfpChainTwiBin(double[] afpChainTwiBin)
void
setAfpChainTwiList(double[] afpChainTwiList)
void
setAfpChainTwiNum(int afpChainTwiNum)
void
setAfpIndex(int[][] afpIndex)
void
setAfpSet(List<AFP> afpSet)
Set the set of AFPs for this alignment.void
setAlgorithmName(String algorithmName)
Caution has to be made when changing the algorithmName of an AFPChain, since downstream analysis methods (scores, display, etc) behave differently if the alignment is flexible (created with FatCat).void
setAlignScore(double alignScore)
void
setAlignScoreUpdate(double alignScoreUpdate)
void
setAlnbeg1(int alnbeg1)
void
setAlnbeg2(int alnbeg2)
void
setAlnLength(int alnLength)
void
setAlnseq1(char[] alnseq1)
void
setAlnseq2(char[] alnseq2)
void
setAlnsymb(char[] alnsymb)
void
setBlock2Afp(int[] block2Afp)
void
setBlockGap(int[] blockGap)
void
setBlockNum(int blockNum)
void
setBlockNumClu(int blockNumClu)
void
setBlockNumIni(int blockNumIni)
void
setBlockNumSpt(int blockNumSpt)
void
setBlockResList(int[][][] blockResList)
void
setBlockResSize(int[] blockResSize)
void
setBlockRmsd(double[] blockRmsd)
void
setBlockRotationMatrix(Matrix[] blockRotationMatrix)
void
setBlockScore(double[] blockScore)
void
setBlockShiftVector(Atom[] blockShiftVector)
void
setBlockSize(int[] blockSize)
void
setCa1Length(int ca1Length)
void
setCa2Length(int ca2Length)
void
setCalculationTime(long calculationTime)
void
setChainLen(int chainLen)
void
setChainRmsd(double chainRmsd)
The RMSD of the chain of AFPs.void
setConn(Double conn)
void
setDescription2(String desc)
Set the textual description for protein 2.void
setDisTable1(Matrix disTable1)
void
setDisTable2(Matrix disTable2)
void
setDistanceMatrix(Matrix distanceMatrix)
A matrix with ca1length rows and ca2length columns.void
setDVar(Double dvar)
void
setFocusAfpList(int[] focusAfpList)
void
setFocusAfpn(int focusAfpn)
void
setFocusRes1(int[] focusRes1)
void
setFocusRes2(int[] focusRes2)
void
setFocusResn(int focusResn)
void
setGapLen(int gapLen)
void
setId(long id)
void
setIdentity(double identity)
void
setIoTime(long ioTime)
void
setMaxTra(int maxTra)
Set the maximum number of Twists that are allowed...void
setMinLen(int minLen)
void
setMisLen(int misLen)
void
setName1(String name1)
void
setName2(String name2)
void
setNormAlignScore(double normAlignScore)
void
setOptAln(int[][][] optAln)
void
setOptLen(int[] optLen)
void
setOptLength(int optLength)
The length of the optimal alignment.void
setOptRmsd(double[] optRmsd)
void
setPdbAln(String[][][] pdbAln)
void
setProbability(double probability)
void
setSequentialAlignment(boolean sequentialAlignment)
Set whether this alignment has the normal topology, ie the residues aligned in each block increase sequentially over the original protein.void
setShortAlign(boolean shortAlign)
void
setSimilarity(double similarity)
void
setTMScore(double tmScore)
void
setTotalLenIni(int totalLenIni)
void
setTotalLenOpt(int totalLenOpt)
void
setTotalRmsdIni(double totalRmsdIni)
this is the init-RMSD, not the final RMSD after refinement.void
setTotalRmsdOpt(double totalRmsdOpt)
The RMSD of the final alignment.void
setTwi(int[] twi)
void
setVersion(String version)
String
toCE(Atom[] ca1, Atom[] ca2)
String
toDBSearchResult()
String
toFatcat(Atom[] ca1, Atom[] ca2)
String
toRotMat()
String
toString()
-
-
-
Field Detail
-
UNKNOWN_ALGORITHM
public static final String UNKNOWN_ALGORITHM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public long getId()
-
setId
public void setId(long id)
-
toDBSearchResult
public String toDBSearchResult()
-
calcSimilarity
protected void calcSimilarity()
-
getNrEQR
public int getNrEQR()
Get the number of structurally equivalent residues- Returns:
- nr of EQR
-
getCoverage1
public int getCoverage1()
Get the coverage of protein 1 with the alignment- Returns:
- percentage of coverage, between 0 and 100.
-
getCoverage2
public int getCoverage2()
Get the coverage of protein 2 with the alignment- Returns:
- percentage of coverage, between 0 and 100.
-
isSignificantResult
public boolean isSignificantResult()
-
getPdbAln
public String[][][] getPdbAln()
used temporarily during XML serialization to track the PDB positions of the alignmnet- Returns:
- String array
-
getMaxTra
public int getMaxTra()
get the maximum nr of Twists that are allowed...- Returns:
- maxTra, the max nr of twists
-
setMaxTra
public void setMaxTra(int maxTra)
Set the maximum number of Twists that are allowed...- Parameters:
maxTra
-
-
getAlignScore
public double getAlignScore()
-
setAlignScore
public void setAlignScore(double alignScore)
-
getAlignScoreUpdate
public double getAlignScoreUpdate()
-
setAlignScoreUpdate
public void setAlignScoreUpdate(double alignScoreUpdate)
-
getAfpChainTwiNum
public int getAfpChainTwiNum()
-
setAfpChainTwiNum
public void setAfpChainTwiNum(int afpChainTwiNum)
-
getMinLen
public int getMinLen()
-
setMinLen
public void setMinLen(int minLen)
-
getAfpSet
public List<AFP> getAfpSet()
Get the set of AFPs for this alignment. An AFP is a local ungapped alignment between the two peptides. AFPs are set before the final optimization step. To get the final alignment, look at the aligned pairs fromgetOptAln()
.- Returns:
- The optimal set of AFPs
- See Also:
getOptAln()
-
setAfpSet
public void setAfpSet(List<AFP> afpSet)
Set the set of AFPs for this alignment. An AFP is a local ungapped alignment between the two peptides. AFPs are set before the final optimization step. To get the final alignment, look at the aligned pairs fromgetOptAln()
.
-
getAfpIndex
public int[][] getAfpIndex()
-
setAfpIndex
public void setAfpIndex(int[][] afpIndex)
-
getAfpAftIndex
public int[][] getAfpAftIndex()
-
setAfpAftIndex
public void setAfpAftIndex(int[][] afpAftIndex)
-
getAfpBefIndex
public int[][] getAfpBefIndex()
-
setAfpBefIndex
public void setAfpBefIndex(int[][] afpBefIndex)
-
getDisTable1
public Matrix getDisTable1()
-
setDisTable1
public void setDisTable1(Matrix disTable1)
-
getDisTable2
public Matrix getDisTable2()
-
setDisTable2
public void setDisTable2(Matrix disTable2)
-
getTwi
public int[] getTwi()
-
setTwi
public void setTwi(int[] twi)
-
getAfpChainLen
public int getAfpChainLen()
-
setAfpChainLen
public void setAfpChainLen(int afpChainLen)
-
getAfpChainList
public int[] getAfpChainList()
-
setAfpChainList
public void setAfpChainList(int[] afpChainList)
-
getAfpChainTwiBin
public double[] getAfpChainTwiBin()
-
setAfpChainTwiBin
public void setAfpChainTwiBin(double[] afpChainTwiBin)
-
getAfpChainTwiList
public double[] getAfpChainTwiList()
-
setAfpChainTwiList
public void setAfpChainTwiList(double[] afpChainTwiList)
-
getChainRmsd
public double getChainRmsd()
-
setChainRmsd
public void setChainRmsd(double chainRmsd)
The RMSD of the chain of AFPs. Set during AFPCHainer.traceBack();- Parameters:
chainRmsd
-
-
getChainLen
public int getChainLen()
-
setChainLen
public void setChainLen(int chainLen)
-
getMisLen
public int getMisLen()
-
setMisLen
public void setMisLen(int misLen)
-
getGapLen
public int getGapLen()
-
setGapLen
public void setGapLen(int gapLen)
-
getBlockNum
public int getBlockNum()
The number of blocks in the alignment- Returns:
- the nr of blocks in alignment
-
setBlockNum
public void setBlockNum(int blockNum)
-
getBlockNumIni
public int getBlockNumIni()
-
setBlockNumIni
public void setBlockNumIni(int blockNumIni)
-
getBlockNumClu
public int getBlockNumClu()
-
setBlockNumClu
public void setBlockNumClu(int blockNumClu)
-
getBlockNumSpt
public int getBlockNumSpt()
-
setBlockNumSpt
public void setBlockNumSpt(int blockNumSpt)
-
getBlockRmsd
public double[] getBlockRmsd()
-
setBlockRmsd
public void setBlockRmsd(double[] blockRmsd)
-
getBlock2Afp
public int[] getBlock2Afp()
-
setBlock2Afp
public void setBlock2Afp(int[] block2Afp)
-
getBlockSize
public int[] getBlockSize()
-
setBlockSize
public void setBlockSize(int[] blockSize)
-
getBlockScore
public double[] getBlockScore()
-
setBlockScore
public void setBlockScore(double[] blockScore)
-
getBlockGap
public int[] getBlockGap()
-
setBlockGap
public void setBlockGap(int[] blockGap)
-
getBlockResSize
public int[] getBlockResSize()
-
setBlockResSize
public void setBlockResSize(int[] blockResSize)
-
getBlockResList
public int[][][] getBlockResList()
tracks the residues of the initial blocks (before optimization)- Returns:
- list of block residues
-
setBlockResList
public void setBlockResList(int[][][] blockResList)
-
getFocusResn
public int getFocusResn()
-
setFocusResn
public void setFocusResn(int focusResn)
-
getFocusRes1
public int[] getFocusRes1()
-
setFocusRes1
public void setFocusRes1(int[] focusRes1)
-
getFocusRes2
public int[] getFocusRes2()
-
setFocusRes2
public void setFocusRes2(int[] focusRes2)
-
getFocusAfpn
public int getFocusAfpn()
-
setFocusAfpn
public void setFocusAfpn(int focusAfpn)
-
getFocusAfpList
public int[] getFocusAfpList()
-
setFocusAfpList
public void setFocusAfpList(int[] focusAfpList)
-
isShortAlign
public boolean isShortAlign()
-
setShortAlign
public void setShortAlign(boolean shortAlign)
-
getOptAln
public int[][][] getOptAln()
Tracks the Atom positions in the optimal alignment. Note: only considers the equivalent positions, gaps are ignored... first dimension is the block nr second dimension is 0 or 1 (the alignment chain index) third is the position- Returns:
- int array
-
setOptAln
public void setOptAln(int[][][] optAln)
-
getOptLen
public int[] getOptLen()
The length of each block- Returns:
- lengths
-
setOptLen
public void setOptLen(int[] optLen)
-
getOptRmsd
public double[] getOptRmsd()
-
setOptRmsd
public void setOptRmsd(double[] optRmsd)
-
getOptLength
public int getOptLength()
-
setOptLength
public void setOptLength(int optLength)
The length of the optimal alignment. Set by AFPOptimizer.optimizeAln(). This should be the sum of the elements in optLen- Parameters:
optLength
-
-
getAlnsymb
public char[] getAlnsymb()
-
setAlnsymb
public void setAlnsymb(char[] alnsymb)
-
getAlnseq1
public char[] getAlnseq1()
-
setAlnseq1
public void setAlnseq1(char[] alnseq1)
-
getAlnseq2
public char[] getAlnseq2()
-
setAlnseq2
public void setAlnseq2(char[] alnseq2)
-
getAlnLength
public int getAlnLength()
- Returns:
- The total length of the alignment, including gaps
-
setAlnLength
public void setAlnLength(int alnLength)
-
getAlnbeg1
public int getAlnbeg1()
- Returns:
- The index of the first aligned residue in protein 1
-
setAlnbeg1
public void setAlnbeg1(int alnbeg1)
-
getAlnbeg2
public int getAlnbeg2()
- Returns:
- The index of the first aligned residue in protein 2
-
setAlnbeg2
public void setAlnbeg2(int alnbeg2)
-
getTotalLenIni
public int getTotalLenIni()
-
setTotalLenIni
public void setTotalLenIni(int totalLenIni)
-
getTotalLenOpt
public int getTotalLenOpt()
-
setTotalLenOpt
public void setTotalLenOpt(int totalLenOpt)
-
getTotalRmsdIni
public double getTotalRmsdIni()
this is the init-RMSD, not the final RMSD after refinement.- Returns:
- totalRmsdIni
-
setTotalRmsdIni
public void setTotalRmsdIni(double totalRmsdIni)
this is the init-RMSD, not the final RMSD after refinement.- Parameters:
totalRmsdIni
-
-
getTotalRmsdOpt
public double getTotalRmsdOpt()
The RMSD of the final alignment. Use this to print overal alignment RMSD.- Returns:
- total RMSD of the optimal alignment.
-
setTotalRmsdOpt
public void setTotalRmsdOpt(double totalRmsdOpt)
The RMSD of the final alignment. Use this to print overal alignment RMSD.- Parameters:
totalRmsdOpt
- : total RMSD of the optimal alignment
-
getCalculationTime
public long getCalculationTime()
-
setCalculationTime
public void setCalculationTime(long calculationTime)
-
getCa1Length
public int getCa1Length()
-
setCa1Length
public void setCa1Length(int ca1Length)
-
getCa2Length
public int getCa2Length()
-
setCa2Length
public void setCa2Length(int ca2Length)
-
getIoTime
public long getIoTime()
-
setIoTime
public void setIoTime(long ioTime)
-
getProbability
public double getProbability()
The probability (FATCAT) or Z-score (CE) of the alignment.- Returns:
- either the probability (FATCAT) or the Z-score (CE) of the alignment.
-
setProbability
public void setProbability(double probability)
-
getIdentity
public double getIdentity()
The percent of residues that are sequence-identical in the alignment.- Returns:
- a value between 0 and 1
-
setIdentity
public void setIdentity(double identity)
-
getSimilarity
public double getSimilarity()
Returns the similarity score for the alignment. This gives the percent of sequence similar residues in the alignment.- Returns:
- a double between 0 and 1
-
setSimilarity
public void setSimilarity(double similarity)
-
getNormAlignScore
public double getNormAlignScore()
-
setNormAlignScore
public void setNormAlignScore(double normAlignScore)
-
getBlockRotationMatrix
public Matrix[] getBlockRotationMatrix()
-
setBlockRotationMatrix
public void setBlockRotationMatrix(Matrix[] blockRotationMatrix)
-
getBlockShiftVector
public Atom[] getBlockShiftVector()
-
setBlockShiftVector
public void setBlockShiftVector(Atom[] blockShiftVector)
-
getAlgorithmName
public String getAlgorithmName()
-
setAlgorithmName
public void setAlgorithmName(String algorithmName)
Caution has to be made when changing the algorithmName of an AFPChain, since downstream analysis methods (scores, display, etc) behave differently if the alignment is flexible (created with FatCat).- Parameters:
algorithmName
-
-
getVersion
public String getVersion()
-
setVersion
public void setVersion(String version)
-
isSequentialAlignment
public boolean isSequentialAlignment()
Get whether this alignment has the normal topology, ie the residues aligned in each block increase sequentially over the original protein. This will be false if a circular permutation was detected.- Returns:
- true if the alignment is sequential
-
setSequentialAlignment
public void setSequentialAlignment(boolean sequentialAlignment)
Set whether this alignment has the normal topology, ie the residues aligned in each block increase sequentially over the original protein. This will be false if a circular permutation was detected.
-
getDistanceMatrix
public Matrix getDistanceMatrix()
A matrix with ca1length rows and ca2length columns. For CE this is the distance matrix, but the exact interpretation is left up to the alignment algorithm.Note: A
JMatrixPanel
, which is used in the structure-gui package to display distance matrices, will display the transpose of this matrix. Be sure to take that into account when debugging visually.- Returns:
- A matrix with dimensions ca1length x ca2length, or null
-
setDistanceMatrix
public void setDistanceMatrix(Matrix distanceMatrix)
A matrix with ca1length rows and ca2length columns. For CE this is the distance matrix, but the exact interpretation is left up to the alignment algorithm.- Parameters:
distanceMatrix
- A matrix with dimensions ca1length x ca2length
-
setTMScore
public void setTMScore(double tmScore)
-
getTMScore
public double getTMScore()
Returns the tmScore of the alignment. If the score has not been calcualted yet, returns -1. To calculate it call AFPChainScorer.getTMScore(afpChain, ca1, ca2);- Returns:
- -1, if not calculated, or the TM-score, a score between 0 and 1
-
getDescription2
public String getDescription2()
Get a textual description for the protein 2 of the alignment.- Returns:
-
setDescription2
public void setDescription2(String desc)
Set the textual description for protein 2.- Parameters:
desc
-
-
equals
public boolean equals(Object obj)
A week equality metric. Checks if the optAlign is the same, and if the objects being compared seem to be the same (same names, lengths). Does not check properties of the alignment such as scores or superposition matrices.- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
-