Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b39abe8
Core DS of MultipleAlignment Object
lafita Apr 20, 2015
47f78a4
Comment and rename variables
lafita Apr 22, 2015
940abe9
Pose translation and rotationMatrix
lafita Apr 22, 2015
2db5fd0
Create an AlignmentJmol superclass
lafita Apr 22, 2015
96146e1
Create MultipleAlignmentJmol panel
lafita Apr 23, 2015
e26b518
Support gaps in MultipleAlignmentJmol
lafita Apr 23, 2015
a6f277a
Move distanceMatrix to MultipleAlignment
lafita Apr 23, 2015
76b2193
Fix bug StructureAlignmentJmol
lafita Apr 23, 2015
67dc88b
Minor changes to respond to TODOs
sbliven Apr 23, 2015
5a3b857
Rotation of the atoms from Pose
lafita Apr 24, 2015
7c5e658
Merge pull request #1 from sbliven/multaln
lafita Apr 24, 2015
4eeb79a
Interface for the MSTA DS
lafita Apr 24, 2015
04cb81a
Resolve conflicts with local branch
lafita Apr 24, 2015
f779866
Re-implement interfaces MultipleAlignment
lafita Apr 24, 2015
c38bac3
Extend BlockSet and Pose interfaces
lafita Apr 24, 2015
d377a68
Create MultipleAlignment and EnsembleMSTA interface
lafita Apr 27, 2015
86c50b3
Rename EnsembleMSTA to MultipleAlignmentEnsemble
lafita Apr 28, 2015
abdeb41
Adapt Demo and Display to MultipleAlignment changes
lafita Apr 28, 2015
1a4dc9b
Objects cross-linked automatically
lafita Apr 28, 2015
802cb23
Implement distance Matrix calculation
lafita Apr 28, 2015
896f29c
Pose method to calculate background distances
lafita Apr 28, 2015
de38877
Create Pose abstract with RMSD and TMscore
lafita Apr 29, 2015
863b26f
Include PoseAbstractImpl class
lafita Apr 29, 2015
b7a4b75
Fix bug with global RMSD and TMscore in Pose
lafita Apr 29, 2015
bab611a
Create AFPChain to MultipleAlignment converter
lafita Apr 29, 2015
bbf1ab0
Comment and name changes
lafita Apr 30, 2015
a01ce4f
Fix clone issues with MultipleAlignment
lafita May 4, 2015
3dc807a
CEMC initial implementation with threading
lafita May 5, 2015
b4da244
Fix clone bug in BlockSet
lafita May 5, 2015
4e45c17
New interface for MSTA Algorithms
lafita May 5, 2015
16e8849
Fix Jmol visualization bug in MultipleAlignment
lafita May 6, 2015
09000da
Join CallableStructureAlignment and PrallelAlignment
lafita May 6, 2015
d499b84
Change to structure identifiers in MultipleAlignment
lafita May 6, 2015
a10f358
Fix selection bug in JmolPanel GUI
lafita May 8, 2015
d215b31
Improve MultipleAlignment visualization
lafita May 8, 2015
9ab4735
Fix bug with Distance Matrix display
lafita May 20, 2015
286e7fe
Fix bug in replaceOptAln block calculation
lafita May 20, 2015
592ebf1
Fix RotationAxis rounding-error bug
lafita May 20, 2015
3f2efd2
Implement CEMC optimization algorithm
lafita May 21, 2015
55f581b
Adding vecmath output methods to Calc and SVDSuperimposer
sbliven May 21, 2015
aaf5cb1
Replacing getParent with more descriptive names
sbliven May 21, 2015
41923e2
Providing more specific clone function
sbliven May 21, 2015
512a8a0
MultipleAlignmentJmol colors the Blocks differently
lafita May 21, 2015
7c41412
Fix problem with light colors in MultipleAlignmentJmol
lafita May 21, 2015
2c9602a
Reorganizing the MultipleAlignmentEnsemble structure slightly.
sbliven May 22, 2015
74fdb59
AlignPanel for MultipleAlignment
lafita May 22, 2015
ac392ef
Removing unneeded StructureException from clone methods
sbliven May 22, 2015
428d248
Merge commit 'ac392ef' into multaln
sbliven May 22, 2015
6c9ffec
Add new families to the CEMC demo
lafita May 22, 2015
2449aba
Add AtomCache.getRepresentativeAtoms
sbliven May 22, 2015
a4d2e48
Restore the AligPanel for AFPChain
lafita May 26, 2015
2f6fd5a
Changes in AligPanel for MultipleAlignments
lafita May 26, 2015
119563a
Connect MultipleAlignment AligPanel and Jmol
lafita May 27, 2015
b5563d4
Updates to the MultipleAlignmentEnsemble hierarchy
sbliven May 28, 2015
50b5afb
Merge remote-tracking branch 'lafita/multaln' into multaln
sbliven May 29, 2015
e39bbd3
Fixing compilation errors
sbliven Jun 5, 2015
8ff345c
Removing getAlnSequences from MultipleAlignment
sbliven Jun 8, 2015
d6be054
Fix bug with 4D Transformation Calc
lafita Jun 9, 2015
fec4c4d
Move code to align.multiple package and rename classes #278
lafita Jun 9, 2015
e0091c8
Fix buf with AFPChain to MultipleAlignment conversion
lafita Jun 9, 2015
35a58e6
Delete unneccessary Exceptions
lafita Jun 9, 2015
a13d2f7
MultipleAlignment.toString() generates alignment summary
lafita Jun 10, 2015
531c6ba
Method to transform Atom[] arrays in Calc
lafita Jun 10, 2015
9f36fc9
Merge pull request #1 from lafita/multaln
lafita Jun 11, 2015
4e4928b
Update documentation of MultipleAlignment DS
lafita Jun 12, 2015
af9df1f
MultipleAlignmentWriter with FASTA conversion
lafita Jun 12, 2015
20ef923
Alignment Panel for MultipleAlignment complete
lafita Jun 15, 2015
1f231ba
Implement color seq similarity and block MultipleAligPanel
lafita Jun 15, 2015
d19c9e0
Fix bug ReferenceSuperimposer and MultipleAlignmentDisplay
lafita Jun 15, 2015
5f1697e
Re-Structure MultipleAlignment code for scores and display
lafita Jun 15, 2015
31de80f
Remove and replace StructureAlignmentException
lafita Jun 15, 2015
c3f77ee
Implement output String methods for MultipleAlignment
lafita Jun 15, 2015
fac0299
Fix MenuCreator bug and adapt to MultipleAlignment
lafita Jun 16, 2015
72aad05
Tests for MultipleAlignment scores and AFP conversion
lafita Jun 16, 2015
8c01bc3
Upgrade the MultipleAlignment tests to the version 4 format
lafita Jun 16, 2015
1c717b6
Merge pull request #2 from lafita/multaln
lafita Jun 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biojava-structure-gui/src/main/java/demo/CookBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static void main(String[] args){
jmol.setTitle(algorithm.getAlgorithmName() + " : " + name1 + " vs. " + name2);

// here we open up the alignment - text panel that can interact with the 3D jmol display.
DisplayAFP.showAlignmentImage(afpChain, ca1,ca2,jmol);
DisplayAFP.showAlignmentPanel(afpChain, ca1,ca2,jmol);

// we can print an XML version
//System.out.println(AFPChainXMLConverter.toXML(afpChain, ca1, ca2));
Expand Down
70 changes: 70 additions & 0 deletions biojava-structure-gui/src/main/java/demo/DemoCEMC.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package demo;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;

import org.biojava.nbio.structure.Atom;
import org.biojava.nbio.structure.StructureException;
import org.biojava.nbio.structure.align.cemc.CeMcMain;
import org.biojava.nbio.structure.align.gui.MultipleAlignmentDisplay;
import org.biojava.nbio.structure.align.multiple.MultipleAlignment;
import org.biojava.nbio.structure.align.util.AtomCache;

/**
* Demo for running a CEMC Multiple Structure Alignment and visualizing the results.
*
* @author Aleix Lafita
*
*/
public class DemoCEMC {

public static void main(String[] args) throws IOException, StructureException, InterruptedException, ExecutionException {

//Specify the structures to align
//ASP-proteinases (CEMC paper)
//List<String> names = Arrays.asList("3app", "4ape", "2apr", "5pep", "1psn", "4cms", "1bbs.A", "1smr.A", "2jxr.A", "1mpp", "2asi", "1am5");
//Protein Kinases (CEMC paper)
//List<String> names = Arrays.asList("1cdk.A", "1cja.A", "1csn", "1b6c.B", "1ir3.A", "1fgk.A", "1byg.A", "1hck", "1blx.A", "3erk", "1bmk.A", "1kob.A", "1tki.A", "1phk", "1a06");
//DHFR (Gerstein 1998 paper)
List<String> names = Arrays.asList("d1dhfa_", "8dfr", "d4dfra_", "3dfr");
//TIM barrels (MUSTA paper)
//List<String> names = Arrays.asList("1tim.A", "1vzw", "1nsj", "3tha.A", "4enl", "2mnr", "7tim.A", "1tml", "1btc", "a1piia1", "6xia", "5rub.A", "2taa.B");
//Helix-bundle (MUSTA paper)
//List<String> names = Arrays.asList("1bbh.A", "1aep", "1bge.B", "256b.A", "2ccy.A", "2hmz.A", "3ink.C");
//Calcium Binding (MUSTA paper)
//List<String> names = Arrays.asList("4cpv", "2scp.A", "2sas", "1top", "1scm.B", "3icb");
//Serine Rich Proteins SERP (MUSTA paper)
//List<String> names = Arrays.asList("7api.A", "8api.A", "1hle.A", "1ova.A", "2ach.A", "9api.A", "1psi", "1atu", "1kct", "1ath.A", "1att.A");
//Serine Proteases (MUSTA paper)
//List<String> names = Arrays.asList("1cse.E", "1sbn.E", "1pek.E", "3prk", "3tec.E");
//GPCRs
//List<String> names = Arrays.asList("2z73.A", "1u19.A", "4ug2.A", "4xt3", "4or2.A", "3odu.A");
//Immunoglobulins (MAMMOTH paper)
//List<String> names = Arrays.asList("2hla.B", "3hla.B", "1cd8", "2rhe", "1tlk", "1ten", "1ttf");
//Globins (MAMMOTH and MUSTA papers)
//List<String> names = Arrays.asList("1mbc", "1hlb", "1thb.A", "1ith.A", "1idr.A", "1dlw", "1kr7.A", "1ew6.A", "1it2.A", "1eco", "3sdh.A", "1cg5.B", "1fhj.B", "1ird.A", "1mba", "2gdm", "1b0b", "1h97.A", "1ash.A", "1jl7.A");
//Rossman-Fold (POSA paper)
//List<String> names = Arrays.asList("d1heta2", "d1ek6a_", "d1obfo1", "2cmd", "d1np3a2", "d1bgva1", "d1id1a_", "d1id1a_", "d1oi7a1");

//Load the CA atoms of the structures
AtomCache cache = new AtomCache();
List<Atom[]> atomArrays = new ArrayList<Atom[]>();
for (String name:names) {
atomArrays.add(cache.getAtoms(name));
}

//Here the multiple structural alignment algorithm comes in place to generate the alignment object
CeMcMain algorithm = new CeMcMain();
MultipleAlignment result = algorithm.align(atomArrays);
result.getEnsemble().setStructureNames(names);

//Information about the alignment
result.getEnsemble().setAlgorithmName(algorithm.getAlgorithmName());
result.getEnsemble().setVersion(algorithm.getVersion());

MultipleAlignmentDisplay.display(result);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
package demo;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.biojava.nbio.structure.Atom;
import org.biojava.nbio.structure.StructureException;
import org.biojava.nbio.structure.align.gui.MultipleAlignmentDisplay;
import org.biojava.nbio.structure.align.multiple.Block;
import org.biojava.nbio.structure.align.multiple.BlockImpl;
import org.biojava.nbio.structure.align.multiple.BlockSet;
import org.biojava.nbio.structure.align.multiple.BlockSetImpl;
import org.biojava.nbio.structure.align.multiple.MultipleAlignment;
import org.biojava.nbio.structure.align.multiple.MultipleAlignmentEnsemble;
import org.biojava.nbio.structure.align.multiple.MultipleAlignmentEnsembleImpl;
import org.biojava.nbio.structure.align.multiple.MultipleAlignmentImpl;
import org.biojava.nbio.structure.align.multiple.MultipleAlignmentScorer;
import org.biojava.nbio.structure.align.multiple.MultipleAlignmentWriter;
import org.biojava.nbio.structure.align.multiple.MultipleSuperimposer;
import org.biojava.nbio.structure.align.multiple.ReferenceSuperimposer;
import org.biojava.nbio.structure.align.util.AtomCache;

/**
* Demo for visualizing the results of a Multiple Alignment, from a sample MultipleAlignment object.
*
* @author Aleix Lafita
*
*/
public class DemoMultipleAlignmentJmol {

public static void main(String[] args) throws IOException, StructureException {

//Specify the structures to align
//List<String> names = Arrays.asList("1tim.a", "1vzw", "1nsj", "3tha.a"); //TIM barrels
List<String> names = Arrays.asList("1mbc", "1hlb", "1thb.a", "1ith.a"); //globins

//Load the CA atoms of the structures
AtomCache cache = new AtomCache();
List<Atom[]> atomArrays = new ArrayList<Atom[]>();
for (String name:names) atomArrays.add(cache.getAtoms(name));

//Here the multiple structural alignment algorithm comes in place to generate the alignment object
MultipleAlignment fakeMultAln = fakeMultipleAlignment("globins", atomArrays);
fakeMultAln.getEnsemble().setStructureNames(names);

//Generate a pairwise alignment and convert it to a MultipleAlignment
//FatCat fatcat = new FatCat();
//AFPChain afpChain = fatcat.alignRigid(atomArrays.get(0),atomArrays.get(1));
//MultipleAlignmentEnsemble ensemble = new MultipleAlignmentEnsembleImpl(afpChain, atomArrays.get(0),atomArrays.get(1));
//MultipleAlignment pairwise = ensemble.getMultipleAlignments().get(0);

System.out.println(MultipleAlignmentWriter.toFASTA(fakeMultAln));
MultipleAlignmentDisplay.display(fakeMultAln);
//StructureAlignmentDisplay.display(pairwise);
//For comparison display the original AFP
//StructureAlignmentDisplay.display(afpChain,atomArrays.get(0),atomArrays.get(1));
}

/**
* Method that constructs a fake MultipleAlignment with two BlockSets, with two and one Blocks respectively. Used to
* test the correctness of the DataStructure. In the future it will be in the Test packages.
* @param family name of the protein family
* @param atomArrays
* @return MultipleAlignment
* @throws StructureException
* @throws StructureAlignmentException
*/
private static MultipleAlignment fakeMultipleAlignment(String family, List<Atom[]>atomArrays) throws StructureException {

//Initialize the multiple alignment parent ensemble
MultipleAlignmentEnsemble ensemble = new MultipleAlignmentEnsembleImpl();
ensemble.setAtomArrays(atomArrays);
ensemble.setAlgorithmName("fakeAlgorithm");
MultipleAlignment fakeMultAln = new MultipleAlignmentImpl(ensemble);

if (family == "globins"){

BlockSet blockSet1 = new BlockSetImpl(fakeMultAln); //first BlockSet with 2 Blocks
BlockSet blockSet2 = new BlockSetImpl(fakeMultAln); //second BlockSet with 1 Block

Block block1 = new BlockImpl(blockSet1);
Block block2 = new BlockImpl(blockSet1);

Block block3 = new BlockImpl(blockSet2);

//Alignment obtained from MUSTANG multiple alignment (just some of the residues, not the whole alignment)
List<Integer> aligned11 = Arrays.asList(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
List<Integer> aligned12 = Arrays.asList(29,30,31,32,33,34,35,36,38);
List<Integer> aligned13 = Arrays.asList(123,124,125,126,127,128,129,130,131,132,133,134);

List<Integer> aligned21 = Arrays.asList(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,null,27,28,29,30,31);
List<Integer> aligned22 = Arrays.asList(39,40,41,42,43,44,45,46,48);
List<Integer> aligned23 = Arrays.asList(133,134,135,136,137,138,139,140,141,142,143,144);

List<Integer> aligned31 = Arrays.asList(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
List<Integer> aligned32 = Arrays.asList(29,30,31,32,33,34,35,36,38);
List<Integer> aligned33 = Arrays.asList(117,118,119,120,121,122,123,124,125,126,127,128);

List<Integer> aligned41 = Arrays.asList(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,null,17,18,19,20,21);
List<Integer> aligned42 = Arrays.asList(30,31,32,33,34,35,36,37,39);
List<Integer> aligned43 = Arrays.asList(121,122,123,124,125,126,127,128,129,130,131,132);

block1.getAlignRes().add(aligned11);
block1.getAlignRes().add(aligned21);
block1.getAlignRes().add(aligned31);
block1.getAlignRes().add(aligned41);

block2.getAlignRes().add(aligned12);
block2.getAlignRes().add(aligned22);
block2.getAlignRes().add(aligned32);
block2.getAlignRes().add(aligned42);

block3.getAlignRes().add(aligned13);
block3.getAlignRes().add(aligned23);
block3.getAlignRes().add(aligned33);
block3.getAlignRes().add(aligned43);

//Calculating all information in the alignment is as easy as that line, once the residue equivalencies are set
MultipleSuperimposer imposer = new ReferenceSuperimposer();
imposer.superimpose(fakeMultAln);
MultipleAlignmentScorer.calculateScores(fakeMultAln);
}
return fakeMultAln;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ public void run() {
title += " " + algorithm.getParameters().toString();
jmol.setTitle(title);

DisplayAFP.showAlignmentImage(afpChain,ca1,ca2,jmol);
DisplayAFP.showAlignmentPanel(afpChain,ca1,ca2,jmol);

System.out.println(afpChain.toCE(ca1,ca2));

} catch (StructureException e){
e.printStackTrace();
logger.warn(e.getMessage());

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private void showAlignment( String name1, String name2){

//String rot = afpChain.toRotMat();

DisplayAFP.showAlignmentImage(afpChain, ca1,ca2,jmol);
DisplayAFP.showAlignmentPanel(afpChain, ca1,ca2,jmol);


} catch (Exception e){
Expand Down
Loading