From: Jim Procter Date: Sun, 27 Aug 2017 14:50:03 +0000 (+0100) Subject: JAL-2691 assert chains are recovered by AAStructureBindingModel X-Git-Tag: Release_2_10_2b1~11^2~9^2~2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-2691_nomultimermapping;p=jalview.git JAL-2691 assert chains are recovered by AAStructureBindingModel --- diff --git a/test/jalview/structures/models/AAStructureBindingModelTest.java b/test/jalview/structures/models/AAStructureBindingModelTest.java index c125ef6..aea3687 100644 --- a/test/jalview/structures/models/AAStructureBindingModelTest.java +++ b/test/jalview/structures/models/AAStructureBindingModelTest.java @@ -20,8 +20,8 @@ */ package jalview.structures.models; +import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; import jalview.api.AlignmentViewPanel; @@ -36,6 +36,7 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.JvOptionPane; import jalview.io.DataSourceType; +import jalview.io.FileFormats; import jalview.schemes.ColourSchemeI; import jalview.structure.AtomSpec; import jalview.structure.StructureMappingcommandSet; @@ -43,6 +44,7 @@ import jalview.structure.StructureSelectionManager; import jalview.structures.models.AAStructureBindingModel.SuperposeData; import java.awt.Color; +import java.io.IOException; import java.util.Arrays; import java.util.BitSet; import java.util.List; @@ -98,6 +100,150 @@ public class AAStructureBindingModelTest + "ATOM 33 CA ALA A 10 26.790 4.320 3.172 1.00 11.98 C \n" + "ATOM 39 CA AVAL A 12 24.424 3.853 6.106 0.50 13.83 C \n"; + /** + * Multichain PDB with identical sequences imported - Binding should correctly + * recover chain mappings for each derived sequence + */ + private static final String PDB_4_MC = "HEADER HYDROLASE 09-SEP-09 3A6S \n" + + "ATOM 2 CA MET A 1 15.366 -11.648 24.854 1.00 32.05 C \n" + + "ATOM 10 CA LYS A 2 16.846 -9.215 22.340 1.00 25.68 C \n" + + "ATOM 19 CA LYS A 3 15.412 -6.335 20.343 1.00 19.42 C \n" + + "ATOM 28 CA LEU A 4 15.629 -5.719 16.616 1.00 15.49 C \n" + + "ATOM 36 CA GLN A 5 14.412 -2.295 15.567 1.00 12.19 C \n" + + "ATOM 1030 CA MET B 1 18.869 -7.572 3.432 1.00 31.52 C \n" + + "ATOM 1038 CA LYS B 2 19.182 -10.025 6.313 1.00 26.41 C \n" + + "ATOM 1047 CA LYS B 3 17.107 -12.963 7.534 1.00 19.71 C \n" + + "ATOM 1056 CA LEU B 4 16.142 -13.579 11.164 1.00 14.81 C \n" + + "ATOM 1064 CA GLN B 5 14.648 -17.005 11.785 1.00 13.38 C \n"; + + // TODO: JAL-2227 - import mmCIF PISA assembly & identify master/copy chains + + @Test(groups= {"Functional"}) + public void testImportPDBPreservesChainMappings() throws IOException + { + AlignmentI importedAl = new jalview.io.FormatAdapter().readFile( + PDB_4_MC, DataSourceType.PASTE, FileFormats.getInstance() + .forName(jalview.io.FileFormat.PDB.toString())); + // ideally, we would match on the actual data for the 'File' handle for + // pasted files, + // see JAL-623 - pasting is still not correctly handled... + PDBEntry importedPDB = new PDBEntry("3A6S", "", Type.PDB, + "Paste"); + AAStructureBindingModel binder = new AAStructureBindingModel( + new StructureSelectionManager(), new PDBEntry[] + { importedPDB }, + new SequenceI[][] + { importedAl.getSequencesArray() }, null) + { + + @Override + public void updateColours(Object source) + { + // TODO Auto-generated method stub + + } + + @Override + public void releaseReferences(Object svl) + { + // TODO Auto-generated method stub + + } + + @Override + public String[] getStructureFiles() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String superposeStructures(AlignmentI[] alignments, + int[] structureIndices, HiddenColumns[] hiddenCols) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setJalviewColourScheme(ColourSchemeI cs) + { + // TODO Auto-generated method stub + + } + + @Override + public void setBackgroundColour(Color col) + { + // TODO Auto-generated method stub + + } + + @Override + public void highlightAtoms(List atoms) + { + // TODO Auto-generated method stub + + } + + @Override + public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment) + { + // TODO Auto-generated method stub + return null; + } + + @Override + protected StructureMappingcommandSet[] getColourBySequenceCommands( + String[] files, SequenceRenderer sr, AlignmentViewPanel avp) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public List getChainNames() + { + // TODO Auto-generated method stub + return null; + } + + @Override + protected void colourBySequence( + StructureMappingcommandSet[] colourBySequenceCommands) + { + // TODO Auto-generated method stub + + } + + @Override + public void colourByCharge() + { + // TODO Auto-generated method stub + + } + + @Override + public void colourByChain() + { + // TODO Auto-generated method stub + + } + }; + String[][] chains = binder.getChains(); + assertFalse(chains == null || chains[0] == null, + "No chains discovered by binding"); + assertEquals(2, chains[0].length); + assertEquals("A", chains[0][0]); + assertEquals("B", chains[0][1]); + } AAStructureBindingModel testee; AlignmentI al = null;