Skip to content

Commit 40917ab

Browse files
authored
Fix multiple structure alignment example II
biojava#14
1 parent 32043de commit 40917ab

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

structure/alignment.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,13 @@ example of how to create and display a multiple alignment:
333333
//Specify the structures to align: some ASP-proteinases
334334
List<String> names = Arrays.asList("3app", "4ape", "5pep", "1psn", "4cms", "1bbs.A", "1smr.A");
335335

336-
//Load the CA atoms of the structures
336+
//Load the CA atoms of the structures and create the structure identifiers
337337
AtomCache cache = new AtomCache();
338338
List<Atom[]> atomArrays = new ArrayList<Atom[]>();
339+
List<StructureIdentifier> identifiers = new ArrayList<StructureIdentifier>();
339340
for (String name:names) {
340341
atomArrays.add(cache.getAtoms(name));
342+
identifiers.add(new SubstructureIdentifier(name));
341343
}
342344

343345
//Generate the multiple alignment algorithm with the chosen pairwise algorithm
@@ -347,6 +349,9 @@ MultipleMcMain multiple = new MultipleMcMain(pairwise);
347349
//Perform the alignment
348350
MultipleAlignment result = multiple.align(atomArrays);
349351

352+
// Set the structure identifiers, so that each atom array can be identified in the outputs
353+
result.getEnsemble().setStructureIdentifiers(identifiers);
354+
350355
//Output the FASTA sequence alignment
351356
System.out.println(MultipleAlignmentWriter.toFASTA(result));
352357

0 commit comments

Comments
 (0)