Merge branch 'JABAWS_Release_2_5' into develop
[jabaws.git] / testsrc / compbio / data / sequence / SequenceUtilTester.java
index 7f98180..9468cda 100644 (file)
@@ -133,7 +133,36 @@ public class SequenceUtilTester {
                }\r
        }\r
 \r
-       // This method tests the loading of horizontally formatted Jronn output file\r
+       // Potential Bug :- Sequence names are shortened to 2-3 letters\r
+       @Test\r
+       public void testReadFastaWriteClustal() {\r
+               \r
+               try {\r
+                       FileInputStream fio = new FileInputStream(\r
+                                       AllTestSuit.TEST_DATA_PATH + "TO1381.fasta");\r
+                       assertNotNull(fio);\r
+                       List<FastaSequence> fseqs = SequenceUtil.readFasta(fio);\r
+                       assertNotNull(fseqs);\r
+                       fio.close();\r
+                       \r
+                       char gapChar = '-';\r
+                       FileOutputStream fou = new FileOutputStream(\r
+                                       AllTestSuit.TEST_DATA_PATH + "TO1381.aln.written");\r
+                       SequenceUtil.writeClustal(fou, fseqs, gapChar);\r
+                       fou.close();\r
+                       \r
+               } catch (FileNotFoundException e) {\r
+                       e.printStackTrace();\r
+                       fail(e.getLocalizedMessage());\r
+               } catch (IOException e) {\r
+                       e.printStackTrace();\r
+                       fail(e.getLocalizedMessage());\r
+               }\r
+       }\r
+\r
+       /**\r
+        * This test tests the loading of horizontally formatted Jronn output file\r
+        */\r
        @Test\r
        public void LoadJronnFile() {\r
 \r
@@ -394,3 +423,4 @@ public class SequenceUtilTester {
                }\r
        }\r
 }\r
+\r