/* * Copyright (c) 2009 Peter Troshin JAva Bioinformatics Analysis Web Services * (JABAWS) @version: 1.0 This library is free software; you can redistribute it * and/or modify it under the terms of the Apache License version 2 as published * by the Apache Software Foundation This library is distributed in the hope * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Apache License for more details. A copy of the license is in * apache_license.txt. It is also available here: * @see: http://www.apache.org/licenses/LICENSE-2.0.txt Any republication or * derived work distributed in source code form must include this copyright and * license notice. */ package compbio.runner.disorder; import java.util.Arrays; import java.util.Map; import org.apache.log4j.Logger; import compbio.data.sequence.Score; import compbio.engine.client.Executable; import compbio.engine.client.PipedExecutable; import compbio.engine.client.SkeletalExecutable; import compbio.metadata.Limit; import compbio.metadata.LimitsManager; import compbio.metadata.ResultNotAvailableException; import compbio.runner.Util; /** * @see DisEMBL * * DisEMBL.py smooth_frame peak_frame join_frame fold_coils fold_hotloops * fold_rem465 sequence_file print 'A default run would be: ./DisEMBL.py 8 * 8 4 1.2 1.4 1.2 fasta_file > out' new DisEMBL is at * /homes/pvtroshin/soft/DisEMBL-1.4raw * * This is not a standard DisEMBL! The script has been modified! DisEMBL.py * smooth_frame peak_frame join_frame fold_coils fold_hotloops fold_rem465 * [mode] < fasta_file > out print * * 'A default run would be: ./DisEMBL.py 8 8 4 1.2 1.4 1.2 < fasta_file' * print 'Mode: "default"(nothing) or "scores" which will give scores per * residue in TAB separated format' */ public class Disembl extends SkeletalExecutable implements PipedExecutable { private static Logger log = Logger.getLogger(Disembl.class); // Cache for Limits information private static LimitsManager limits; public static final String KEY_VALUE_SEPARATOR = Util.SPACE; public Disembl() { // remove default input to prevent it to appear in the parameters list // that could happen if the parameters are set first // super.setInput(""); addParameters(Arrays.asList("8", "8", "4", "1.2", "1.4", "1.2", "scores")); } @SuppressWarnings("unchecked") public Map getResults(String workDirectory) throws ResultNotAvailableException { return null; } @Override public Disembl setInput(String inFile) { super.setInput(inFile); cbuilder.setLast(inFile); return this; } @Override public Limit getLimit(String presetName) { if (limits == null) { limits = getLimits(); } Limit limit = null; if (limits != null) { // this returns default limit if preset is undefined! limit = limits.getLimitByName(presetName); } // 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(); } return limit; } @Override public LimitsManager getLimits() { // synchronise on static field synchronized (log) { if (limits == null) { limits = Util.getLimits(this.getClass()); } } return limits; } @Override public Class> getType() { return this.getClass(); } }