import java.io.FileInputStream;\r
import java.io.FileNotFoundException;\r
import java.io.IOException;\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
import java.util.ArrayList;\r
import java.util.HashSet;\r
import java.util.List;\r
-\r
-import javax.xml.namespace.QName;\r
-import javax.xml.ws.Service;\r
+import java.util.Map;\r
\r
import org.testng.annotations.BeforeTest;\r
import org.testng.annotations.Test;\r
\r
-import compbio.data.msa.Annotation;\r
+import compbio.data.msa.JABAService;\r
+import compbio.data.msa.SequenceAnnotation;\r
+import compbio.data.sequence.ConservationMethod;\r
import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.Method;\r
import compbio.data.sequence.Score;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.metadata.JobSubmissionException;\r
\r
public class TestAAConWS {\r
\r
- Annotation<AACon> msaws;\r
+ SequenceAnnotation<AACon> msaws;\r
\r
@BeforeTest\r
void initConnection() {\r
- URL url = null;\r
- try {\r
- url = new URL("http://localhost:8080/jabaws/AAConWS?wsdl");\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
- }\r
- String namespace = "http://msa.data.compbio/01/12/2010/";\r
- QName qname = new QName(namespace, "AAConWS");\r
- Service serv = Service.create(url, qname);\r
- msaws = serv.getPort(new QName(namespace, "AAConWSPort"),\r
- Annotation.class);\r
+ /*\r
+ * URL url = null; try { url = new\r
+ * URL("http://localhost:8080/jabaws/AAConWS?wsdl"); } catch\r
+ * (MalformedURLException e) { e.printStackTrace();\r
+ * fail(e.getLocalizedMessage()); } String namespace =\r
+ * "http://msa.data.compbio/01/12/2010/"; QName qname = new\r
+ * QName(namespace, "AAConWS"); Service serv = Service.create(url,\r
+ * qname); msaws = serv.getPort(new QName(namespace, "AAConWSPort"),\r
+ * Annotation.class);\r
+ */\r
+ JABAService client = Jws2Client.connect("http://localhost:8080/jabaws",\r
+ Services.AAConWS);\r
+ msaws = (SequenceAnnotation<AACon>) client;\r
}\r
\r
@Test\r
System.out.println("Pres: " + msaws.getPresets().getPresets());\r
String jobId = msaws.analize(fsl);\r
System.out.println("J: " + jobId);\r
- HashSet<Score> result = msaws.getConservation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
- assertEquals(result.iterator().next().getMethod(), Method.SHENKIN);\r
- List<Float> scores = result.iterator().next().getScores();\r
+ assertEquals(result.values().iterator().next().iterator().next()\r
+ .getMethod(), ConservationMethod.SHENKIN);\r
+ List<Float> scores = result.values().iterator().next().iterator()\r
+ .next().getScores();\r
assertNotNull(scores);\r
assertEquals(scores.size(), 568);\r
\r
PresetManager<AACon> presets = msaws.getPresets();\r
jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Quick conservation"));\r
- result = msaws.getConservation(jobId);\r
+ result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 13);\r
\r
jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Slow conservation"));\r
- result = msaws.getConservation(jobId);\r
+ result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 5);\r
\r
jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Complete conservation"));\r
- result = msaws.getConservation(jobId);\r
+ result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 18);\r
\r
PresetManager<AACon> presets = msaws.getPresets();\r
String jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Quick conservation"));\r
- HashSet<Score> result = msaws.getConservation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 13);\r
\r
jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Slow conservation"));\r
- result = msaws.getConservation(jobId);\r
+ result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 5);\r
\r
jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Complete conservation"));\r
- result = msaws.getConservation(jobId);\r
+ result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 18);\r
\r
\r
try {\r
options.getArgument("Calculation method").setDefaultValue("SMERFS");\r
+ // options.getArgument("SMERFS Column Scoring Method")\r
+ // .setDefaultValue("MAX_SCORE");\r
+ // options.getArgument("SMERFS Gap Threshhold").setDefaultValue("1");\r
String jobId = msaws.customAnalize(fsl, options.getArguments());\r
- HashSet<Score> result = msaws.getConservation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
assertEquals(\r
- new ArrayList<Score>(result).get(0).getScores().get(0),\r
- 0.698f);\r
+ new ArrayList<Score>(result.values().iterator().next())\r
+ .get(0).getScores().get(0), 0.698f);\r
\r
options.getArgument("Calculation method").setDefaultValue("SMERFS");\r
options.removeArgument("Normalize");\r
System.out.println(options);\r
jobId = msaws.customAnalize(fsl, options.getArguments());\r
- result = msaws.getConservation(jobId);\r
+ result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
assertEquals(\r
- new ArrayList<Score>(result).get(0).getScores().get(0),\r
- 0.401f);\r
+ new ArrayList<Score>(result.values().iterator().next())\r
+ .get(0).getScores().get(0), 0.401f);\r
\r
} catch (WrongParameterException e) {\r
e.printStackTrace();\r