From: Jim Procter Date: Tue, 9 May 2017 14:15:54 +0000 (+0100) Subject: JAL-2507 test for alignment+rna annotation -> Stockholm -> roundtrip. X-Git-Tag: Release_2_10_2~3^2~88^2~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4f4fafd245688999762bd8848d5d943271a4ed5f;p=jalview.git JAL-2507 test for alignment+rna annotation -> Stockholm -> roundtrip. --- diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index e7f1435..3c6c4e1 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -30,6 +30,7 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.gui.AlignFrame; import jalview.gui.JvOptionPane; import java.io.File; @@ -436,4 +437,30 @@ public class StockholmFileTest } } } + + String aliFile = ">Dm\nAAACCCUUUUACACACGGGAAAGGG"; + String annFile = "JALVIEW_ANNOTATION\n# Created: Thu May 04 11:16:52 BST 2017\n\n" + + "SEQUENCE_REF\tDm\nNO_GRAPH\tsecondary structure\tsecondary structure\t" + + "(|(|(|(|, .|, .|, .|, .|)|)|)|)|\t0.0\nROWPROPERTIES\t" + + "secondary structure\tscaletofit=true\tshowalllabs=true\tcentrelabs=false"; + + @Test(groups = { "Functional" }) + public void secondaryStructureForRNASequence() throws Exception + { + AlignFrame al = new FileLoader(false).LoadFileWaitTillLoaded(aliFile, + DataSourceType.PASTE); + al.loadJalviewDataFile(annFile, DataSourceType.PASTE, null, null); + + // TODO: create a better 'save as ' pattern + String stockholmFile = new jalview.io.StockholmFile(al.getViewport() + .getAlignment()).print(al.getViewport().getAlignment() + .getSequencesArray(), true); + + AlignFrame newAl = new FileLoader(false).LoadFileWaitTillLoaded( + stockholmFile, DataSourceType.PASTE); + + testAlignmentEquivalence(al.getViewport().getAlignment(), newAl + .getViewport().getAlignment(), true, true); + + } }