X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=runner%2Fcompbio%2Frunner%2Fmsa%2FMuscle.java;h=1d3b8277578302c0c0c8a7f80af02df35fec30e4;hb=a0f3e53415428d2c6c803ec9581e5d8975e72102;hp=d220d1605a23c4f335b394807ef47b4712e959f6;hpb=535359a3d592ee41bda72e7356f0181f6cee9d07;p=jabaws.git diff --git a/runner/compbio/runner/msa/Muscle.java b/runner/compbio/runner/msa/Muscle.java index d220d16..1d3b827 100644 --- a/runner/compbio/runner/msa/Muscle.java +++ b/runner/compbio/runner/msa/Muscle.java @@ -29,127 +29,90 @@ import org.apache.log4j.Logger; import compbio.data.sequence.Alignment; import compbio.data.sequence.UnknownFileFormatException; -import compbio.engine.client.Executable; import compbio.engine.client.SkeletalExecutable; -import compbio.metadata.Limit; -import compbio.metadata.LimitsManager; import compbio.metadata.ResultNotAvailableException; import compbio.runner.Util; public class Muscle extends SkeletalExecutable { - /* - * Tell JAXB to ignore this while marshalling - */ - @XmlTransient - private static Logger log = Logger.getLogger(Muscle.class); - - // Cache for Limits information - private static LimitsManager limits; + /* + * Tell JAXB to ignore this while marshalling + */ + @XmlTransient + private static Logger log = Logger.getLogger(Muscle.class); - private static final String EXEC_STAT_FILE = "stat.log"; + private static final String EXEC_STAT_FILE = "stat.log"; - public static final String KEY_VALUE_SEPARATOR = Util.SPACE; + public static final String KEY_VALUE_SEPARATOR = Util.SPACE; - /** - * Default options are - * - * -clwstrict - write output in clustal format - * - * @param workDirectory - */ - public Muscle() { - /* - * The –quiet command-line option disables writing progress messages to - * standard error. If the –verbose command-line option is specified, a - * progress message will be written to the log file when each iteration - * completes. So –quiet and –verbose are not contradictory."-quiet", - * "-verbose" + /** + * Default options are + * + * -clwstrict - write output in clustal format + * + * @param workDirectory */ - addParameters(Arrays.asList("-clwstrict", "-quiet", "-verbose")); - cbuilder.setParam("-log", EXEC_STAT_FILE); - } - - @Override - public Muscle setOutput(String outFile) { - super.setOutput(outFile); - cbuilder.setParam("-out", outFile); - return this; - } - - @Override - public Muscle setInput(String inFile) { - super.setInput(inFile); - cbuilder.setParam("-in", inFile); - return this; - } - - @SuppressWarnings("unchecked") - @Override - public Alignment getResults(String workDirectory) - throws ResultNotAvailableException { - try { - return Util.readClustalFile(workDirectory, getOutput()); - } catch (FileNotFoundException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); - } catch (IOException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); - } catch (UnknownFileFormatException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); - } catch (NullPointerException e) { - log.error(e.getMessage(), e.getCause()); - throw new ResultNotAvailableException(e); + public Muscle() { + /* + * The –quiet command-line option disables writing progress messages to + * standard error. If the –verbose command-line option is specified, a + * progress message will be written to the log file when each iteration + * completes. So –quiet and –verbose are not contradictory."-quiet", + * "-verbose" + */ + addParameters(Arrays.asList("-clwstrict", "-quiet", "-verbose", + "-nocore")); + cbuilder.setParam("-log", EXEC_STAT_FILE); } - } - - @Override - public List getCreatedFiles() { - return Arrays.asList(getOutput(), EXEC_STAT_FILE); - } - public static String getStatFile() { - return EXEC_STAT_FILE; - } - - @Override - public Limit getLimit(String presetName) { + @Override + public Muscle setOutput(String outFile) { + super.setOutput(outFile); + cbuilder.setParam("-out", outFile); + return this; + } - if (limits == null) { - limits = getLimits(); + @Override + public Muscle setInput(String inFile) { + super.setInput(inFile); + cbuilder.setParam("-in", inFile); + return this; } - Limit limit = null; - if (limits != null) { - // this returns default limit if preset is undefined! - limit = limits.getLimitByName(presetName); + @SuppressWarnings("unchecked") + @Override + public Alignment getResults(String workDirectory) + throws ResultNotAvailableException { + try { + return Util.readClustalFile(workDirectory, getOutput()); + } catch (FileNotFoundException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } catch (IOException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } catch (UnknownFileFormatException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } catch (NullPointerException e) { + log.error(e.getMessage(), e.getCause()); + throw new ResultNotAvailableException(e); + } } - // If limit is not defined for a particular preset, then return default - // limit - if (limit == null) { - log.debug("Limit for the preset " + presetName - + " is not found. Using default"); - limit = limits.getDefaultLimit(); + + @Override + public List getCreatedFiles() { + return Arrays.asList(getOutput(), EXEC_STAT_FILE); } - return limit; - } - - @Override - public LimitsManager getLimits() { - // synchronise on static field - synchronized (log) { - if (limits == null) { - limits = Util.getLimits(this.getClass()); - } + + public static String getStatFile() { + return EXEC_STAT_FILE; } - return limits; - } - @Override - public Class> getType() { - return this.getClass(); - } + @SuppressWarnings("unchecked") + @Override + public Class getType() { + return (Class) this.getClass(); + } }