import java.util.ArrayList;\r
import java.util.HashSet;\r
import java.util.List;\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.sequence.FastaSequence;\r
+import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.ConservationMethod;\r
+import compbio.data.sequence.FastaSequence;\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
*/\r
JABAService client = Jws2Client.connect("http://localhost:8080/jabaws",\r
Services.AAConWS);\r
- msaws = (Annotation<AACon>) client;\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.getAnnotation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 1);\r
- assertEquals(result.iterator().next().getMethod(), ConservationMethod.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
String jobId = msaws.presetAnalize(fsl,\r
presets.getPresetByName("Quick conservation"));\r
- HashSet<Score> result = msaws.getAnnotation(jobId);\r
+ Map<String, HashSet<Score>> result = msaws.getAnnotation(jobId);\r
assertNotNull(result);\r
assertEquals(result.size(), 13);\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.getAnnotation(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
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