X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FStockholmFileTest.java;h=4a047c7f0a57a13705969e742598972441be28bf;hb=0c90355de2854b4ba6f30c1c162f9cb0c712351a;hp=b1995ab5945b4d1d99ff1df0b135d5aacd9483b1;hpb=0ae965fc73680bdc69b06986c060ff17342c4787;p=jalview.git diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index b1995ab..4a047c7 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -62,7 +62,7 @@ public class StockholmFileTest static String PfamFile = "examples/PF00111_seed.stk", RfamFile = "examples/RF00031_folded.stk", - RnaSSTestFile = "examples/rna_ss_test.stk"; + RnaSSTestFile = "examples/rna_ss_test.stk",RnaSS_fromRfamTestFile="examples/RF00162.stk"; @Test(groups = { "Functional" }) public void pfamFileIO() throws Exception @@ -137,6 +137,31 @@ public class StockholmFileTest } + @Test(groups = { "Functional" }) + public void descriptionLineOutput() throws Exception + { + // quick test that sequence description is exported & reimported + + SequenceI sq = new Sequence("FER2_SPIOL", "AASSDDDFFF"); + String expected_descr = "This is a description !@&^%@£@"; + sq.setDescription(expected_descr); + AppletFormatAdapter af = new AppletFormatAdapter(); + String toStockholm = af.formatSequences(FileFormat.Stockholm, + new Alignment(new SequenceI[] + { sq }), false); + System.out.println(toStockholm); + + // bleh - java.util.Regex sucks + assertTrue(toStockholm.contains(expected_descr), + "Couldn't locate expected description srting in generated Stockholm file."); + + AlignmentI fromStockholm = af.readFile(toStockholm, + DataSourceType.PASTE, FileFormat.Stockholm); + SequenceI importedSeq = fromStockholm.getSequenceAt(0); + assertEquals("Description did not get reimported.", expected_descr, + importedSeq.getDescription()); + } + /** * test alignment data in given file can be imported, exported and reimported * with no dataloss @@ -698,6 +723,13 @@ public class StockholmFileTest { roundTripSSForRNA(aliFile, annFileFullWuss); } + + @Test(groups= { "Functional" }) + public void rfamSS() throws Exception { + testFileIOwithFormat(new File(RnaSS_fromRfamTestFile), FileFormat.Stockholm, 2, 1, + false, false, false); + } + @Test(groups = { "Functional" }) public void detectWussBrackets()