Skip to content

Commit aea237a

Browse files
committed
biojava#383 updating of demo scripts to new StructureIdentifier convention
1 parent 13abec3 commit aea237a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

biojava-structure-gui/src/main/java/demo/DemoMultipleMC.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import org.biojava.nbio.structure.Atom;
3030
import org.biojava.nbio.structure.StructureException;
31+
import org.biojava.nbio.structure.StructureIdentifier;
32+
import org.biojava.nbio.structure.SubstructureIdentifier;
3133
import org.biojava.nbio.structure.align.StructureAlignment;
3234
import org.biojava.nbio.structure.align.ce.CeMain;
3335
import org.biojava.nbio.structure.align.gui.MultipleAlignmentDisplay;
@@ -94,9 +96,13 @@ public static void main(String[] args) throws IOException, StructureException, I
9496

9597
//Load the CA atoms of the structures
9698
AtomCache cache = new AtomCache();
99+
100+
List<StructureIdentifier> identifiers = new ArrayList<StructureIdentifier>();
101+
97102
List<Atom[]> atomArrays = new ArrayList<Atom[]>();
98103
for (String name:names) {
99104
atomArrays.add(cache.getAtoms(name));
105+
identifiers.add(new SubstructureIdentifier(name));
100106
}
101107

102108
//Here the multiple structural alignment algorithm comes in place to generate the alignment object
@@ -108,7 +114,7 @@ public static void main(String[] args) throws IOException, StructureException, I
108114
params.setGapExtension(20.0);
109115

110116
MultipleAlignment result = algorithm.align(atomArrays);
111-
result.getEnsemble().setStructureNames(names);
117+
result.getEnsemble().setStructureIdentifiers(identifiers);
112118

113119
//Information about the alignment
114120
result.getEnsemble().setAlgorithmName(algorithm.getAlgorithmName());

biojava-structure/src/main/java/demo/DemoMultipleMC.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
import org.biojava.nbio.structure.Atom;
3030
import org.biojava.nbio.structure.StructureException;
31+
import org.biojava.nbio.structure.StructureIdentifier;
32+
import org.biojava.nbio.structure.SubstructureIdentifier;
3133
import org.biojava.nbio.structure.align.ce.CeMain;
3234
import org.biojava.nbio.structure.align.multiple.MultipleAlignment;
3335
import org.biojava.nbio.structure.align.multiple.mc.MultipleMcMain;
@@ -91,8 +93,11 @@ public static void main(String[] args) throws IOException, StructureException, I
9193
//Load the CA atoms of the structures
9294
AtomCache cache = new AtomCache();
9395
List<Atom[]> atomArrays = new ArrayList<Atom[]>();
96+
97+
List<StructureIdentifier> identifiers = new ArrayList<StructureIdentifier>();
9498
for (String name:names) {
9599
atomArrays.add(cache.getAtoms(name));
100+
identifiers.add(new SubstructureIdentifier(name));
96101
}
97102

98103
//Here the multiple structural alignment algorithm comes in place to generate the alignment object
@@ -102,7 +107,7 @@ public static void main(String[] args) throws IOException, StructureException, I
102107
params.setMinAlignedStructures(10);
103108

104109
MultipleAlignment result = algorithm.align(atomArrays);
105-
result.getEnsemble().setStructureNames(names);
110+
result.getEnsemble().setStructureIdentifiers(identifiers);
106111

107112
//Information about the alignment
108113
result.getEnsemble().setAlgorithmName(algorithm.getAlgorithmName());

0 commit comments

Comments
 (0)