22
33import java .util .List ;
44
5- import javax . vecmath . Matrix4d ;
5+ import org . biojava . nbio . structure . Atom ;
66
77/**
88 * A MultipleAlignment is a Data Structure to store the core information of a
99 * multiple structure alignment, as a return type.
1010 * <p>
1111 * Each alignment is described as a collection of:
12- * <ul><li>{@link BlockSet}s that define the aligned positions,
12+ * <ul><li>{@link BlockSet}s that define the aligned positions and 3D
13+ * superposition,
1314 * <li>Structure identifiers (i,e. Atom arrays, structure names),
14- * <li>Information about the 3D superimposition in a set of 4D transformation
15- * matrices,
1615 * <li>Creation properties (algorithm, version, etc).
1716 * </ul>
1817 * A collection of MultipleAlignments that share the same structures and
2625 *
2726 */
2827public interface MultipleAlignment extends ScoresCache {
29-
28+
3029 /**
3130 * Creates and returns an identical copy of this alignment, including a
3231 * deep copy of all constituent BlockSets.
3332 *
3433 * @return MultipleAlignment identical copy of this object.
3534 */
3635 public MultipleAlignment clone ();
37-
36+
3837 /**
39- * Returns the parent Ensemble of the MultipleAlignment.
40- * Returns null if there is no referenced object.
41- *
42- * @return MultipleAlignmentEnsemble the parent MultipleAlignment of the
43- * BlockSet, or null.
44- * @see #setEnsemble(MultipleAlignmentEnsemble)
45- */
38+ * Returns the parent Ensemble of the MultipleAlignment.
39+ * Returns null if there is no referenced object.
40+ *
41+ * @return MultipleAlignmentEnsemble the parent MultipleAlignment of the
42+ * BlockSet, or null.
43+ * @see #setEnsemble(MultipleAlignmentEnsemble)
44+ */
4645 public MultipleAlignmentEnsemble getEnsemble ();
47-
46+
4847 /**
49- * Set the back-reference to its parent Ensemble.
50- * <p>
51- * Neither removes this alignment from its previous ensemble, if any, nor
52- * adds it to the new parent. Calling code should assure that links to
53- * and from the ensemble are consistent and free of memory leaks.
54- *
55- * @param parent the parent MultipleAlignmentEnsemble.
56- * @see #getEnsemble()
57- */
48+ * Set the back-reference to its parent Ensemble.
49+ * <p>
50+ * Neither removes this alignment from its previous ensemble, if any, nor
51+ * adds it to the new parent. Calling code should assure that links to
52+ * and from the ensemble are consistent and free of memory leaks.
53+ *
54+ * @param parent the parent MultipleAlignmentEnsemble.
55+ * @see #getEnsemble()
56+ */
5857 public void setEnsemble (MultipleAlignmentEnsemble parent );
5958
6059 /**
@@ -68,6 +67,18 @@ public interface MultipleAlignment extends ScoresCache {
6867 */
6968 public List <BlockSet > getBlockSets ();
7069
70+ /**
71+ * Returns the BlockSet with the specified index of the MultipleAlignment.
72+ * Throws an Exception if the index is out of bounds, like accessing a
73+ * normal List.
74+ *
75+ * @param index of the BlockSet
76+ * @return BlockSets at the specified index
77+ * @see #getBlocks()
78+ * @see #getBlockSets()
79+ */
80+ public BlockSet getBlockSet (int index );
81+
7182 /**
7283 * Sets the List of BlockSet List of the specified alignment.
7384 *
@@ -79,40 +90,37 @@ public interface MultipleAlignment extends ScoresCache {
7990
8091 /**
8192 * Convenience method to get a List of all Blocks from all BlockSets.
93+ * Modifications of this List will not alter the MultipleAlignment,
94+ * but modifications to the Blocks will.
8295 *
8396 * @return List of Blocks
8497 * @see #getBlockSets()
8598 */
8699 public List <Block > getBlocks ();
87100
88101 /**
89- * Returns a transformation 4D matrix for each structure giving the
90- * 3D superposition information of the multiple structure alignment.
91- * <p>
92- * Individual BlockSets may override the transformation matrix for
93- * particular parts of the alignment. Flexible alignments will generally
94- * return null from this method, while rigid-body methods would typically
95- * store the transformation matrices here as well as in the only BlockSet:
96- * {@link BlockSet#getTransformations()}.
102+ * Returns the Block with the specified index of the MultipleAlignment.
103+ * Throws an Exception if the index is out of bounds, like accessing a
104+ * normal List.
97105 *
98- * @return the 3D superposition information of the alignment or null
99- * if flexible
106+ * @param index of the BlockSet
107+ * @return Block at the specified index
108+ * @see #getBlocks()
109+ * @see #getBlockSets()
100110 */
101- public List < Matrix4d > getTransformations ( );
111+ public Block getBlock ( int index );
102112
103113 /**
104- * Set a new superposition for the structures.
105- * <p>
106- * This may trigger other properties to update which depend on the
107- * superposition. In particular, the list of scores should be reset by
108- * implementations after changing the transformation matrices.
114+ * Returns the array of Atoms for each structure from its parent
115+ * Ensemble.
116+ * Throws an Exception if the parent ensemble is null or the Atom
117+ * variables are not previously set.
109118 *
110- * @param matrices 4D
111- * @throws IllegalArgumentException when the size of the alignment and
112- * the size of transformations do not match.
119+ * @return List of Atom arrays
120+ * @see #getEnsemble()
113121 */
114- public void setTransformations ( List <Matrix4d > transformations );
115-
122+ public List <Atom []> getAtomArrays ( );
123+
116124 /**
117125 * Returns the number of aligned structures in the MultipleAlignment.
118126 *
@@ -141,15 +149,16 @@ public interface MultipleAlignment extends ScoresCache {
141149 * @see #size()
142150 */
143151 public int getCoreLength ();
144-
152+
145153 /**
146154 * Clear scores and other properties which depend on the specific
147155 * alignment. This frees memory and ensures consistency of the cached
148- * variables.<p>
156+ * variables.
157+ * <p>
149158 * Recursively clears member BlockSets.
150159 */
151160 public void clear ();
152-
161+
153162 /**
154163 * Return a summary of the MultipleAlignment, containing the structures,
155164 * the lengths and the cached scores. Can be used as a header for the
@@ -159,4 +168,5 @@ public interface MultipleAlignment extends ScoresCache {
159168 */
160169 @ Override
161170 public String toString ();
171+
162172}
0 commit comments