Adding AAConWS
[jabaws.git] / runner / compbio / runner / disorder / Disembl.java
index 4c76854..c6b278f 100644 (file)
@@ -1,19 +1,15 @@
-/* Copyright (c) 2009 Peter Troshin\r
- *  \r
- *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.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
+ * 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
  */\r
 \r
 package compbio.runner.disorder;\r
@@ -24,7 +20,6 @@ import java.util.Arrays;
 \r
 import org.apache.log4j.Logger;\r
 \r
-import com.sun.xml.internal.bind.api.impl.NameConverter.Standard;\r
 import compbio.data.sequence.Alignment;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.engine.client.Executable;\r
@@ -36,98 +31,101 @@ import compbio.metadata.ResultNotAvailableException;
 import compbio.runner.Util;\r
 \r
 /**\r
- * @see Standard DisEMBL DisEMBL.py smooth_frame peak_frame join_frame\r
- *      fold_coils fold_hotloops fold_rem465 sequence_file print 'A default run\r
- *      would be: ./DisEMBL.py 8 8 4 1.2 1.4 1.2 fasta_file > out'\r
+ * @see DisEMBL\r
  * \r
- *      new DisEMBL is at /homes/pvtroshin/soft/DisEMBL-1.4raw This is not a\r
- *      standard DisEMBL! The script has been modified! DisEMBL.py smooth_frame\r
- *      peak_frame join_frame fold_coils fold_hotloops fold_rem465 [mode] <\r
- *      fasta_file > out print 'A default run would be: ./DisEMBL.py 8 8 4 1.2\r
- *      1.4 1.2 < fasta_file' print 'Mode: "default"(nothing) or "scores" which\r
- *      will give scores per residue in TAB separated format'\r
+ *      DisEMBL.py smooth_frame peak_frame join_frame fold_coils fold_hotloops\r
+ *      fold_rem465 sequence_file print 'A default run would be: ./DisEMBL.py 8\r
+ *      8 4 1.2 1.4 1.2 fasta_file > out' new DisEMBL is at\r
+ *      /homes/pvtroshin/soft/DisEMBL-1.4raw\r
  * \r
+ *      This is not a standard DisEMBL! The script has been modified! DisEMBL.py\r
+ *      smooth_frame peak_frame join_frame fold_coils fold_hotloops fold_rem465\r
+ *      [mode] < fasta_file > out print\r
+ * \r
+ *      'A default run would be: ./DisEMBL.py 8 8 4 1.2 1.4 1.2 < fasta_file'\r
+ *      print 'Mode: "default"(nothing) or "scores" which will give scores per\r
+ *      residue in TAB separated format'\r
  */\r
 public class Disembl extends SkeletalExecutable<Disembl> implements\r
-       PipedExecutable<Disembl> {\r
-\r
-    private static Logger log = Logger.getLogger(Disembl.class);\r
-\r
-    // Cache for Limits information\r
-    private static LimitsManager<Disembl> limits;\r
-\r
-    public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
-\r
-    public Disembl() {\r
-       // remove default input to prevent it to appear in the parameters list\r
-       // that could happen if the parameters are set first\r
-       // super.setInput("");\r
-       addParameters(Arrays.asList("8", "8", "4", "1.2", "1.4", "1.2",\r
-               "scores"));\r
-    }\r
-\r
-    @SuppressWarnings("unchecked")\r
-    public Alignment getResults(String workDirectory)\r
-           throws ResultNotAvailableException {\r
-       try {\r
-           return Util.readClustalFile(workDirectory, getOutput());\r
-       } catch (FileNotFoundException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
-       } catch (IOException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
-       } catch (UnknownFileFormatException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
-       } catch (NullPointerException e) {\r
-           log.error(e.getMessage(), e.getCause());\r
-           throw new ResultNotAvailableException(e);\r
+               PipedExecutable<Disembl> {\r
+\r
+       private static Logger log = Logger.getLogger(Disembl.class);\r
+\r
+       // Cache for Limits information\r
+       private static LimitsManager<Disembl> limits;\r
+\r
+       public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
+\r
+       public Disembl() {\r
+               // remove default input to prevent it to appear in the parameters list\r
+               // that could happen if the parameters are set first\r
+               // super.setInput("");\r
+               addParameters(Arrays.asList("8", "8", "4", "1.2", "1.4", "1.2",\r
+                               "scores"));\r
        }\r
-    }\r
-\r
-    @Override\r
-    public Disembl setInput(String inFile) {\r
-       super.setInput(inFile);\r
-       cbuilder.setLast(inFile);\r
-       return this;\r
-    }\r
-\r
-    @Override\r
-    public Limit<Disembl> getLimit(String presetName) {\r
-       if (limits == null) {\r
-           limits = getLimits();\r
+\r
+       @SuppressWarnings("unchecked")\r
+       public Alignment getResults(String workDirectory)\r
+                       throws ResultNotAvailableException {\r
+               try {\r
+                       return Util.readClustalFile(workDirectory, getOutput());\r
+               } catch (FileNotFoundException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               } catch (IOException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               } catch (UnknownFileFormatException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               } catch (NullPointerException e) {\r
+                       log.error(e.getMessage(), e.getCause());\r
+                       throw new ResultNotAvailableException(e);\r
+               }\r
        }\r
 \r
-       Limit<Disembl> limit = null;\r
-       if (limits != null) {\r
-           // this returns default limit if preset is undefined!\r
-           limit = limits.getLimitByName(presetName);\r
+       @Override\r
+       public Disembl setInput(String inFile) {\r
+               super.setInput(inFile);\r
+               cbuilder.setLast(inFile);\r
+               return this;\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
+       @Override\r
+       public Limit<Disembl> getLimit(String presetName) {\r
+               if (limits == null) {\r
+                       limits = getLimits();\r
+               }\r
+\r
+               Limit<Disembl> 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
-       return limit;\r
-    }\r
-\r
-    @Override\r
-    public LimitsManager<Disembl> getLimits() {\r
-       // synchronise on static field\r
-       synchronized (log) {\r
-           if (limits == null) {\r
-               limits = Util.getLimits(this.getClass());\r
-           }\r
+\r
+       @Override\r
+       public LimitsManager<Disembl> 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
-       return limits;\r
-    }\r
 \r
-    @Override\r
-    public Class<? extends Executable<?>> getType() {\r
-       return this.getClass();\r
-    }\r
+       @Override\r
+       public Class<? extends Executable<?>> getType() {\r
+               return this.getClass();\r
+       }\r
 \r
 }\r