-/*\r
- * Copyright (c) 2009 Peter Troshin JAva Bioinformatics Analysis Web Services\r
- * (JABAWS) @version: 1.0 This library is free software; you can redistribute it\r
- * and/or modify it under the terms of the Apache License version 2 as published\r
- * by the Apache Software Foundation This library is distributed in the hope\r
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied\r
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * Apache License for more details. A copy of the license is in\r
- * apache_license.txt. It is also available here:\r
- * @see: http://www.apache.org/licenses/LICENSE-2.0.txt Any republication or\r
- * derived work distributed in source code form must include this copyright and\r
- * license notice.\r
+/* Copyright (c) 2011 Peter Troshin\r
+ * \r
+ * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 \r
+ * \r
+ * This library is free software; you can redistribute it and/or modify it under the terms of the\r
+ * Apache License version 2 as published by the Apache Software Foundation\r
+ * \r
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
+ * License for more details.\r
+ * \r
+ * A copy of the license is in apache_license.txt. It is also available here:\r
+ * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+ * \r
+ * Any republication or derived work distributed in source code form\r
+ * must include this copyright and license notice.\r
*/\r
\r
package compbio.runner.conservation;\r
import java.io.IOException;\r
import java.io.InputStream;\r
import java.util.Arrays;\r
-import java.util.HashMap;\r
import java.util.List;\r
\r
import org.apache.log4j.Logger;\r
\r
-import compbio.conservation.Method;\r
+import compbio.data.sequence.ScoreManager;\r
+import compbio.data.sequence.SequenceUtil;\r
import compbio.engine.client.CommandBuilder;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
-import compbio.metadata.Limit;\r
-import compbio.metadata.LimitsManager;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
\r
/**\r
* Command line\r
*/\r
private int ncoreNumber = 0;\r
\r
- private final String ncorePrm = "-n=";\r
+ private final String ncorePrm = "-t=";\r
\r
- // Cache for Limits information\r
- private static LimitsManager<AACon> limits;\r
-\r
- public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
+ public static final String KEY_VALUE_SEPARATOR = "=";\r
public static final String STAT_FILE = "stat.txt";\r
\r
public AACon() {\r
}\r
// HashMap<Method, float[]>\r
@Override\r
- public HashMap<Method, float[]> getResults(String workDirectory)\r
+ public ScoreManager getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
- // MultiAnnotatedSequence<Method> annotations = null;\r
+ ScoreManager annotations = null;\r
try {\r
InputStream inStream = new FileInputStream(new File(workDirectory,\r
getOutput()));\r
- // annotations = SequenceUtil.readResults(inStream);\r
+ annotations = ScoreManager.newInstanceSingleSequence(SequenceUtil\r
+ .readAAConResults(inStream));\r
inStream.close();\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
}\r
- return null;\r
+ return annotations;\r
}\r
\r
private static String getLibPath() {\r
+ "and initialize it with the location of jronn jar file");\r
}\r
if (new File(settings).isAbsolute()) {\r
- // Jronn jar can be found so no actions necessary\r
+ // the jar can be found so no actions necessary\r
// no further actions is necessary\r
return settings;\r
}\r
- return compbio.engine.client.Util.convertToAbsolute(settings);\r
+ return EngineUtil.convertToAbsolute(settings);\r
}\r
\r
@Override\r
return this;\r
}\r
\r
+ @SuppressWarnings("unchecked")\r
@Override\r
- public Limit<AACon> getLimit(String presetName) {\r
- if (limits == null) {\r
- limits = getLimits();\r
- }\r
- Limit<AACon> limit = null;\r
- if (limits != null) {\r
- // this returns default limit if preset is undefined!\r
- limit = limits.getLimitByName(presetName);\r
- }\r
- // If limit is not defined for a particular preset, then return default\r
- // limit\r
- if (limit == null) {\r
- log.debug("Limit for the preset " + presetName\r
- + " is not found. Using default");\r
- limit = limits.getDefaultLimit();\r
- }\r
- return limit;\r
- }\r
-\r
- @Override\r
- public LimitsManager<AACon> getLimits() {\r
- // synchronise on static field\r
- synchronized (log) {\r
- if (limits == null) {\r
- limits = Util.getLimits(this.getClass());\r
- }\r
- }\r
- return limits;\r
- }\r
-\r
- @Override\r
- public Class<? extends Executable<?>> getType() {\r
- return this.getClass();\r
+ public Class<AACon> getType() {\r
+ return (Class<AACon>) this.getClass();\r
}\r
\r
public static String getStatFile() {\r