From 4f4fafd245688999762bd8848d5d943271a4ed5f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 9 May 2017 15:15:54 +0100 Subject: [PATCH] JAL-2507 test for alignment+rna annotation -> Stockholm -> roundtrip. --- test/jalview/io/StockholmFileTest.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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); + + } } -- 1.7.10.2