*/
package jalview.structure;
+import static org.junit.Assert.assertArrayEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
import jalview.analysis.AlignmentUtils;
+import jalview.api.structures.JalviewStructureDisplayI;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
AlignmentI al = alf.getViewport().getAlignment();
SequenceI seq = al.getSequenceAt(0);
assertEquals(470, seq.getStart());
- SequenceI[] selectedSeqs = new SequenceI[] { seq };
-
// load 4IM2 (full length, SIFTS)
SiftsSettings.setMapWithSifts(true);
StructureImportSettings.setProcessSecondaryStructure(true);
StructureImportSettings.setVisibleChainAnnotation(true);
-
- StructureChooser schoose = new StructureChooser(selectedSeqs, seq,
- alf.getViewport().getAlignPanel());
-
- try
- {
- Thread.sleep(5000);
- } catch (InterruptedException q)
- {
- }
- ;
- schoose.selectStructure(PDBID);
- schoose.ok_ActionPerformed();
- try
- {
- Thread.sleep(10000);
- } catch (InterruptedException q)
- {
- }
- ;
+ openStructureViaChooser(alf, seq, PDBID);
AlignmentAnnotation subseq_tf=null;
assertTrue(seq.getDBRefs() != null && seq.getDBRefs().length > 0);
// verify location of secondary structure annotation
// Specific positions: LYS477 (h),THR478 (no helix), ... GLY496(no helix),
// GLU497 (helix),
- PDBEntry pdbe = seq.getPDBEntry(PDBID);
- StructureMapping[] sm = alf.alignPanel.getStructureSelectionManager()
- .getMapping(pdbe.getFile());
- assertNotNull(sm);
- assertNotNull(sm[0]);
- List<int[]> ranges = sm[0].getPDBResNumRanges(seq.getStart(),seq.getEnd());
// check there is or is not a tempfactor for each mapped position, and that
// values are equal for those positions.
for (int p=seq.getStart();p<=seq.getEnd();p++)
}
+ private JalviewStructureDisplayI openStructureViaChooser(AlignFrame alf,
+ SequenceI seq,
+ String pDBID)
+ {
+
+ SequenceI[] selectedSeqs = new SequenceI[] { seq };
+
+ StructureChooser schoose = new StructureChooser(selectedSeqs, seq,
+ alf.getViewport().getAlignPanel());
+
+ try
+ {
+ Thread.sleep(5000);
+ } catch (InterruptedException q)
+ {
+ }
+ ;
+ Assert.assertTrue(schoose.selectStructure(pDBID),
+ "Couldn't select structure via structure chooser: " + pDBID);
+ schoose.showStructures(true);
+ return schoose.getOpenedStructureViewer();
+ }
+
}