import java.net.MalformedURLException;\r
import java.net.URL;\r
import java.util.Arrays;\r
-import java.util.HashSet;\r
import java.util.List;\r
-import java.util.Map;\r
import java.util.logging.Level;\r
import java.util.logging.Logger;\r
\r
import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.data.sequence.UnknownFileFormatException;\r
import compbio.metadata.JobSubmissionException;\r
// std.out will not be\r
outStream = System.out;\r
}\r
- if (service == Services.AAConWS) {\r
- Map<String, HashSet<Score>> result = analize(inputFile,\r
+ if (service.getServiceType() == SequenceAnnotation.class) {\r
+ ScoreManager result = analize(inputFile,\r
((SequenceAnnotation<T>) msaws), preset, customOptions);\r
+\r
IOHelper.writeOut(outStream, result);\r
} else {\r
alignment = align(inputFile, (MsaWS<T>) msaws, preset,\r
customOptions);\r
IOHelper.writeOut(outStream, alignment);\r
}\r
-\r
- // stream is closed in the method no need to close it here\r
+ outStream.close();\r
}\r
\r
boolean listParameters = CmdHelper.listParameters(cmd);\r
* @return Set<Score> the conservation scores\r
* @throws UnknownFileFormatException\r
*/\r
- <T> Map<String, HashSet<Score>> analize(File file,\r
- SequenceAnnotation<T> wsproxy, Preset<T> preset,\r
- List<Option<T>> customOptions) {\r
+ <T> ScoreManager analize(File file, SequenceAnnotation<T> wsproxy,\r
+ Preset<T> preset, List<Option<T>> customOptions) {\r
\r
List<FastaSequence> fastalist = null;\r
- Map<String, HashSet<Score>> scores = null;\r
+ ScoreManager scores = null;\r
try {\r
fastalist = SequenceUtil.openInputStream(file.getAbsolutePath());\r
+ assert !fastalist.isEmpty() : "Input is empty!";\r
\r
String jobId = null;\r
if (customOptions != null && preset != null) {\r
} else if (preset != null) {\r
jobId = wsproxy.presetAnalize(fastalist, preset);\r
} else {\r
+ System.out.println("\n\ncalling analise.........");\r
jobId = wsproxy.analize(fastalist);\r
}\r
- Thread.sleep(1000);\r
+ Thread.sleep(2000);\r
+\r
scores = wsproxy.getAnnotation(jobId);\r
\r
} catch (IOException e) {\r
serv = service.getService(url, V2_QUALIFIED_SERVICE_NAME);\r
}\r
}\r
+ if (serv == null) {\r
+ System.err.println("Could not connect to " + url\r
+ + " the server is down?");\r
+ // FIXME\r
+ }\r
JABAService serviceIF = service.getInterface(serv);\r
- log.log(Level.FINE, "Connected successfully!");\r
+ log.log(Level.INFO, "Connected successfully!");\r
\r
return serviceIF;\r
}\r
\r
/**\r
* Starts command line client, if no parameter are supported print help. Two\r
- * parameters are required for successfull call the JWS2 host name and a\r
+ * parameters are required for successful call the JWS2 host name and a\r
* service name.\r
* \r
* @param args\r