import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
-import jalview.structure.StructureMapping;
-import jalview.structure.StructureSelectionManager;
import java.io.File;
AlignmentI al;
- String pdbStr = "examples/1gaq.txt";
-
String pdbId;
+ /**
+ * Ensure 'process secondary structure from PDB and add annotations' are set
+ * in preferences, and load PDB example file 1gaq
+ *
+ * @throws Exception
+ */
@BeforeMethod(alwaysRun = true)
public void setup() throws Exception
{
Cache.applicationProperties.setProperty("ADD_SS_ANN",
Boolean.TRUE.toString());
FileLoader loader = new FileLoader(false);
- AlignFrame af = loader.LoadFileWaitTillLoaded(pdbStr,
+ AlignFrame af = loader.LoadFileWaitTillLoaded("examples/1gaq.txt",
FormatAdapter.FILE);
al = af.getViewport().getAlignment();
pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries()
@Test(groups ={ "Functional" })
public void checkPDBSequenceFeatures()
{
- StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
- StructureMapping[] mappings = ssm.getMapping("1gaq");
- // suspect we really want to make assertions on sequence features
- // in these mappings' sequencess
/*
* 1GAQ/A
*/
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- jalview.bin.Jalview.main(new String[]
- { "-props",
+ jalview.bin.Jalview.main(new String[] { "-props",
"test/jalview/io/testProps.jvprops" });
}
import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignedCodonFrame;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.io.FormatAdapter;
import java.util.HashSet;
import java.util.Set;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import MCview.PDBfile;
+
public class StructureSelectionManagerTest
{
private StructureSelectionManager ssm;
assertTrue(ssm.seqmappings.contains(acf2));
assertTrue(ssm.seqmappings.contains(acf3));
}
+
+ /**
+ * Verify that RESNUM sequence features are present after creating a PDB
+ * mapping
+ */
+ @Test(groups = { "Functional" })
+ public void testSetMapping_seqFeatures()
+ {
+ SequenceI seq = new Sequence(
+ "1GAQ|B",
+ "ATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA");
+ StructureSelectionManager sm = new StructureSelectionManager();
+ sm.setProcessSecondaryStructure(true);
+ sm.setAddTempFacAnnot(true);
+ PDBfile pmap = sm.setMapping(true, new SequenceI[] { seq },
+ new String[] { null }, "examples/1gaq.txt",
+ FormatAdapter.FILE);
+ assertTrue(pmap != null);
+
+ assertEquals(3, pmap.getSeqs().size());
+ assertEquals("1GAQ|A", pmap.getSeqs().get(0).getName());
+ assertEquals("1GAQ|B", pmap.getSeqs().get(1).getName());
+ assertEquals("1GAQ|C", pmap.getSeqs().get(2).getName());
+
+ /*
+ * Verify a RESNUM sequence feature in the PDBfile sequence
+ */
+ SequenceFeature sf = pmap.getSeqs().get(0).getSequenceFeatures()[0];
+ assertEquals("RESNUM", sf.getType());
+ assertEquals("1gaq", sf.getFeatureGroup());
+ assertEquals("GLU: 19 1gaqA", sf.getDescription());
+
+ /*
+ * Verify a RESNUM sequence feature in the StructureSelectionManager mapped
+ * sequence
+ */
+ StructureMapping map = sm.getMapping("examples/1gaq.txt")[0];
+ sf = map.sequence.getSequenceFeatures()[0];
+ assertEquals("RESNUM", sf.getType());
+ assertEquals("1gaq", sf.getFeatureGroup());
+ assertEquals("ALA: 1 1gaqB", sf.getDescription());
+ }
}