import org.testng.annotations.Test;\r
\r
import compbio.metadata.AllTestSuit;\r
+import compbio.runner.disorder.Disembl;\r
\r
public class SequenceUtilTester {\r
\r
@Test\r
public void testReadDisemblResults() {\r
\r
+\r
+ Map<String, Map<String,Set<Range>>> _ranges=new HashMap<String, Map<String,Set<Range>>>();\r
+ Map<String, Set<Range>> ranges=new HashMap<String,Set<Range>>();\r
+ Map<String,Map<String, Float>> _values=new HashMap<String, Map<String,Float>>();\r
+ Map<String, Float> values = new HashMap<String, Float>();\r
+ Set<Range> rset;\r
+ rset = new HashSet<Range>();\r
+ for (String[] se:new String[][] { { "34","41"},{"50","58"},{"83","91"},{"118","127"},{" 160","169"},{" 191","220"},{" 243","252"},{" 287","343"},{" 350","391"},{" 429","485"},{" 497","506"},{"539","547"}})\r
+ {\r
+ rset.add(new Range(se));\r
+ }\r
+ ranges.put(DisemblResult.COILS.toString(), rset);\r
+ values.put(DisemblResult.COILS.toString(), Float.valueOf(0.86010f));\r
+ rset = new HashSet<Range>();\r
+ for (String[] se:new String[][] { { "355","368"}})\r
+ {\r
+ rset.add(new Range(se));\r
+ }\r
+ ranges.put(DisemblResult.REM465.toString(), rset);\r
+ values.put(DisemblResult.REM465.toString(), Float.valueOf(0.88512f));\r
+ rset = new HashSet<Range>();\r
+ for (String[] se:new String[][] { { "190","204"}})\r
+ {\r
+ rset.add(new Range(se));\r
+ }\r
+ ranges.put(DisemblResult.HOTLOOPS.toString(), rset);\r
+ values.put(DisemblResult.HOTLOOPS.toString(), Float.valueOf(0.37094f));\r
+ _ranges.put("Foobar_dundeefriends", ranges);\r
+ _values.put("Foobar_dundeefriends", values);\r
FileInputStream fio;\r
try {\r
fio = new FileInputStream(AllTestSuit.TEST_DATA_PATH\r
.contains(fs));\r
Set<Score> scores = aseqs.get(fs);\r
assertEquals(scores.size(), 3);\r
+ for (Score sc:scores) {\r
+ if (_ranges.containsKey(fs))\r
+ {\r
+ assertEquals("Checking range for Method "+sc.getMethod(),_ranges.get(fs).get(sc.getMethod()), sc.getRanges());\r
+ assertEquals("Checking first value for Method "+sc.getMethod(), _values.get(fs).get(sc.getMethod()), sc.getScores().get(0));\r
+ }\r
+ }\r
}\r
fio.close();\r
} catch (FileNotFoundException e) {\r
fail(e.getLocalizedMessage());\r
}\r
}\r
-\r
/**\r
* This test tests the loading of horizontally formatted Jronn output file\r
* \r
assertEquals(0, score.getRanges().size());\r
assertEquals(568, score.getScores().size());\r
assertEquals("Long", score.getMethod());\r
- \r
+\r
score = scores.get("Foobar");\r
assertNotNull(score);\r
assertEquals(0, score.getRanges().size());\r
assertEquals(481, score.getScores().size());\r
assertEquals("Long", score.getMethod());\r
- \r
+\r
score = scores.get("dundeefriends");\r
assertNotNull(score);\r
assertEquals(0, score.getRanges().size());\r
assertEquals(513, score.getScores().size());\r
assertEquals("Long", score.getMethod());\r
- \r
+\r
} catch (IOException e) {\r
e.printStackTrace();\r
fail(e.getLocalizedMessage());\r