+ "ASDAAPEH------------PGIALWLHALE-DAGQAEAAA---AYTRAHQLLPEEPYITAQLLNAVA\n"\r
+ "";\r
\r
- \r
- \r
- static final List<FastaSequence> seqs = loadSeqs();\r
+ public static final String fastaRNAAlignment = ">Foo\n"\r
+ + "C-UUGCGUUAAUGAGAACAGAAACG-UAAA--CUAUAA-CCUAG-G-GGUUUCUGUUGGAUGGUUG----GCAAC\n"\r
+ + ">Bar\n"\r
+ + "G-UGGCGCUUAUGACGCAGUUGUCU-UAAA-CUCGAAC--UCGA-GCGGGCAAUUGCUGAU-UACGAUUAACCAC\n";\r
\r
private static final String FAILED = "FAILED";\r
private static final String OK = "OK";\r
/**\r
* Converting input to a form accepted by WS\r
* \r
- * @return List of FastaSequence records\r
+ * @return List of FastaSequence records with aligned protein sequences\r
*/\r
private static List<FastaSequence> loadAlignment() {\r
try {\r
}\r
return null;\r
}\r
+ /**\r
+ * Converting input to a form accepted by WS\r
+ * \r
+ * @return List of FastaSequence records with aligned RNA sequences\r
+ */\r
+ private static List<FastaSequence> loadRNAAlignment() {\r
+ try {\r
+ return SequenceUtil.readFasta(new ByteArrayInputStream(fastaRNAAlignment.getBytes()));\r
+ } catch (IOException ignored) {\r
+ // Should not happen as a source is not a external stream\r
+ ignored.printStackTrace();\r
+ }\r
+ return null;\r
+ }\r
\r
private final PrintWriter writer;\r
private final String hostname;\r
writer.print("Aligning with preset '" + preset.getName() + "'... ");\r
Alignment al = null;\r
try {\r
- String taskId = msaws.presetAlign(seqs, preset);\r
+ String taskId = msaws.presetAlign(loadSeqs(), preset);\r
al = msaws.getResult(taskId);\r
if (al != null) {\r
writer.println(OK);\r
writer.print("Calling analyse.........");\r
\r
List<FastaSequence> input = loadSeqs();\r
- if (service == Services.AAConWS || service == Services.RNAalifoldWS) {\r
+ if (service == Services.AAConWS ) {\r
input = loadAlignment();\r
+ } else if (service == Services.RNAalifoldWS) {\r
+ input = loadRNAAlignment();\r
}\r
boolean success = testDefaultAnalyse(input, wservice, null, null);\r
\r
Alignment al = null;\r
boolean succeed = false;\r
\r
- String taskId = msaws.align(seqs);\r
+ String taskId = msaws.align(loadSeqs());\r
writer.print("\nQuerying job status...");\r
JobStatus status = msaws.getJobStatus(taskId);\r
while (status != JobStatus.FINISHED) {\r
return succeed;\r
}\r
\r
- \r
/**\r
* Test JWS2 web services\r
* \r
tester.writer.println();\r
tester.checkService(serv);\r
}\r
-\r
}\r
\r
/**\r
\r
private void reportResults(Services serv, boolean succeed) {\r
if (succeed) {\r
- writer.println("Check is completed. The Service " + serv\r
- + " IS WORKING\n");\r
+ writer.println("Check is completed. The Service " + serv + " IS WORKING\n");\r
} else {\r
- writer.println("Check is aborted. The Service " + serv\r
- + " HAS SOME PROBLEMS\n");\r
+ writer.println("Check is aborted. The Service " + serv + " HAS SOME PROBLEMS\n");\r
}\r
}\r
}\r