public class StructurePairAligner extends Object
The algorithm is a distance matrix based, rigid body protein structure superimposition. It is based on a variation of the PSC++ algorithm provided by Peter Lackner (Peter.Lackner@sbg.ac.at, personal communication) .
public void run(){ // first load two example structuresInputStream
inStream1 = this.getClass().getResourceAsStream("/files/5pti.pdb");InputStream
inStream2 = this.getClass().getResourceAsStream("/files/1tap.pdb");Structure
structure1 = null;Structure
structure2 = null;PDBFileParser
pdbpars = newPDBFileParser
(); structure1 = pdbpars.parsePDBFile(inStream1) ; structure2 = pdbpars.parsePDBFile(inStream2); // calculate structure superimposition for two complete structuresStructurePairAligner
aligner = newStructurePairAligner
(); // align the full 2 structures with default parameters. // see StructurePairAligner for more options and how to align // any set of Atoms aligner.align(structure1,structure2);AlternativeAlignment
[] aligs = aligner.getAlignments();AlternativeAlignment
a = aligs[0]; System.out.println(a); //display the alignment in Jmol // first get an artificial structure for the alignmentStructure
artificial = a.getAlignedStructure(structure1, structure2); // and then send it to Jmol (only will work if Jmol is in the Classpath) BiojavaJmol jmol = new BiojavaJmol(); jmol.setTitle(artificial.getName()); jmol.setStructure(artificial); // color the two structures jmol.evalString("select *; backbone 0.4; wireframe off; spacefill off; " + "select not protein and not solvent; spacefill on;"); jmol.evalString("select *"+"/1 ; color red; model 1; "); // now color the equivalent residues ... String[] pdb1 = a.getPDBresnum1(); for (String res : pdb1 ){ jmol.evalString("select " + res + "/1 ; backbone 0.6; color white;"); } jmol.evalString("select *"+"/2; color blue; model 2;"); String[] pdb2 = a.getPDBresnum2(); for (String res :pdb2 ){ jmol.evalString("select " + res + "/2 ; backbone 0.6; color yellow;"); } // now show both models again. jmol.evalString("model 0;"); }
Constructor and Description |
---|
StructurePairAligner() |
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(AlignmentProgressListener li) |
void |
align(Atom[] ca1,
Atom[] ca2,
StrucAligParameters params)
calculate the protein structure superimposition, between two sets of
atoms.
|
void |
align(Structure s1,
String chainId1,
Structure s2,
String chainId2)
Align two chains from the structures.
|
void |
align(Structure s1,
String chainId1,
Structure s2,
String chainId2,
StrucAligParameters params)
Aligns two chains from the structures using user provided parameters.
|
void |
align(Structure s1,
Structure s2)
Calculate the alignment between the two full structures with default
parameters
|
void |
align(Structure s1,
Structure s2,
StrucAligParameters params)
Calculate the alignment between the two full structures with user
provided parameters
|
void |
clearListeners() |
Atom[] |
getAlignmentAtoms(Structure s)
Returns the atoms that are being used for the alignment.
|
AlternativeAlignment[] |
getAlignments()
return the alternative alignments that can be found for the two
structures
|
Matrix |
getDistMat()
return the difference of distance matrix between the two structures
|
FragmentPair[] |
getFragmentPairs()
get the results of step 1 - the FragmentPairs used for seeding the
alignment
|
StrucAligParameters |
getParams()
get the parameters.
|
static void |
main(String[] args)
example usage of this class
|
void |
setFragmentPairs(FragmentPair[] fragPairs) |
void |
setParams(StrucAligParameters params)
set the parameters to be used for the algorithm
|
public StructurePairAligner()
public void addProgressListener(AlignmentProgressListener li)
public void clearListeners()
public static void main(String[] args) throws Exception
args
- Exception
public FragmentPair[] getFragmentPairs()
public void setFragmentPairs(FragmentPair[] fragPairs)
public AlternativeAlignment[] getAlignments()
public Matrix getDistMat()
public StrucAligParameters getParams()
public void setParams(StrucAligParameters params)
params
- the Parameter objectpublic void align(Structure s1, Structure s2) throws StructureException
s1
- s2
- StructureException
public void align(Structure s1, Structure s2, StrucAligParameters params) throws StructureException
s1
- s2
- params
- StructureException
public void align(Structure s1, String chainId1, Structure s2, String chainId2) throws StructureException
s1
- chainId1
- s2
- chainId2
- StructureException
public void align(Structure s1, String chainId1, Structure s2, String chainId2, StrucAligParameters params) throws StructureException
s1
- chainId1
- s2
- chainId2
- params
- StructureException
public Atom[] getAlignmentAtoms(Structure s)
s
- public void align(Atom[] ca1, Atom[] ca2, StrucAligParameters params) throws StructureException
ca1
- set of Atoms of structure 1ca2
- set of Atoms of structure 2params
- the parameters to use for the alignmentStructureException
Copyright © 2000–2018 BioJava. All rights reserved.