StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager();
// Associate the 1GAQ pdb file with the subsequence 'imported' from another
// source
- PDBfile pde = ssm.setMapping(new SequenceI[]
+ PDBfile pde = ssm.setMapping(true, new SequenceI[]
{ sq }, new String[]
{ "A" }, inFile = "examples/1gaq.txt", jalview.io.FormatAdapter.FILE);
assertTrue("PDB File couldn't be found", pde != null);
StructureMapping[] mp = ssm.getMapping(inFile);
assertTrue("No mappings made.", mp != null && mp.length > 0);
- boolean hasSecStr=false,hasTemp=false;
+ int nsecStr = 0, nsTemp = 0;
+ // test for presence of transferred annotation on sequence
+ for (AlignmentAnnotation alan : sq.getAnnotation())
+ {
+ if (alan.hasIcons)
+ {
+ nsecStr++;
+ }
+ if (alan.graph == alan.LINE_GRAPH)
+ {
+ nsTemp++;
+ }
+ }
+ assertEquals(
+ "Only one secondary structure should be transferred to associated sequence.",
+ 1, nsecStr);
+ assertEquals(
+ "Only two line graphs should be transferred to associated sequence.",
+ 2, nsTemp);
+ // Now test the transfer function and compare annotated positions
for (StructureMapping origMap:mp)
{
if (origMap.getSequence()==sq)
}
}
}
- hasSecStr = false;
- hasTemp = false;
- // test for presence of transferred annotation on sequence
- for (AlignmentAnnotation alan : sq.getAnnotation())
- {
- if (alan.hasIcons)
- {
- hasSecStr = true;
- }
- if (alan.graph == alan.LINE_GRAPH)
- {
- hasTemp = true;
- }
- }
- assertTrue("No secondary structure transferred to associated sequence.",hasSecStr);
- assertTrue("No temperature factor transferred to associated sequence.",hasTemp);
}
}