Add JRonn runner, tester, methods to parse jronn output files.
authorpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Wed, 21 Jul 2010 16:27:56 +0000 (16:27 +0000)
committerpvtroshin <pvtroshin@e3abac25-378b-4346-85de-24260fe3988d>
Wed, 21 Jul 2010 16:27:56 +0000 (16:27 +0000)
git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@2638 e3abac25-378b-4346-85de-24260fe3988d

15 files changed:
TODO.txt
binaries/jronn3.1.jar [new file with mode: 0644]
build.xml
conf/Executable.properties
conf/log4j.properties
conf/settings/JronnLimits.xml [new file with mode: 0644]
conf/settings/JronnParameters.xml [new file with mode: 0644]
datamodel/compbio/data/sequence/AnnotatedSequence.java [new file with mode: 0644]
datamodel/compbio/data/sequence/SequenceUtil.java
engine/compbio/engine/client/SkeletalExecutable.java
runner/compbio/runner/Util.java
runner/compbio/runner/disorder/Jronn.java [moved from runner/compbio/runner/disorder/RonnWrapper.java with 58% similarity]
testsrc/compbio/data/sequence/SequenceUtilTester.java
testsrc/compbio/runner/disorder/JronnTester.java [new file with mode: 0644]
testsrc/testdata/jronn.out [new file with mode: 0644]

index a212651..79f6ca1 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,35 +1,40 @@
 TODO: \r
 \r
 TODO: \r
 \r
-DONE: LocalExecutor service must be shutdown on web application undeploy event not on JVM shutdown. \r
-This is because JVM is still running even after web application is shut down!\r
-\r
-\r
-Good toString method for Limits (test with command line client -limits)\r
+Add globprot ws \r
+Add ronn ws\r
 \r
 \r
-Add facility to distribute other results of the calculations like the trees and annotation file for probcons. \r
+USE CASE - TURN ALIGNMENT INTO PROFILE AND SEARCH SEQUENCE DATABASE USECASE\r
+- Receive user alignment \r
+- use hmmerbuild to turn it to profile\r
+- use hmmersearch to search the database \r
 \r
 \r
-Use absolute path for web site download links as archives are not included into distro! \r
+#END OF - TURN ALIGNMENT INTO PROFILE AND SEARCH SEQUENCE DATABASE USECASE \r
 \r
 \r
+New data model for representing psiblast,blast,phmmer,jackhmmer results\r
 \r
 \r
-(later) Define limits for presets\r
+new parsers for the above programmes output (Stockholm MSA format?)\r
 \r
 \r
-Add documentation on Presets, Parameters and Limits\r
+Think hard on what to do with large output files? \r
+e.g. serve the hits table in full, but retrieve alignments on demand.\r
+What actually neeeds to be sent?   \r
 \r
 \r
-Explain how to define a limit\r
+Add facility to distribute other results of the calculations like the trees and \r
+annotation file for probcons. \r
 \r
 \r
-Rearrange web site docs - add links to the top of the page to the topics discussed below\r
+# END OF SEARCHING SEQUENCE DATABASE USECASE\r
 \r
 \r
-Put the documentation for various executables online\r
-\r
-Pack the test cases and build file to run them in one of the distributives \r
+Good toString method for Limits (test with command line client -limits)\r
 \r
 \r
-Add test for repeated result collection from cluster engine \r
+JABA DOCS\r
+(later) Define limits for presets - if required\r
+(later) Add documentation on Presets, Parameters and Limits\r
+(later) Explain how to define a limit\r
 \r
 \r
-Add logging facility to WSTester so more details of the problem can be reported\r
+Add test for repeated result collection from cluster engine\r
 \r
 \r
-Make left gradient image one-two characters larger + change "For developer ->For Developers"\r
+(low) Pack the test cases and build file to run them in one of the distributives \r
 \r
 \r
-PART DONE: test local/cluster execution - test Load balancer\r
+(low) Add logging facility to WSTester so more details of the problem can be reported\r
 \r
 (low) Statistics collector for engines (number of operations/timing)\r
 \r
 \r
 (low) Statistics collector for engines (number of operations/timing)\r
 \r
@@ -37,17 +42,23 @@ PART DONE: test local/cluster execution - test Load balancer
 \r
 (later) Implement utility to rerun died tasks\r
 \r
 \r
 (later) Implement utility to rerun died tasks\r
 \r
-(later) Progress bars - talk about (1. Proper time assessment vs low hustle option - dumping output to screen)\r
-\r
 (later) Add recognition for executables for the different architectures\r
 \r
 (later) use Latch to manage engine reservations. Reservations for parallel jobs? \r
 \r
 DONE\r
 (later) Add recognition for executables for the different architectures\r
 \r
 (later) use Latch to manage engine reservations. Reservations for parallel jobs? \r
 \r
 DONE\r
+WILL NOT DO: Progress bars - needs assessing how long does it take to run a task\r
+DONE: LocalExecutor service must be shutdown on web application undeploy event not on JVM shutdown. \r
+      This is because JVM is still running even after web application is shut down!\r
+DONE: Use absolute path for web site download links as archives are not included into distro!\r
+DONE: Rearrange web site docs - add links to the top of the page to the topics discussed below\r
+DONE: Put the documentation for various executables online\r
+DONE: Make left gradient image one-two characters larger + change "For developer ->For Developers"\r
+DONE: test local/cluster execution - test Load balancer\r
 DONE: Improve SimpleWS client so it can be scripted against: give user alignment and accept parameters\r
 DONE: Make a configuration tester class (check that configuration files point to the executables, and they can be executed)\r
 DONE: PUT CLIENT JAR INTO WEB-INF/LIB - most likely need to get rid of dist prefix in the build file\r
 DONE: Improve SimpleWS client so it can be scripted against: give user alignment and accept parameters\r
 DONE: Make a configuration tester class (check that configuration files point to the executables, and they can be executed)\r
 DONE: PUT CLIENT JAR INTO WEB-INF/LIB - most likely need to get rid of dist prefix in the build file\r
-DONE: Different packages for donwload and dundee. generic vs specific settings. \r
+DONE: Different packages for download and dundee. generic vs specific settings. \r
 DONE: JAVADOC\r
 DONE: Refactor EngineResourcesLeak tester to hide a map implementation!\r
 DONE: Compile executables for linux in the most generic way\r
 DONE: JAVADOC\r
 DONE: Refactor EngineResourcesLeak tester to hide a map implementation!\r
 DONE: Compile executables for linux in the most generic way\r
diff --git a/binaries/jronn3.1.jar b/binaries/jronn3.1.jar
new file mode 100644 (file)
index 0000000..fa39e98
Binary files /dev/null and b/binaries/jronn3.1.jar differ
index 1448e35..724776f 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -8,6 +8,7 @@
        <!-- Distributive file names-->\r
        <property name="distdir" value="website/archive"/>\r
        <mkdir dir="${distdir}" />\r
        <!-- Distributive file names-->\r
        <property name="distdir" value="website/archive"/>\r
        <mkdir dir="${distdir}" />\r
+       <property name="datamodel" value="${distdir}/datamodel-1.0.jar"/>\r
        <property name="min-jaba-client" value="${distdir}/min-jaba-client.jar"/>\r
        <property name="full-jaba-client" value="${distdir}/full-jaba-client.jar"/>\r
        <property name="jaba-source-jar" value="${distdir}/jaba-source.jar"/>\r
        <property name="min-jaba-client" value="${distdir}/min-jaba-client.jar"/>\r
        <property name="full-jaba-client" value="${distdir}/full-jaba-client.jar"/>\r
        <property name="jaba-source-jar" value="${distdir}/jaba-source.jar"/>\r
        </target>\r
 \r
 \r
        </target>\r
 \r
 \r
+       <target name="datamodel-jar" description="Pack data model classes" depends="compile">\r
+                       <echo>Jar file: Minimal WS client jar</echo>\r
+                       <delete file="${basedir}/${datamodel}"></delete>\r
+                       <jar jarfile="${basedir}/${datamodel}">\r
+                               <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >\r
+                                       <include name="compbio-util-1.2.jar"/>\r
+                               </zipgroupfileset>\r
+                               <fileset dir="${basedir}/WEB-INF/classes/"> \r
+                                       <include name="compbio/data/sequence/*.class"/>\r
+                                       <include name="compbio/metadata/*.class"/>\r
+                               </fileset>\r
+                               <manifest>\r
+                                       <attribute name="Built-By" value="Peter Troshin" />\r
+                                       <attribute name="Class-Path" value="." />\r
+                                       <attribute name="Implementation-Title" value="Datamodel for Java Bioinformatics Analyses Web Services " />\r
+                                       <attribute name="Implementation-Vendor" value="Peter Troshin" />\r
+                                       <attribute name="Implementation-URL" value="http://www.compbio.dundee.ac.uk" />\r
+                               </manifest>\r
+                       </jar>\r
+               </target>\r
        \r
        \r
        \r
        \r
-       <target name="minimal-jaba-client-jar" description="Pack metadata, data model, WS interfaces, a simple ws client class" depends="compile">\r
+       <target name="minimal-jaba-client-jar" description="Pack metadata, data model, WS interfaces, a simple ws client class" depends="compile, datamodel-jar">\r
                <echo>Jar file: Minimal WS client jar</echo>\r
                <delete file="${basedir}/${min-jaba-client}"></delete>\r
                <jar jarfile="${basedir}/${min-jaba-client}">\r
                <echo>Jar file: Minimal WS client jar</echo>\r
                <delete file="${basedir}/${min-jaba-client}"></delete>\r
                <jar jarfile="${basedir}/${min-jaba-client}">\r
-                       <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >\r
-                               <include name="compbio-util-1.2.jar"/>\r
-                       </zipgroupfileset>\r
+                       <zipgroupfileset excludes="META-INF/*.SF" dir="" includes="${datamodel}" />\r
                        <fileset dir="${basedir}/WEB-INF/classes/"> \r
                        <fileset dir="${basedir}/WEB-INF/classes/"> \r
-                               <include name="compbio/data/sequence/*.class"/>\r
-                               <include name="compbio/metadata/*.class"/>\r
                                <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->\r
                                <include name="compbio/data/msa/**"/>\r
                                <include name="compbio/ws/client/**"/>\r
                                <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->\r
                                <include name="compbio/data/msa/**"/>\r
                                <include name="compbio/ws/client/**"/>\r
index 681b3f0..cb3daa1 100644 (file)
@@ -2,7 +2,7 @@
 ### Clustal configuration ###\r
 local.clustalw.bin.windows=binaries/clustalw2.exe\r
 local.clustalw.bin=binaries/src/clustalw/src/clustalw2\r
 ### Clustal configuration ###\r
 local.clustalw.bin.windows=binaries/clustalw2.exe\r
 local.clustalw.bin=binaries/src/clustalw/src/clustalw2\r
-#cluster.clustalw.bin=/homes/pvtroshin/workspace/clustengine/binaries/src/clustalw/src/clustalw2\r
+cluster.clustalw.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/clustalw/src/clustalw2\r
 # Parameters names which come from RunnerConfig -> Parameters.xml file ultimately are all lowercased in comparison!\r
 # see engine.client.Util.getExecProperty() method for details  \r
 # So they are case insensitive. \r
 # Parameters names which come from RunnerConfig -> Parameters.xml file ultimately are all lowercased in comparison!\r
 # see engine.client.Util.getExecProperty() method for details  \r
 # So they are case insensitive. \r
@@ -10,50 +10,61 @@ clustalw.-matrix.path=binaries/matrices
 clustalw.presets.file=conf/settings/ClustalPresets.xml\r
 clustalw.parameters.file=conf/settings/ClustalParameters.xml\r
 clustalw.limits.file=conf/settings/ClustalLimits.xml\r
 clustalw.presets.file=conf/settings/ClustalPresets.xml\r
 clustalw.parameters.file=conf/settings/ClustalParameters.xml\r
 clustalw.limits.file=conf/settings/ClustalLimits.xml\r
-#clustalw.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
+clustalw.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
 \r
 ### Muscle configuration ###\r
 local.muscle.bin.windows=binaries/muscle.exe\r
 local.muscle.bin=binaries/src/muscle/muscle\r
 # Beware version of muscle on the cluster older and does not support some \r
 # of the newer version attributed thus, will not work with Muscle.java wrapper!\r
 \r
 ### Muscle configuration ###\r
 local.muscle.bin.windows=binaries/muscle.exe\r
 local.muscle.bin=binaries/src/muscle/muscle\r
 # Beware version of muscle on the cluster older and does not support some \r
 # of the newer version attributed thus, will not work with Muscle.java wrapper!\r
-cluster.muscle.bin=/homes/pvtroshin/workspace/clustengine/binaries/src/muscle/muscle\r
+cluster.muscle.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/muscle/muscle\r
 #The environment variable MUSCLE_MXPATH can be used to specify a path where the matrices are stored\r
 # e.g. MUSCLE_MXPATH#binaries/matrices - but need to privide absolute path!\r
 muscle.-matrix.path=binaries/matrices\r
 muscle.presets.file=conf/settings/MusclePresets.xml\r
 muscle.parameters.file=conf/settings/MuscleParameters.xml\r
 muscle.limits.file=conf/settings/MuscleLimits.xml\r
 #The environment variable MUSCLE_MXPATH can be used to specify a path where the matrices are stored\r
 # e.g. MUSCLE_MXPATH#binaries/matrices - but need to privide absolute path!\r
 muscle.-matrix.path=binaries/matrices\r
 muscle.presets.file=conf/settings/MusclePresets.xml\r
 muscle.parameters.file=conf/settings/MuscleParameters.xml\r
 muscle.limits.file=conf/settings/MuscleLimits.xml\r
-#muscle.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
+muscle.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
 \r
 ### Mafft configuration ###\r
 #local.mafft.bin.windows=\r
 local.mafft.bin=binaries/src/mafft/binaries/mafft\r
 \r
 ### Mafft configuration ###\r
 #local.mafft.bin.windows=\r
 local.mafft.bin=binaries/src/mafft/binaries/mafft\r
-#cluster.mafft.bin=/homes/pvtroshin/workspace/clustengine/binaries/src/mafft/core/mafft\r
+cluster.mafft.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/mafft/core/mafft\r
 mafft.bin.env=MAFFT_BINARIES#binaries/src/mafft/binaries;FASTA_4_MAFFT#binaries/src/fasta34/fasta34;\r
 mafft.--aamatrix.path=binaries/matrices\r
 mafft.presets.file=conf/settings/MafftPresets.xml\r
 mafft.parameters.file=conf/settings/MafftParameters.xml\r
 mafft.limits.file=conf/settings/MafftLimits.xml\r
 mafft.bin.env=MAFFT_BINARIES#binaries/src/mafft/binaries;FASTA_4_MAFFT#binaries/src/fasta34/fasta34;\r
 mafft.--aamatrix.path=binaries/matrices\r
 mafft.presets.file=conf/settings/MafftPresets.xml\r
 mafft.parameters.file=conf/settings/MafftParameters.xml\r
 mafft.limits.file=conf/settings/MafftLimits.xml\r
-#mafft.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
+mafft.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
 \r
 ### Tcoffee configuration ###\r
 local.tcoffee.bin=binaries/src/tcoffee/t_coffee_source/t_coffee\r
 \r
 ### Tcoffee configuration ###\r
 local.tcoffee.bin=binaries/src/tcoffee/t_coffee_source/t_coffee\r
-#cluster.tcoffee.bin=/homes/pvtroshin/workspace/clustengine/binaries/src/tcoffee/t_coffee_source/t_coffee\r
+cluster.tcoffee.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/tcoffee/t_coffee_source/t_coffee\r
 #/sw/bin/t_coffee\r
 # Sub matrix support does not work \r
 #tcoffee.-matrix.path=binaries/matrices\r
 tcoffee.presets.file=conf/settings/TcoffeePresets.xml\r
 tcoffee.parameters.file=conf/settings/TcoffeeParameters.xml\r
 tcoffee.limits.file=conf/settings/TcoffeeLimits.xml\r
 #/sw/bin/t_coffee\r
 # Sub matrix support does not work \r
 #tcoffee.-matrix.path=binaries/matrices\r
 tcoffee.presets.file=conf/settings/TcoffeePresets.xml\r
 tcoffee.parameters.file=conf/settings/TcoffeeParameters.xml\r
 tcoffee.limits.file=conf/settings/TcoffeeLimits.xml\r
-#tcoffee.cluster.cpunum=4\r
-#tcoffee.cluster.settings=-q mpi -pe mpi 4 -l h_vmem=1700M -l ram=1700M -l h_cpu=24:00:00  \r
+tcoffee.cluster.cpunum=4\r
+tcoffee.cluster.settings=-q 64bit-pri.q -pe smp 4 -l h_vmem=1700M -l ram=1700M -l h_cpu=24:00:00  \r
 \r
 ### Probcons configuration ###\r
 #local.probcons.bin.windows=\r
 local.probcons.bin=binaries/src/probcons/probcons\r
 \r
 ### Probcons configuration ###\r
 #local.probcons.bin.windows=\r
 local.probcons.bin=binaries/src/probcons/probcons\r
-#cluster.probcons.bin=/homes/pvtroshin/workspace/clustengine/binaries/src/probcons/probcons\r
+cluster.probcons.bin=/homes/pvtroshin/workspace/JABA2/binaries/src/probcons/probcons\r
 #Probcons does not support matrix loading - unrecognised option reported! \r
 probcons.parameters.file=conf/settings/ProbconsParameters.xml\r
 probcons.limits.file=conf/settings/ProbconsLimits.xml\r
 #Probcons does not support matrix loading - unrecognised option reported! \r
 probcons.parameters.file=conf/settings/ProbconsParameters.xml\r
 probcons.limits.file=conf/settings/ProbconsLimits.xml\r
-#probcons.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
+probcons.cluster.settings=-l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M\r
+\r
+### Jronn configuration ### \r
+local.jronn.bin.windows=D:\\Java\\jdk1.6.0_14\\bin\\java.exe \r
+local.jronn.bin=/sw/java/latest/bin/java\r
+cluster.jronn.bin=/sw/java/latest/bin/java\r
+jronn.jar.file=binaries/jronn3.1.jar\r
+jronn.parameters.file=conf/settings/JronnParameters.xml\r
+jronn.limits.file=conf/settings/JronnLimits.xml\r
+jronn.jvm.options=-Xms32M -Xmx512M\r
+jronn.cluster.cpunum=4\r
+jronn.cluster.settings=-q 64bit-pri.q -pe smp 4 -l h_vmem=1700M -l ram=1700M -l h_cpu=24:00:00\r
index 6d52128..9fe9a23 100644 (file)
@@ -1,6 +1,6 @@
 \r
 ## CHANGE THIS (The root directory where to store all the log files)  \r
 \r
 ## CHANGE THIS (The root directory where to store all the log files)  \r
-#logDir = .\r
+logDir = .\r
 \r
 ## Uncomment to enable JWS2 activity logging to standard out (to the console if available)\r
 ## for possible log levels please refer to Log4j documentation http://logging.apache.org/log4j/1.2/manual.html \r
 \r
 ## Uncomment to enable JWS2 activity logging to standard out (to the console if available)\r
 ## for possible log levels please refer to Log4j documentation http://logging.apache.org/log4j/1.2/manual.html \r
 ## FATAL - log fatal events only\r
 \r
 ## Uncomment this if you would like the system to log messages into stdout\r
 ## FATAL - log fatal events only\r
 \r
 ## Uncomment this if you would like the system to log messages into stdout\r
-#log4j.rootLogger=ERROR, stdout\r
-#log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
-#log4j.appender.stdout.Target=System.out\r
-#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
-#log4j.appender.stdout.layout.ConversionPattern=%m%n\r
+log4j.rootLogger=ERROR, stdout\r
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
+log4j.appender.stdout.Target=System.out\r
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.stdout.layout.ConversionPattern=%m%n\r
 \r
 ## Uncomment to enable JWS2 activity logging to the file\r
 \r
 ## Uncomment to enable JWS2 activity logging to the file\r
-#log4j.logger.compbio=ERROR, ACTIVITY\r
-#log4j.appender.ACTIVITY=org.apache.log4j.RollingFileAppender\r
-#log4j.appender.ACTIVITY.File=${logDir}/activity.log\r
-#log4j.appender.ACTIVITY.MaxFileSize=10MB\r
-#log4j.appender.ACTIVITY.MaxBackupIndex=10000\r
-#log4j.appender.ACTIVITY.layout=org.apache.log4j.PatternLayout\r
-#log4j.appender.ACTIVITY.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p %3x - %m%n\r
+log4j.logger.compbio=ERROR, ACTIVITY\r
+log4j.appender.ACTIVITY=org.apache.log4j.RollingFileAppender\r
+log4j.appender.ACTIVITY.File=${logDir}/activity.log\r
+log4j.appender.ACTIVITY.MaxFileSize=10MB\r
+log4j.appender.ACTIVITY.MaxBackupIndex=10000\r
+log4j.appender.ACTIVITY.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.ACTIVITY.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p %3x - %m%n\r
 \r
 ## Uncomment for separate local engine execution log (debugging only)\r
 #log4j.logger.compbio.engine.local.LocalExecutorService=INFO, C\r
 \r
 ## Uncomment for separate local engine execution log (debugging only)\r
 #log4j.logger.compbio.engine.local.LocalExecutorService=INFO, C\r
diff --git a/conf/settings/JronnLimits.xml b/conf/settings/JronnLimits.xml
new file mode 100644 (file)
index 0000000..9ea48b0
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>\r
+<limits>\r
+ <runnerClassName>compbio.runner.disorder.Jronn</runnerClassName>\r
+       <limit isDefault="true">\r
+               <seqNumber>2000</seqNumber>\r
+               <seqLength>2000</seqLength>\r
+       </limit>\r
+       <limit isDefault="false">\r
+               <preset># LocalEngineExecutionLimit #</preset>\r
+               <seqNumber>5</seqNumber>\r
+               <seqLength>500</seqLength>\r
+       </limit>\r
+</limits>\r
diff --git a/conf/settings/JronnParameters.xml b/conf/settings/JronnParameters.xml
new file mode 100644 (file)
index 0000000..27e7a86
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>\r
+<runnerConfig>\r
+       <runnerClassName>compbio.runner.disorder.Jronn</runnerClassName>\r
+       <prmSeparator>=</prmSeparator>\r
+       <parameters>\r
+               <name>Disorder probability</name>\r
+               <description>The probability of disorder threshold</description>\r
+               <optionNames>-d</optionNames>\r
+               <furtherDetails>prog_docs/jronn.html</furtherDetails>\r
+               <defaultValue>0.53</defaultValue>\r
+               <validValue>\r
+                       <type>Float</type>\r
+                       <min>0.01</min>\r
+                       <max>0.99</max>\r
+               </validValue>\r
+       </parameters>\r
+</runnerConfig>\r
diff --git a/datamodel/compbio/data/sequence/AnnotatedSequence.java b/datamodel/compbio/data/sequence/AnnotatedSequence.java
new file mode 100644 (file)
index 0000000..5d09534
--- /dev/null
@@ -0,0 +1,56 @@
+package compbio.data.sequence;\r
+\r
+import java.util.Arrays;\r
+\r
+public class AnnotatedSequence extends FastaSequence {\r
+\r
+    private final float[] annotation;\r
+\r
+    public AnnotatedSequence(String id, String sequence, float[] annotation) {\r
+       super(id, sequence);\r
+       this.annotation = annotation;\r
+       if (annotation == null || annotation.length != sequence.length()) {\r
+           throw new IllegalArgumentException("The length of the annotation ("\r
+                   + ((annotation != null) ? annotation.length : "0")\r
+                   + ") does not match the length of the sequence ("\r
+                   + sequence.length() + ")!");\r
+       }\r
+    }\r
+\r
+    public AnnotatedSequence(FastaSequence fsequence, float[] annotation) {\r
+       this(fsequence.getId(), fsequence.getSequence(), annotation);\r
+    }\r
+\r
+    public float[] getAnnotation() {\r
+       return annotation;\r
+    }\r
+\r
+    @Override\r
+    public int hashCode() {\r
+       final int prime = 7;\r
+       int result = super.hashCode();\r
+       result = prime * result + Arrays.hashCode(annotation);\r
+       return result;\r
+    }\r
+\r
+    @Override\r
+    public boolean equals(Object obj) {\r
+       if (this == obj)\r
+           return true;\r
+       if (!super.equals(obj))\r
+           return false;\r
+       if (getClass() != obj.getClass())\r
+           return false;\r
+       AnnotatedSequence other = (AnnotatedSequence) obj;\r
+       if (!Arrays.equals(annotation, other.annotation))\r
+           return false;\r
+       return true;\r
+    }\r
+\r
+    @Override\r
+    public String toString() {\r
+       return super.toString() + "Annotation:\n "\r
+               + Arrays.toString(annotation) + "\n";\r
+    }\r
+\r
+}\r
index 1a3ce5b..f7c923a 100644 (file)
@@ -1,6 +1,9 @@
-/* Copyright (c) 2009 Peter Troshin\r
+/* \r
+ * @(#)SequenceUtil.java 1.0 September 2009\r
+ * \r
+ * Copyright (c) 2009 Peter Troshin\r
  *  \r
  *  \r
- *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0\r
+ * Jalview Web Services 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 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
@@ -10,7 +13,7 @@
  *  License for more details.\r
  * \r
  *  A copy of the license is in apache_license.txt. It is also available here:\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
+ * 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
  * Any republication or derived work distributed in source code form\r
  * must include this copyright and license notice.\r
@@ -21,6 +24,8 @@ package compbio.data.sequence;
 import java.io.BufferedReader;\r
 import java.io.BufferedWriter;\r
 import java.io.Closeable;\r
 import java.io.BufferedReader;\r
 import java.io.BufferedWriter;\r
 import java.io.Closeable;\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
 import java.io.IOException;\r
 import java.io.InputStream;\r
 import java.io.InputStreamReader;\r
 import java.io.IOException;\r
 import java.io.InputStream;\r
 import java.io.InputStreamReader;\r
@@ -35,9 +40,8 @@ import java.util.regex.Pattern;
 /**\r
  * Utility class for operations on sequences\r
  * \r
 /**\r
  * Utility class for operations on sequences\r
  * \r
- * @author pvtroshin\r
- * \r
- *         Date September 2009\r
+ * @author Petr Troshin\r
+ * @version 1.0\r
  */\r
 public final class SequenceUtil {\r
 \r
  */\r
 public final class SequenceUtil {\r
 \r
@@ -111,8 +115,8 @@ public final class SequenceUtil {
     /**\r
      * @return true is the sequence contains only letters a,c, t, g, u\r
      */\r
     /**\r
      * @return true is the sequence contains only letters a,c, t, g, u\r
      */\r
-    public static boolean isNucleotideSequence(FastaSequence s) {\r
-       return isNonAmbNucleotideSequence(s.getSequence());\r
+    public static boolean isNucleotideSequence(final FastaSequence s) {\r
+       return SequenceUtil.isNonAmbNucleotideSequence(s.getSequence());\r
     }\r
 \r
     /**\r
     }\r
 \r
     /**\r
@@ -120,11 +124,11 @@ public final class SequenceUtil {
      * (!) - B char\r
      */\r
     public static boolean isNonAmbNucleotideSequence(String sequence) {\r
      * (!) - B char\r
      */\r
     public static boolean isNonAmbNucleotideSequence(String sequence) {\r
-       sequence = cleanSequence(sequence);\r
-       if (DIGIT.matcher(sequence).find()) {\r
+       sequence = SequenceUtil.cleanSequence(sequence);\r
+       if (SequenceUtil.DIGIT.matcher(sequence).find()) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       if (NON_NUCLEOTIDE.matcher(sequence).find()) {\r
+       if (SequenceUtil.NON_NUCLEOTIDE.matcher(sequence).find()) {\r
            return false;\r
            /*\r
             * System.out.format("I found the text starting at " +\r
            return false;\r
            /*\r
             * System.out.format("I found the text starting at " +\r
@@ -132,7 +136,7 @@ public final class SequenceUtil {
             * nonDNAmatcher.end());\r
             */\r
        }\r
             * nonDNAmatcher.end());\r
             */\r
        }\r
-       Matcher DNAmatcher = NUCLEOTIDE.matcher(sequence);\r
+       final Matcher DNAmatcher = SequenceUtil.NUCLEOTIDE.matcher(sequence);\r
        return DNAmatcher.find();\r
     }\r
 \r
        return DNAmatcher.find();\r
     }\r
 \r
@@ -144,7 +148,7 @@ public final class SequenceUtil {
      */\r
     public static String cleanSequence(String sequence) {\r
        assert sequence != null;\r
      */\r
     public static String cleanSequence(String sequence) {\r
        assert sequence != null;\r
-       final Matcher m = WHITE_SPACE.matcher(sequence);\r
+       final Matcher m = SequenceUtil.WHITE_SPACE.matcher(sequence);\r
        sequence = m.replaceAll("").toUpperCase();\r
        return sequence;\r
     }\r
        sequence = m.replaceAll("").toUpperCase();\r
        return sequence;\r
     }\r
@@ -157,10 +161,10 @@ public final class SequenceUtil {
      * @return cleaned up sequence\r
      */\r
     public static String deepCleanSequence(String sequence) {\r
      * @return cleaned up sequence\r
      */\r
     public static String deepCleanSequence(String sequence) {\r
-       sequence = cleanSequence(sequence);\r
-       sequence = DIGIT.matcher(sequence).replaceAll("");\r
-       sequence = NONWORD.matcher(sequence).replaceAll("");\r
-       Pattern othernonSeqChars = Pattern.compile("[_-]+");\r
+       sequence = SequenceUtil.cleanSequence(sequence);\r
+       sequence = SequenceUtil.DIGIT.matcher(sequence).replaceAll("");\r
+       sequence = SequenceUtil.NONWORD.matcher(sequence).replaceAll("");\r
+       final Pattern othernonSeqChars = Pattern.compile("[_-]+");\r
        sequence = othernonSeqChars.matcher(sequence).replaceAll("");\r
        return sequence;\r
     }\r
        sequence = othernonSeqChars.matcher(sequence).replaceAll("");\r
        return sequence;\r
     }\r
@@ -171,17 +175,17 @@ public final class SequenceUtil {
      * @return true is the sequence is a protein sequence, false overwise\r
      */\r
     public static boolean isProteinSequence(String sequence) {\r
      * @return true is the sequence is a protein sequence, false overwise\r
      */\r
     public static boolean isProteinSequence(String sequence) {\r
-       sequence = cleanSequence(sequence);\r
-       if (isNonAmbNucleotideSequence(sequence)) {\r
+       sequence = SequenceUtil.cleanSequence(sequence);\r
+       if (SequenceUtil.isNonAmbNucleotideSequence(sequence)) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       if (DIGIT.matcher(sequence).find()) {\r
+       if (SequenceUtil.DIGIT.matcher(sequence).find()) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       if (NON_AA.matcher(sequence).find()) {\r
+       if (SequenceUtil.NON_AA.matcher(sequence).find()) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       Matcher protmatcher = AA.matcher(sequence);\r
+       final Matcher protmatcher = SequenceUtil.AA.matcher(sequence);\r
        return protmatcher.find();\r
     }\r
 \r
        return protmatcher.find();\r
     }\r
 \r
@@ -194,20 +198,20 @@ public final class SequenceUtil {
      *         protein or DNA\r
      */\r
     public static boolean isAmbiguosProtein(String sequence) {\r
      *         protein or DNA\r
      */\r
     public static boolean isAmbiguosProtein(String sequence) {\r
-       sequence = cleanSequence(sequence);\r
-       if (isNonAmbNucleotideSequence(sequence)) {\r
+       sequence = SequenceUtil.cleanSequence(sequence);\r
+       if (SequenceUtil.isNonAmbNucleotideSequence(sequence)) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       if (DIGIT.matcher(sequence).find()) {\r
+       if (SequenceUtil.DIGIT.matcher(sequence).find()) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       if (NON_AA.matcher(sequence).find()) {\r
+       if (SequenceUtil.NON_AA.matcher(sequence).find()) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       if (AA.matcher(sequence).find()) {\r
+       if (SequenceUtil.AA.matcher(sequence).find()) {\r
            return false;\r
        }\r
            return false;\r
        }\r
-       Matcher amb_prot = AMBIGUOUS_AA.matcher(sequence);\r
+       final Matcher amb_prot = SequenceUtil.AMBIGUOUS_AA.matcher(sequence);\r
        return amb_prot.find();\r
     }\r
 \r
        return amb_prot.find();\r
     }\r
 \r
@@ -221,12 +225,13 @@ public final class SequenceUtil {
      *            - the maximum number of characters to write in one line\r
      * @throws IOException\r
      */\r
      *            - the maximum number of characters to write in one line\r
      * @throws IOException\r
      */\r
-    public static void writeFasta(OutputStream outstream,\r
-           List<FastaSequence> sequences, int width) throws IOException {\r
-       OutputStreamWriter writer = new OutputStreamWriter(outstream);\r
-       BufferedWriter fastawriter = new BufferedWriter(writer);\r
-       for (FastaSequence fs : sequences) {\r
-           fastawriter.write(fs.getOnelineFasta());\r
+    public static void writeFasta(final OutputStream outstream,\r
+           final List<FastaSequence> sequences, final int width)\r
+           throws IOException {\r
+       final OutputStreamWriter writer = new OutputStreamWriter(outstream);\r
+       final BufferedWriter fastawriter = new BufferedWriter(writer);\r
+       for (final FastaSequence fs : sequences) {\r
+           fastawriter.write(fs.getFormatedSequence(width));\r
        }\r
        outstream.flush();\r
        fastawriter.close();\r
        }\r
        outstream.flush();\r
        fastawriter.close();\r
@@ -242,28 +247,30 @@ public final class SequenceUtil {
      * @return list of FastaSequence objects\r
      * @throws IOException\r
      */\r
      * @return list of FastaSequence objects\r
      * @throws IOException\r
      */\r
-    public static List<FastaSequence> readFasta(InputStream inStream)\r
+    public static List<FastaSequence> readFasta(final InputStream inStream)\r
            throws IOException {\r
            throws IOException {\r
-       List<FastaSequence> seqs = new ArrayList<FastaSequence>();\r
-       InputStreamReader inReader = new InputStreamReader(inStream);\r
-       BufferedReader infasta = new BufferedReader(inReader);\r
-       Pattern pattern = Pattern.compile("//s+");\r
+       final List<FastaSequence> seqs = new ArrayList<FastaSequence>();\r
+\r
+       final BufferedReader infasta = new BufferedReader(\r
+               new InputStreamReader(inStream, "UTF8"), 16000);\r
+       final Pattern pattern = Pattern.compile("//s+");\r
 \r
        String line;\r
        String sname = "", seqstr = null;\r
        do {\r
            line = infasta.readLine();\r
 \r
        String line;\r
        String sname = "", seqstr = null;\r
        do {\r
            line = infasta.readLine();\r
-           if (line == null || line.startsWith(">")) {\r
-               if (seqstr != null)\r
+           if ((line == null) || line.startsWith(">")) {\r
+               if (seqstr != null) {\r
                    seqs.add(new FastaSequence(sname.substring(1), seqstr));\r
                    seqs.add(new FastaSequence(sname.substring(1), seqstr));\r
+               }\r
                sname = line; // remove >\r
                seqstr = "";\r
            } else {\r
                sname = line; // remove >\r
                seqstr = "";\r
            } else {\r
-               String subseq = pattern.matcher(line).replaceAll("");\r
+               final String subseq = pattern.matcher(line).replaceAll("");\r
                seqstr += subseq;\r
            }\r
        } while (line != null);\r
                seqstr += subseq;\r
            }\r
        } while (line != null);\r
-       inReader.close();\r
+\r
        infasta.close();\r
        return seqs;\r
     }\r
        infasta.close();\r
        return seqs;\r
     }\r
@@ -275,17 +282,103 @@ public final class SequenceUtil {
      * @param sequences\r
      * @throws IOException\r
      */\r
      * @param sequences\r
      * @throws IOException\r
      */\r
-    public static void writeFasta(OutputStream os, List<FastaSequence> sequences)\r
-           throws IOException {\r
-       OutputStreamWriter outWriter = new OutputStreamWriter(os);\r
-       BufferedWriter fasta_out = new BufferedWriter(outWriter);\r
-       for (FastaSequence fs : sequences) {\r
+    public static void writeFasta(final OutputStream os,\r
+           final List<FastaSequence> sequences) throws IOException {\r
+       final OutputStreamWriter outWriter = new OutputStreamWriter(os);\r
+       final BufferedWriter fasta_out = new BufferedWriter(outWriter);\r
+       for (final FastaSequence fs : sequences) {\r
            fasta_out.write(fs.getOnelineFasta());\r
        }\r
        fasta_out.close();\r
        outWriter.close();\r
     }\r
 \r
            fasta_out.write(fs.getOnelineFasta());\r
        }\r
        fasta_out.close();\r
        outWriter.close();\r
     }\r
 \r
+    public static List<AnnotatedSequence> readJRonn(final File result)\r
+           throws IOException, UnknownFileFormatException {\r
+       InputStream input = new FileInputStream(result);\r
+       List<AnnotatedSequence> sequences = readJRonn(input);\r
+       input.close();\r
+       return sequences;\r
+    }\r
+\r
+    /**\r
+     * Reader for JRonn horizontal file format\r
+     * \r
+     * >Foobar\r
+     * \r
+     * M G D T T A G\r
+     * \r
+     * 0.48 0.42 0.42 0.48 0.52 0.53 0.54\r
+     * \r
+     * All values are tab delimited\r
+     * \r
+     * @param inStream\r
+     * @return\r
+     * @throws IOException\r
+     * @throws UnknownFileFormatException\r
+     */\r
+    public static List<AnnotatedSequence> readJRonn(final InputStream inStream)\r
+           throws IOException, UnknownFileFormatException {\r
+       final List<AnnotatedSequence> seqs = new ArrayList<AnnotatedSequence>();\r
+\r
+       final BufferedReader infasta = new BufferedReader(\r
+               new InputStreamReader(inStream, "UTF8"), 16000);\r
+\r
+       String line;\r
+       String sname = "";\r
+       do {\r
+           line = infasta.readLine();\r
+           if (line == null || line.isEmpty()) {\r
+               // skip empty lines\r
+               continue;\r
+           }\r
+           if (line.startsWith(">")) {\r
+               // read name\r
+               sname = line.trim().substring(1);\r
+               // read sequence line\r
+               line = infasta.readLine();\r
+               final String sequence = line.replace("\t", "");\r
+               // read annotation line\r
+               line = infasta.readLine();\r
+               String[] annotValues = line.split("\t");\r
+               float[] annotation = convertToNumber(annotValues);\r
+               if (annotation.length != sequence.length()) {\r
+                   throw new UnknownFileFormatException(\r
+                           "File does not look like Jronn horizontally formatted output file!\n"\r
+                                   + JRONN_WRONG_FORMAT_MESSAGE);\r
+               }\r
+               seqs.add(new AnnotatedSequence(sname, sequence, annotation));\r
+           }\r
+       } while (line != null);\r
+\r
+       infasta.close();\r
+       return seqs;\r
+    }\r
+\r
+    private static float[] convertToNumber(String[] annotValues)\r
+           throws UnknownFileFormatException {\r
+       float[] annotation = new float[annotValues.length];\r
+       try {\r
+           for (int i = 0; i < annotation.length; i++) {\r
+               annotation[i] = Float.parseFloat(annotValues[i]);\r
+           }\r
+       } catch (NumberFormatException e) {\r
+           throw new UnknownFileFormatException(JRONN_WRONG_FORMAT_MESSAGE, e\r
+                   .getCause());\r
+       }\r
+       return annotation;\r
+    }\r
+\r
+    private static final String JRONN_WRONG_FORMAT_MESSAGE = "Jronn file must be in the following format:\n"\r
+           + ">sequence_name\n "\r
+           + "M        V       S\n"\r
+           + "0.43     0.22    0.65\n"\r
+           + "Where first line is the sequence name,\n"\r
+           + "second line is the tab delimited sequence,\n"\r
+           + "third line contains tab delimited disorder prediction values.\n"\r
+           + "No lines are allowed between these three. Additionally, the number of  "\r
+           + "sequence residues must be equal to the number of the disorder values.";\r
+\r
     /**\r
      * Closes the Closable and logs the exception if any\r
      * \r
     /**\r
      * Closes the Closable and logs the exception if any\r
      * \r
index b4f82fd..adc3e0b 100644 (file)
@@ -31,233 +31,233 @@ import compbio.util.Util;
 \r
 public abstract class SkeletalExecutable<T> implements Executable<T> {\r
 \r
 \r
 public abstract class SkeletalExecutable<T> implements Executable<T> {\r
 \r
-       private static final PropertyHelper ph = PropertyHelperManager\r
-                       .getPropertyHelper();\r
+    protected static final PropertyHelper ph = PropertyHelperManager\r
+           .getPropertyHelper();\r
 \r
 \r
-       private static Logger log = Logger.getLogger(SkeletalExecutable.class);\r
+    private static Logger log = Logger.getLogger(SkeletalExecutable.class);\r
 \r
 \r
-       protected String inputFile = "input.txt";\r
-       protected String outputFile = "output.txt";\r
-       protected String errorFile = "error.txt";\r
+    protected String inputFile = "input.txt";\r
+    protected String outputFile = "output.txt";\r
+    protected String errorFile = "error.txt";\r
 \r
 \r
-       private boolean isInputSet = false;\r
-       private boolean isOutputSet = false;\r
-       private boolean isErrorSet = false;\r
+    private boolean isInputSet = false;\r
+    private boolean isOutputSet = false;\r
+    private boolean isErrorSet = false;\r
 \r
 \r
-       /**\r
-        * This has to allow duplicate parameters as different options may have the\r
-        * same value e.g. Muscle -weight1 clustalw -weight2 clustalw\r
-        */\r
-       protected CommandBuilder<T> cbuilder;\r
-\r
-       public SkeletalExecutable() {\r
-               cbuilder = new CommandBuilder<T>(" ");\r
-       }\r
+    /**\r
+     * This has to allow duplicate parameters as different options may have the\r
+     * same value e.g. Muscle -weight1 clustalw -weight2 clustalw\r
+     */\r
+    protected CommandBuilder<T> cbuilder;\r
 \r
 \r
-       public SkeletalExecutable(String parameterKeyValueDelimiter) {\r
-               assert parameterKeyValueDelimiter != null;\r
-               cbuilder = new CommandBuilder<T>(parameterKeyValueDelimiter);\r
-       }\r
+    public SkeletalExecutable() {\r
+       cbuilder = new CommandBuilder<T>(" ");\r
+    }\r
 \r
 \r
-       public SkeletalExecutable<T> setInput(String inFile) {\r
-               if (compbio.util.Util.isEmpty(inFile)) {\r
-                       throw new IllegalArgumentException("Input file must not be NULL");\r
-               }\r
-               this.inputFile = inFile;\r
-               this.isInputSet = true;\r
-               return this;\r
-       }\r
+    public SkeletalExecutable(String parameterKeyValueDelimiter) {\r
+       assert parameterKeyValueDelimiter != null;\r
+       cbuilder = new CommandBuilder<T>(parameterKeyValueDelimiter);\r
+    }\r
 \r
 \r
-       public SkeletalExecutable<T> setOutput(String outFile) {\r
-               if (compbio.util.Util.isEmpty(outFile)\r
-                               || PathValidator.isAbsolutePath(outFile)) {\r
-                       throw new IllegalArgumentException(\r
-                                       "Output file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: "\r
-                                                       + outFile);\r
-               }\r
-               this.outputFile = outFile;\r
-               this.isOutputSet = true;\r
-               return this;\r
+    public SkeletalExecutable<T> setInput(String inFile) {\r
+       if (compbio.util.Util.isEmpty(inFile)) {\r
+           throw new IllegalArgumentException("Input file must not be NULL");\r
        }\r
        }\r
-\r
-       public SkeletalExecutable<T> setError(String errFile) {\r
-               if (compbio.util.Util.isEmpty(errFile)\r
-                               || PathValidator.isAbsolutePath(errFile)) {\r
-                       throw new IllegalArgumentException(\r
-                                       "Error file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: "\r
-                                                       + errFile);\r
-               }\r
-               this.errorFile = errFile;\r
-               this.isErrorSet = true;\r
-               return this;\r
+       this.inputFile = inFile;\r
+       this.isInputSet = true;\r
+       return this;\r
+    }\r
+\r
+    public SkeletalExecutable<T> setOutput(String outFile) {\r
+       if (compbio.util.Util.isEmpty(outFile)\r
+               || PathValidator.isAbsolutePath(outFile)) {\r
+           throw new IllegalArgumentException(\r
+                   "Output file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: "\r
+                           + outFile);\r
        }\r
        }\r
-\r
-       @Override\r
-       public CommandBuilder<T> getParameters(ExecProvider provider) {\r
-               /*\r
-                * Prevent modification of the parameters unintentionally. This is\r
-                * important to preserve executable parameters intact as engine could\r
-                * add things into the array as it see fit. For instance\r
-                * ExecutableWrapper (part of local engines) add command line as the\r
-                * first element of an array.\r
-                */\r
-               paramValueUpdater();\r
-               return cbuilder;\r
+       this.outputFile = outFile;\r
+       this.isOutputSet = true;\r
+       return this;\r
+    }\r
+\r
+    public SkeletalExecutable<T> setError(String errFile) {\r
+       if (compbio.util.Util.isEmpty(errFile)\r
+               || PathValidator.isAbsolutePath(errFile)) {\r
+           throw new IllegalArgumentException(\r
+                   "Error file must not be NULL and Absolute path could not be used! Please provide the filename only. Value provided: "\r
+                           + errFile);\r
        }\r
        }\r
-\r
-       @Override\r
-       public Executable<T> addParameters(List<String> parameters) {\r
-               cbuilder.addParams(parameters);\r
-               return this;\r
-       }\r
-\r
-       public Executable<T> setParameter(String parameter) {\r
-               cbuilder.setParam(parameter);\r
-               return this;\r
-       }\r
-\r
-       /**\r
-        * This is a generic method of changing values of the parameters with\r
-        * properties\r
-        * \r
-        * This method iterates via commands for an executable finding matches from\r
-        * the Executable.properties file and replacing values in CommandBuilder\r
-        * with a combination of value from CommandBuilder to merge path from\r
-        * properties\r
+       this.errorFile = errFile;\r
+       this.isErrorSet = true;\r
+       return this;\r
+    }\r
+\r
+    @Override\r
+    public CommandBuilder<T> getParameters(ExecProvider provider) {\r
+       /*\r
+        * Prevent modification of the parameters unintentionally. This is\r
+        * important to preserve executable parameters intact as engine could\r
+        * add things into the array as it see fit. For instance\r
+        * ExecutableWrapper (part of local engines) add command line as the\r
+        * first element of an array.\r
         */\r
         */\r
-       void paramValueUpdater() {\r
-               for (Parameter command : cbuilder.getCommandList()) {\r
-                       if (command.value == null) {\r
-                               continue;\r
-                       }\r
-                       String propertyPath = compbio.engine.client.Util.getExecProperty(\r
-                                       command.name + ".path", getType());\r
-                       if (Util.isEmpty(propertyPath)) {\r
-                               continue;\r
-                       }\r
-                       if (new File(command.value).isAbsolute()) {\r
-                               // Matrix can be found so no actions necessary\r
-                               // This method has been called already and the matrix name\r
-                               // is modified to contain full path // no further actions is\r
-                               // necessary\r
-                               continue;\r
-                       }\r
-                       String absMatrixPath = compbio.engine.client.Util\r
-                                       .convertToAbsolute(propertyPath);\r
-                       command.value = absMatrixPath + File.separator + command.value;\r
-                       cbuilder.setParam(command);\r
-               }\r
+       paramValueUpdater();\r
+       return cbuilder;\r
+    }\r
+\r
+    @Override\r
+    public Executable<T> addParameters(List<String> parameters) {\r
+       cbuilder.addParams(parameters);\r
+       return this;\r
+    }\r
+\r
+    public Executable<T> setParameter(String parameter) {\r
+       cbuilder.setParam(parameter);\r
+       return this;\r
+    }\r
+\r
+    /**\r
+     * This is a generic method of changing values of the parameters with\r
+     * properties\r
+     * \r
+     * This method iterates via commands for an executable finding matches from\r
+     * the Executable.properties file and replacing values in CommandBuilder\r
+     * with a combination of value from CommandBuilder to merge path from\r
+     * properties\r
+     */\r
+    void paramValueUpdater() {\r
+       for (Parameter command : cbuilder.getCommandList()) {\r
+           if (command.value == null) {\r
+               continue;\r
+           }\r
+           String propertyPath = compbio.engine.client.Util.getExecProperty(\r
+                   command.name + ".path", getType());\r
+           if (Util.isEmpty(propertyPath)) {\r
+               continue;\r
+           }\r
+           if (new File(command.value).isAbsolute()) {\r
+               // Matrix can be found so no actions necessary\r
+               // This method has been called already and the matrix name\r
+               // is modified to contain full path // no further actions is\r
+               // necessary\r
+               continue;\r
+           }\r
+           String absMatrixPath = compbio.engine.client.Util\r
+                   .convertToAbsolute(propertyPath);\r
+           command.value = absMatrixPath + File.separator + command.value;\r
+           cbuilder.setParam(command);\r
        }\r
        }\r
-\r
-       /**\r
-        * This method cannot really tell whether the files has actually been\r
-        * created or not. It must be overridden as required.\r
-        * \r
-        * @see compbio.engine.client.Executable#getCreatedFiles()\r
-        */\r
-       @Override\r
-       public List<String> getCreatedFiles() {\r
-               return Arrays.asList(getOutput(), getError());\r
+    }\r
+\r
+    /**\r
+     * This method cannot really tell whether the files has actually been\r
+     * created or not. It must be overridden as required.\r
+     * \r
+     * @see compbio.engine.client.Executable#getCreatedFiles()\r
+     */\r
+    @Override\r
+    public List<String> getCreatedFiles() {\r
+       return Arrays.asList(getOutput(), getError());\r
+    }\r
+\r
+    @Override\r
+    public String getInput() {\r
+       return inputFile;\r
+    }\r
+\r
+    protected boolean isInputSet() {\r
+       return isInputSet;\r
+    }\r
+\r
+    protected boolean isOutputSet() {\r
+       return isOutputSet;\r
+    }\r
+\r
+    protected boolean isErrorSet() {\r
+       return isErrorSet;\r
+    }\r
+\r
+    @Override\r
+    public String getOutput() {\r
+       return outputFile;\r
+    }\r
+\r
+    @Override\r
+    public String getError() {\r
+       return errorFile;\r
+    }\r
+\r
+    @Override\r
+    public String toString() {\r
+       String value = "Input: " + this.getInput() + "\n";\r
+       value += "Output: " + this.getOutput() + "\n";\r
+       value += "Error: " + this.getError() + "\n";\r
+       value += "Class: " + this.getClass() + "\n";\r
+       value += "Params: " + cbuilder + "\n";\r
+       return value;\r
+    }\r
+\r
+    @Override\r
+    public Executable<?> loadRunConfiguration(RunConfiguration rconfig) {\r
+       if (!compbio.util.Util.isEmpty(rconfig.getOutput())) {\r
+           setOutput(rconfig.getOutput());\r
        }\r
        }\r
-\r
-       @Override\r
-       public String getInput() {\r
-               return inputFile;\r
+       if (!compbio.util.Util.isEmpty(rconfig.getError())) {\r
+           setError(rconfig.getError());\r
        }\r
        }\r
-\r
-       protected boolean isInputSet() {\r
-               return isInputSet;\r
-       }\r
-\r
-       protected boolean isOutputSet() {\r
-               return isOutputSet;\r
-       }\r
-\r
-       protected boolean isErrorSet() {\r
-               return isErrorSet;\r
-       }\r
-\r
-       @Override\r
-       public String getOutput() {\r
-               return outputFile;\r
+       if (!compbio.util.Util.isEmpty(rconfig.getInput())) {\r
+           setInput(rconfig.getInput());\r
        }\r
        }\r
-\r
-       @Override\r
-       public String getError() {\r
-               return errorFile;\r
+       this.cbuilder = (CommandBuilder<T>) rconfig.getParameters();\r
+       return this;\r
+    }\r
+\r
+    @Override\r
+    public boolean equals(Object obj) {\r
+       if (obj == null) {\r
+           return false;\r
        }\r
        }\r
-\r
-       @Override\r
-       public String toString() {\r
-               String value = "Input: " + this.getInput() + "\n";\r
-               value += "Output: " + this.getOutput() + "\n";\r
-               value += "Error: " + this.getError() + "\n";\r
-               value += "Class: " + this.getClass() + "\n";\r
-               value += "Params: " + cbuilder + "\n";\r
-               return value;\r
+       if (!(obj instanceof SkeletalExecutable<?>)) {\r
+           return false;\r
        }\r
        }\r
-\r
-       @Override\r
-       public Executable<?> loadRunConfiguration(RunConfiguration rconfig) {\r
-               if (!compbio.util.Util.isEmpty(rconfig.getOutput())) {\r
-                       setOutput(rconfig.getOutput());\r
-               }\r
-               if (!compbio.util.Util.isEmpty(rconfig.getError())) {\r
-                       setError(rconfig.getError());\r
-               }\r
-               if (!compbio.util.Util.isEmpty(rconfig.getInput())) {\r
-                       setInput(rconfig.getInput());\r
-               }\r
-               this.cbuilder = (CommandBuilder<T>) rconfig.getParameters();\r
-               return this;\r
+       SkeletalExecutable<?> exec = (SkeletalExecutable<?>) obj;\r
+       if (!Util.isEmpty(this.inputFile) && !Util.isEmpty(exec.inputFile)) {\r
+           if (!this.inputFile.equals(exec.inputFile)) {\r
+               return false;\r
+           }\r
        }\r
        }\r
-\r
-       @Override\r
-       public boolean equals(Object obj) {\r
-               if (obj == null) {\r
-                       return false;\r
-               }\r
-               if (!(obj instanceof SkeletalExecutable<?>)) {\r
-                       return false;\r
-               }\r
-               SkeletalExecutable<?> exec = (SkeletalExecutable<?>) obj;\r
-               if (!Util.isEmpty(this.inputFile) && !Util.isEmpty(exec.inputFile)) {\r
-                       if (!this.inputFile.equals(exec.inputFile)) {\r
-                               return false;\r
-                       }\r
-               }\r
-               if (!Util.isEmpty(this.outputFile) && !Util.isEmpty(exec.outputFile)) {\r
-                       if (!this.outputFile.equals(exec.outputFile)) {\r
-                               return false;\r
-                       }\r
-               }\r
-               if (!Util.isEmpty(this.errorFile) && !Util.isEmpty(exec.errorFile)) {\r
-                       if (!this.errorFile.equals(exec.errorFile)) {\r
-                               return false;\r
-                       }\r
-               }\r
-               if (!this.cbuilder.equals(exec.cbuilder)) {\r
-                       return false;\r
-               }\r
-               return true;\r
+       if (!Util.isEmpty(this.outputFile) && !Util.isEmpty(exec.outputFile)) {\r
+           if (!this.outputFile.equals(exec.outputFile)) {\r
+               return false;\r
+           }\r
        }\r
        }\r
-\r
-       @Override\r
-       public int hashCode() {\r
-               int code = inputFile.hashCode();\r
-               code += outputFile.hashCode();\r
-               code += errorFile.hashCode();\r
-               code *= this.cbuilder.hashCode();\r
-               return code;\r
+       if (!Util.isEmpty(this.errorFile) && !Util.isEmpty(exec.errorFile)) {\r
+           if (!this.errorFile.equals(exec.errorFile)) {\r
+               return false;\r
+           }\r
        }\r
        }\r
-\r
-       public String getClusterSettings() {\r
-               String settings = ph.getProperty(getType().getSimpleName()\r
-                               .toLowerCase()\r
-                               + ".cluster.settings");\r
-               return settings == null ? "" : settings;\r
+       if (!this.cbuilder.equals(exec.cbuilder)) {\r
+           return false;\r
        }\r
        }\r
-\r
-       public abstract Class<? extends Executable<?>> getType();\r
+       return true;\r
+    }\r
+\r
+    @Override\r
+    public int hashCode() {\r
+       int code = inputFile.hashCode();\r
+       code += outputFile.hashCode();\r
+       code += errorFile.hashCode();\r
+       code *= this.cbuilder.hashCode();\r
+       return code;\r
+    }\r
+\r
+    public String getClusterSettings() {\r
+       String settings = ph.getProperty(getType().getSimpleName()\r
+               .toLowerCase()\r
+               + ".cluster.settings");\r
+       return settings == null ? "" : settings;\r
+    }\r
+\r
+    public abstract Class<? extends Executable<?>> getType();\r
 \r
 }\r
 \r
 }\r
index a3c86c6..9475a0b 100644 (file)
@@ -27,6 +27,7 @@ import java.util.List;
 import org.apache.log4j.Logger;\r
 \r
 import compbio.data.sequence.Alignment;\r
 import org.apache.log4j.Logger;\r
 \r
 import compbio.data.sequence.Alignment;\r
+import compbio.data.sequence.AnnotatedSequence;\r
 import compbio.data.sequence.ClustalAlignmentUtil;\r
 import compbio.data.sequence.FastaSequence;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.data.sequence.ClustalAlignmentUtil;\r
 import compbio.data.sequence.FastaSequence;\r
 import compbio.data.sequence.SequenceUtil;\r
@@ -130,6 +131,23 @@ public final class Util {
        return ClustalAlignmentUtil.readClustalFile(cfile);\r
     }\r
 \r
        return ClustalAlignmentUtil.readClustalFile(cfile);\r
     }\r
 \r
+    public static final List<AnnotatedSequence> readJronnFile(\r
+           String workDirectory, String clustFile)\r
+           throws UnknownFileFormatException, IOException,\r
+           FileNotFoundException, NullPointerException {\r
+       assert !compbio.util.Util.isEmpty(workDirectory);\r
+       assert !compbio.util.Util.isEmpty(clustFile);\r
+       File cfile = new File(compbio.engine.client.Util.getFullPath(\r
+               workDirectory, clustFile));\r
+       log.trace("Jronn OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
+       if (!(cfile.exists() && cfile.length() > 0)) {\r
+           throw new FileNotFoundException("Result for the jobId "\r
+                   + workDirectory + " with file name " + clustFile\r
+                   + " is not found!");\r
+       }\r
+       return SequenceUtil.readJRonn(cfile);\r
+    }\r
+\r
     public static void writeInput(List<FastaSequence> sequences,\r
            ConfiguredExecutable<?> exec) {\r
 \r
     public static void writeInput(List<FastaSequence> sequences,\r
            ConfiguredExecutable<?> exec) {\r
 \r
similarity index 58%
rename from runner/compbio/runner/disorder/RonnWrapper.java
rename to runner/compbio/runner/disorder/Jronn.java
index 0bd621e..0c4245a 100644 (file)
 \r
 package compbio.runner.disorder;\r
 \r
 \r
 package compbio.runner.disorder;\r
 \r
+import java.io.File;\r
+import java.io.FileInputStream;\r
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
+import java.io.InputStream;\r
 import java.util.Arrays;\r
 import java.util.List;\r
 \r
 import org.apache.log4j.Logger;\r
 \r
 import java.util.Arrays;\r
 import java.util.List;\r
 \r
 import org.apache.log4j.Logger;\r
 \r
-import compbio.data.sequence.Alignment;\r
+import compbio.data.sequence.AnnotatedSequence;\r
+import compbio.data.sequence.SequenceUtil;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.engine.client.Executable;\r
 import compbio.data.sequence.UnknownFileFormatException;\r
 import compbio.engine.client.Executable;\r
-import compbio.engine.client.PipedExecutable;\r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.Limit;\r
 import compbio.metadata.LimitsManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.runner.Util;\r
 \r
 import compbio.engine.client.SkeletalExecutable;\r
 import compbio.metadata.Limit;\r
 import compbio.metadata.LimitsManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
 import compbio.runner.Util;\r
 \r
-public class RonnWrapper extends SkeletalExecutable<RonnWrapper> implements\r
-       PipedExecutable<RonnWrapper> {\r
-    /*\r
-     * RONN does not accept stdin the file name must be defined as parameter It\r
-     * can only analyse ONE sequence per run! (or may be not, but the results\r
-     * gets overriden!) FASTA format is accepted.\r
-     * \r
-     * To run it do the following:\r
-     * \r
-     * 1) copy ronn executables and task file to work directory\r
-     * \r
-     * 2) execute run processes one by one for each sequence\r
-     */\r
-\r
-    private static final String command = "/homes/pvtroshin/soft/RONNv3_fasta/Ronn_runner.sh";\r
+/**\r
+ * Command line\r
+ * \r
+ * java -Xmx512 -jar jronn_v3.jar -i=test_seq.txt -n=1 -o=out.txt -s=stat.out\r
+ * \r
+ * @author pvtroshin\r
+ * \r
+ */\r
+public class Jronn extends SkeletalExecutable<Jronn> {\r
 \r
 \r
-    private static Logger log = Logger.getLogger(RonnWrapper.class);\r
+    private static Logger log = Logger.getLogger(Jronn.class);\r
 \r
     // Cache for Limits information\r
 \r
     // Cache for Limits information\r
-    private static LimitsManager<RonnWrapper> limits;\r
+    private static LimitsManager<Jronn> limits;\r
 \r
     public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
 \r
     public static final String KEY_VALUE_SEPARATOR = Util.SPACE;\r
+    public static final String STAT_FILE = "stat.txt";\r
+\r
+    public Jronn() {\r
+       addParameters(Arrays.asList("-jar", getLibPath(), "-n=1", "-s="\r
+               + STAT_FILE, "-f=H"));\r
+    }\r
 \r
     @SuppressWarnings("unchecked")\r
     @Override\r
 \r
     @SuppressWarnings("unchecked")\r
     @Override\r
-    public Alignment getResults(String workDirectory)\r
+    public List<AnnotatedSequence> getResults(String workDirectory)\r
            throws ResultNotAvailableException {\r
            throws ResultNotAvailableException {\r
+       List<AnnotatedSequence> sequences = null;\r
        try {\r
        try {\r
-           return Util.readClustalFile(workDirectory, getOutput());\r
+           InputStream inStream = new FileInputStream(new File(workDirectory,\r
+                   getOutput()));\r
+           sequences = SequenceUtil.readJRonn(inStream);\r
+           inStream.close();\r
        } catch (FileNotFoundException e) {\r
            log.error(e.getMessage(), e.getCause());\r
            throw new ResultNotAvailableException(e);\r
        } catch (FileNotFoundException e) {\r
            log.error(e.getMessage(), e.getCause());\r
            throw new ResultNotAvailableException(e);\r
@@ -77,6 +84,23 @@ public class RonnWrapper extends SkeletalExecutable<RonnWrapper> implements
            log.error(e.getMessage(), e.getCause());\r
            throw new ResultNotAvailableException(e);\r
        }\r
            log.error(e.getMessage(), e.getCause());\r
            throw new ResultNotAvailableException(e);\r
        }\r
+       return sequences;\r
+    }\r
+\r
+    private static String getLibPath() {\r
+\r
+       String settings = ph.getProperty("jronn.jar.file");\r
+       if (compbio.util.Util.isEmpty(settings)) {\r
+           throw new NullPointerException(\r
+                   "Please define jronn.jar.file property in Executable.properties file"\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
+           // no further actions is necessary\r
+           return settings;\r
+       }\r
+       return compbio.engine.client.Util.convertToAbsolute(settings);\r
     }\r
 \r
     @Override\r
     }\r
 \r
     @Override\r
@@ -85,18 +109,25 @@ public class RonnWrapper extends SkeletalExecutable<RonnWrapper> implements
     }\r
 \r
     @Override\r
     }\r
 \r
     @Override\r
-    public RonnWrapper setInput(String inFile) {\r
-       String input = getInput();\r
+    public Jronn setInput(String inFile) {\r
        super.setInput(inFile);\r
        super.setInput(inFile);\r
+       cbuilder.setParam("-i=" + inFile);\r
        return this;\r
     }\r
 \r
     @Override\r
        return this;\r
     }\r
 \r
     @Override\r
-    public Limit<RonnWrapper> getLimit(String presetName) {\r
+    public Jronn setOutput(String outFile) {\r
+       super.setOutput(outFile);\r
+       cbuilder.setParam("-o=" + outFile);\r
+       return this;\r
+    }\r
+\r
+    @Override\r
+    public Limit<Jronn> getLimit(String presetName) {\r
        if (limits == null) {\r
            limits = getLimits();\r
        }\r
        if (limits == null) {\r
            limits = getLimits();\r
        }\r
-       Limit<RonnWrapper> limit = null;\r
+       Limit<Jronn> limit = null;\r
        if (limits != null) {\r
            // this returns default limit if preset is undefined!\r
            limit = limits.getLimitByName(presetName);\r
        if (limits != null) {\r
            // this returns default limit if preset is undefined!\r
            limit = limits.getLimitByName(presetName);\r
@@ -112,7 +143,7 @@ public class RonnWrapper extends SkeletalExecutable<RonnWrapper> implements
     }\r
 \r
     @Override\r
     }\r
 \r
     @Override\r
-    public LimitsManager<RonnWrapper> getLimits() {\r
+    public LimitsManager<Jronn> getLimits() {\r
        // synchronise on static field\r
        synchronized (log) {\r
            if (limits == null) {\r
        // synchronise on static field\r
        synchronized (log) {\r
            if (limits == null) {\r
@@ -126,4 +157,8 @@ public class RonnWrapper extends SkeletalExecutable<RonnWrapper> implements
     public Class<? extends Executable<?>> getType() {\r
        return this.getClass();\r
     }\r
     public Class<? extends Executable<?>> getType() {\r
        return this.getClass();\r
     }\r
+\r
+    public static String getStatFile() {\r
+       return STAT_FILE;\r
+    }\r
 }\r
 }\r
index 3dd09ef..f2af670 100644 (file)
@@ -36,80 +36,112 @@ import compbio.metadata.AllTestSuit;
 \r
 public class SequenceUtilTester {\r
 \r
 \r
 public class SequenceUtilTester {\r
 \r
-       @Test()\r
-       public void testisNonAmbNucleotideSequence() {\r
-               String dnaseq = "atgatTGACGCTGCTGatgtcgtgagtgga";\r
-               assertTrue(SequenceUtil.isNonAmbNucleotideSequence(dnaseq));\r
-               String dirtyDnaseq = "atgAGTggt\taGGTgc\ncgcACTgc gACtcgcGAt cgA ";\r
-               assertTrue(SequenceUtil.isNonAmbNucleotideSequence(dirtyDnaseq));\r
-               String nonDna = "atgfctgatgcatgcatgatgctga";\r
-               assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
-\r
-               nonDna = "atgc1tgatgcatgcatgatgctga";\r
-               assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
-\r
-               nonDna = "ARLGRVRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQL";\r
-               assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
-               // String ambDna = "AGTCRYMKSWHBVDN"; // see IUPAC Nucleotide Code\r
-               assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
-\r
-       }\r
-\r
-       @Test()\r
-       public void testCleanSequence() {\r
-               String dirtySeq = "atgAGTggt\taGGTgc\ncgcAC\rTgc gACtcgcGAt cgA ";\r
-               assertEquals("atgAGTggtaGGTgccgcACTgcgACtcgcGAtcgA".toUpperCase(),\r
-                               SequenceUtil.cleanSequence(dirtySeq));\r
-       }\r
-\r
-       @Test()\r
-       public void testDeepCleanSequence() {\r
-               String dirtySeq = "a!t?g.A;GTggt\ta12GGTgc\ncgc23AC\rTgc gAC<>.,?!|\\|/t@cg-c¬GA=_+(0){]}[:£$&^*\"t cgA ";\r
-               assertEquals("atgAGTggtaGGTgccgcACTgcgACtcgcGAtcgA".toUpperCase(),\r
-                               SequenceUtil.deepCleanSequence(dirtySeq));\r
+    @Test()\r
+    public void testisNonAmbNucleotideSequence() {\r
+       String dnaseq = "atgatTGACGCTGCTGatgtcgtgagtgga";\r
+       assertTrue(SequenceUtil.isNonAmbNucleotideSequence(dnaseq));\r
+       String dirtyDnaseq = "atgAGTggt\taGGTgc\ncgcACTgc gACtcgcGAt cgA ";\r
+       assertTrue(SequenceUtil.isNonAmbNucleotideSequence(dirtyDnaseq));\r
+       String nonDna = "atgfctgatgcatgcatgatgctga";\r
+       assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
+\r
+       nonDna = "atgc1tgatgcatgcatgatgctga";\r
+       assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
+\r
+       nonDna = "ARLGRVRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQL";\r
+       assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
+       // String ambDna = "AGTCRYMKSWHBVDN"; // see IUPAC Nucleotide Code\r
+       assertFalse(SequenceUtil.isNonAmbNucleotideSequence(nonDna));\r
+\r
+    }\r
+\r
+    @Test()\r
+    public void testCleanSequence() {\r
+       String dirtySeq = "atgAGTggt\taGGTgc\ncgcAC\rTgc gACtcgcGAt cgA ";\r
+       assertEquals("atgAGTggtaGGTgccgcACTgcgACtcgcGAtcgA".toUpperCase(),\r
+               SequenceUtil.cleanSequence(dirtySeq));\r
+    }\r
+\r
+    @Test()\r
+    public void testDeepCleanSequence() {\r
+       String dirtySeq = "a!t?g.A;GTggt\ta12GGTgc\ncgc23AC\rTgc gAC<>.,?!|\\|/t@cg-c¬GA=_+(0){]}[:£$&^*\"t cgA ";\r
+       assertEquals("atgAGTggtaGGTgccgcACTgcgACtcgcGAtcgA".toUpperCase(),\r
+               SequenceUtil.deepCleanSequence(dirtySeq));\r
+    }\r
+\r
+    @Test()\r
+    public void testisProteinSequence() {\r
+       String dirtySeq = "atgAGTggt\taGGTgc\ncgcAC\rTgc gACtcgcGAt cgA ";\r
+       assertFalse(SequenceUtil.isProteinSequence(dirtySeq));\r
+       String notaSeq = "atgc1tgatgcatgcatgatgctga";\r
+       assertFalse(SequenceUtil.isProteinSequence(notaSeq));\r
+       String AAseq = "ARLGRVRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQL";\r
+       assertTrue(SequenceUtil.isProteinSequence(AAseq));\r
+       AAseq += "XU";\r
+       assertFalse(SequenceUtil.isProteinSequence(AAseq));\r
+\r
+    }\r
+\r
+    @Test()\r
+    public void testReadWriteFasta() {\r
+\r
+       try {\r
+           FileInputStream fio = new FileInputStream(\r
+                   AllTestSuit.TEST_DATA_PATH + "TO1381.fasta");\r
+           assertNotNull(fio);\r
+           List<FastaSequence> fseqs = SequenceUtil.readFasta(fio);\r
+           assertNotNull(fseqs);\r
+           assertEquals(3, fseqs.size());\r
+           assertEquals(3, fseqs.size());\r
+           fio.close();\r
+           FileOutputStream fou = new FileOutputStream(\r
+                   AllTestSuit.TEST_DATA_PATH + "TO1381.fasta.written");\r
+           SequenceUtil.writeFasta(fou, fseqs);\r
+           fou.close();\r
+           FileOutputStream fou20 = new FileOutputStream(\r
+                   AllTestSuit.TEST_DATA_PATH + "TO1381.fasta20.written");\r
+           SequenceUtil.writeFasta(fou20, fseqs, 20);\r
+           fou20.close();\r
+\r
+       } catch (FileNotFoundException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (IOException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
        }\r
        }\r
-\r
-       @Test()\r
-       public void testisProteinSequence() {\r
-               String dirtySeq = "atgAGTggt\taGGTgc\ncgcAC\rTgc gACtcgcGAt cgA ";\r
-               assertFalse(SequenceUtil.isProteinSequence(dirtySeq));\r
-               String notaSeq = "atgc1tgatgcatgcatgatgctga";\r
-               assertFalse(SequenceUtil.isProteinSequence(notaSeq));\r
-               String AAseq = "ARLGRVRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQL";\r
-               assertTrue(SequenceUtil.isProteinSequence(AAseq));\r
-               AAseq += "XU";\r
-               assertFalse(SequenceUtil.isProteinSequence(AAseq));\r
-\r
+    }\r
+\r
+    /**\r
+     * This test tests the loading of horizontally formatted Jronn output file\r
+     */\r
+    @Test\r
+    public void loadJronnFile() {\r
+\r
+       FileInputStream fio;\r
+       try {\r
+           fio = new FileInputStream(AllTestSuit.TEST_DATA_PATH + "jronn.out");\r
+           List<AnnotatedSequence> aseqs = SequenceUtil.readJRonn(fio);\r
+           assertNotNull(aseqs);\r
+           assertEquals(aseqs.size(), 3);\r
+           AnnotatedSequence aseq = aseqs.get(0);\r
+           assertNotNull(aseq);\r
+           assertNotNull(aseq.getAnnotation());\r
+           //System.out.println(aseq);\r
+           assertEquals(aseq.getAnnotation().length, aseq.getSequence()\r
+                   .length());\r
+           fio.close();\r
+       } catch (FileNotFoundException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (IOException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (UnknownFileFormatException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
        }\r
 \r
        }\r
 \r
-       @Test()\r
-       public void testReadWriteFasta() {\r
-\r
-               try {\r
-                       FileInputStream fio = new FileInputStream(\r
-                                       AllTestSuit.TEST_DATA_PATH + "TO1381.fasta");\r
-                       assertNotNull(fio);\r
-                       List<FastaSequence> fseqs = SequenceUtil.readFasta(fio);\r
-                       assertNotNull(fseqs);\r
-                       assertEquals(3, fseqs.size());\r
-                       assertEquals(3, fseqs.size());\r
-                       fio.close();\r
-                       FileOutputStream fou = new FileOutputStream(\r
-                                       AllTestSuit.TEST_DATA_PATH + "TO1381.fasta.written");\r
-                       SequenceUtil.writeFasta(fou, fseqs);\r
-                       fou.close();\r
-                       FileOutputStream fou20 = new FileOutputStream(\r
-                                       AllTestSuit.TEST_DATA_PATH + "TO1381.fasta20.written");\r
-                       SequenceUtil.writeFasta(fou20, fseqs, 20);\r
-                       fou20.close();\r
-\r
-               } catch (FileNotFoundException e) {\r
-                       e.printStackTrace();\r
-                       fail(e.getLocalizedMessage());\r
-               } catch (IOException e) {\r
-                       e.printStackTrace();\r
-                       fail(e.getLocalizedMessage());\r
-               }\r
-       }\r
+    }\r
 \r
 }\r
 \r
 }\r
diff --git a/testsrc/compbio/runner/disorder/JronnTester.java b/testsrc/compbio/runner/disorder/JronnTester.java
new file mode 100644 (file)
index 0000000..ba0b171
--- /dev/null
@@ -0,0 +1,332 @@
+/* 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
+\r
+package compbio.runner.disorder;\r
+\r
+import static org.testng.Assert.assertEquals;\r
+import static org.testng.Assert.assertFalse;\r
+import static org.testng.Assert.assertNotNull;\r
+import static org.testng.Assert.assertTrue;\r
+import static org.testng.Assert.fail;\r
+\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileNotFoundException;\r
+import java.io.IOException;\r
+import java.text.ParseException;\r
+import java.util.List;\r
+\r
+import javax.xml.bind.ValidationException;\r
+\r
+import org.ggf.drmaa.DrmaaException;\r
+import org.ggf.drmaa.JobInfo;\r
+import org.testng.annotations.BeforeMethod;\r
+import org.testng.annotations.Test;\r
+\r
+import compbio.data.sequence.AnnotatedSequence;\r
+import compbio.engine.AsyncExecutor;\r
+import compbio.engine.Configurator;\r
+import compbio.engine.FilePuller;\r
+import compbio.engine.SyncExecutor;\r
+import compbio.engine.client.ConfExecutable;\r
+import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.engine.client.Executable;\r
+import compbio.engine.client.RunConfiguration;\r
+import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.JobRunner;\r
+import compbio.engine.cluster.drmaa.StatisticManager;\r
+import compbio.engine.local.LocalRunner;\r
+import compbio.metadata.AllTestSuit;\r
+import compbio.metadata.ChunkHolder;\r
+import compbio.metadata.JobExecutionException;\r
+import compbio.metadata.JobStatus;\r
+import compbio.metadata.JobSubmissionException;\r
+import compbio.metadata.LimitsManager;\r
+import compbio.metadata.PresetManager;\r
+import compbio.metadata.ResultNotAvailableException;\r
+import compbio.metadata.RunnerConfig;\r
+import compbio.util.FileWatcher;\r
+import compbio.util.SysPrefs;\r
+\r
+public class JronnTester {\r
+\r
+    public static String test_outfile = "TO1381.jronn.out"; // "/homes/pvtroshin/TO1381.clustal.cluster.out\r
+\r
+    private Jronn jronn;\r
+\r
+    @BeforeMethod(alwaysRun = true)\r
+    void init() {\r
+       jronn = new Jronn();\r
+       jronn.setInput(AllTestSuit.test_input).setOutput(test_outfile);\r
+    }\r
+\r
+    @Test(groups = { AllTestSuit.test_group_cluster,\r
+           AllTestSuit.test_group_runner })\r
+    public void testRunOnCluster() {\r
+       assertFalse(SysPrefs.isWindows,\r
+               "Cluster execution can only be in unix environment");\r
+       try {\r
+           ConfiguredExecutable<Jronn> confJronn = Configurator\r
+                   .configureExecutable(jronn, Executable.ExecProvider.Cluster);\r
+           JobRunner runner = JobRunner.getInstance(confJronn);\r
+\r
+           assertNotNull(runner, "Runner is NULL");\r
+           runner.executeJob();\r
+           // assertNotNull("JobId is null", jobId1);\r
+           JobStatus status = runner.getJobStatus();\r
+           assertTrue(status == JobStatus.PENDING\r
+                   || status == JobStatus.RUNNING,\r
+                   "Status of the process is wrong!");\r
+           JobInfo info = runner.getJobInfo();\r
+           assertNotNull(info, "JobInfo is null");\r
+           StatisticManager sm = new StatisticManager(info);\r
+           assertNotNull(sm, "Statictic manager is null");\r
+           try {\r
+\r
+               String exits = sm.getExitStatus();\r
+               assertNotNull("Exit status is null", exits);\r
+               // cut 4 trailing zeros from the number\r
+               int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+                       .intValue();\r
+               assertEquals(0, exitsInt);\r
+               System.out.println(sm.getAllStats());\r
+\r
+           } catch (ParseException e) {\r
+               e.printStackTrace();\r
+               fail("Parse Exception: " + e.getMessage());\r
+           }\r
+           assertFalse(runner.cleanup());\r
+           assertTrue(sm.hasExited());\r
+           assertFalse(sm.wasAborted());\r
+           assertFalse(sm.hasDump());\r
+           assertFalse(sm.hasSignaled());\r
+\r
+       } catch (JobSubmissionException e) {\r
+           e.printStackTrace();\r
+           fail("DrmaaException caught:" + e.getMessage());\r
+       } catch (JobExecutionException e) {\r
+           e.printStackTrace();\r
+           fail("DrmaaException caught:" + e.getMessage());\r
+       } catch (DrmaaException e) {\r
+           e.printStackTrace();\r
+           fail("DrmaaException caught:" + e.getMessage());\r
+       }\r
+    }\r
+\r
+    /**\r
+     * This tests fails from time to time depending on the cluster load or some\r
+     * other factors. Any client code has to adjust for this issue\r
+     */\r
+    @Test(enabled = false, groups = { AllTestSuit.test_group_cluster,\r
+           AllTestSuit.test_group_runner })\r
+    public void testRunOnClusterAsync() {\r
+       assertFalse(SysPrefs.isWindows,\r
+               "Cluster execution can only be in unix environment");\r
+       try {\r
+           ConfiguredExecutable<Jronn> confJronn = Configurator\r
+                   .configureExecutable(jronn, Executable.ExecProvider.Cluster);\r
+           AsyncExecutor aengine = Configurator.getAsyncEngine(confJronn);\r
+           String jobId = aengine.submitJob(confJronn);\r
+           assertNotNull(jobId, "Runner is NULL");\r
+           // let drmaa to start\r
+           Thread.sleep(500);\r
+           JobStatus status = aengine.getJobStatus(jobId);\r
+           while (status != JobStatus.FINISHED\r
+                   || status != JobStatus.UNDEFINED) {\r
+               System.out.println("Job Status: " + status);\r
+               Thread.sleep(1000);\r
+               status = aengine.getJobStatus(jobId);\r
+           }\r
+       } catch (JobSubmissionException e) {\r
+           e.printStackTrace();\r
+           fail("DrmaaException caught:" + e.getMessage());\r
+       } catch (InterruptedException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       }\r
+    }\r
+\r
+    @Test(groups = { AllTestSuit.test_group_runner })\r
+    public void testRunLocally() {\r
+       try {\r
+           ConfiguredExecutable<Jronn> confJronn = Configurator\r
+                   .configureExecutable(jronn, Executable.ExecProvider.Local);\r
+\r
+           // For local execution use relative\r
+           LocalRunner lr = new LocalRunner(confJronn);\r
+           lr.executeJob();\r
+           ConfiguredExecutable<?> al1 = lr.waitForResult();\r
+           assertNotNull(al1.getResults());\r
+           List<AnnotatedSequence> al2 = confJronn.getResults();\r
+           assertNotNull(al2);\r
+           assertEquals(al2.size(), 3);\r
+           assertEquals(al1.getResults(), al2);\r
+       } catch (JobSubmissionException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (ResultNotAvailableException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (JobExecutionException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       }\r
+    }\r
+\r
+    @Test(groups = { AllTestSuit.test_group_runner })\r
+    public void readStatistics() {\r
+       try {\r
+           ConfiguredExecutable<Jronn> confJronn = Configurator\r
+                   .configureExecutable(jronn, Executable.ExecProvider.Local);\r
+           // For local execution use relavive\r
+\r
+           AsyncExecutor sexec = Configurator.getAsyncEngine(confJronn);\r
+           String jobId = sexec.submitJob(confJronn);\r
+           FilePuller fw = FilePuller.newFilePuller(confJronn\r
+                   .getWorkDirectory()\r
+                   + File.separator + Jronn.getStatFile(),\r
+                   FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
+           int count = 0;\r
+           long position = 0;\r
+           fw.waitForFile(4);\r
+           while (!(sexec.getJobStatus(jobId) == JobStatus.FINISHED\r
+                   || sexec.getJobStatus(jobId) == JobStatus.FAILED || sexec\r
+                   .getJobStatus(jobId) == JobStatus.UNDEFINED)\r
+                   || fw.hasMoreData()) {\r
+               ChunkHolder ch = fw.pull(position);\r
+               String chunk = ch.getChunk();\r
+               position = ch.getNextPosition();\r
+               System.out.print(chunk);\r
+               count++;\r
+           }\r
+           assertTrue(count > 1);\r
+           ConfiguredExecutable<?> al = sexec.getResults(jobId);\r
+           assertNotNull(al.getResults());\r
+       } catch (JobSubmissionException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       } catch (ResultNotAvailableException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       } catch (IOException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       }\r
+    }\r
+\r
+    @Test(groups = { AllTestSuit.test_group_runner })\r
+    public void testPersistance() {\r
+       try {\r
+           Jronn jronn = new Jronn();\r
+           jronn.setError("errrr.txt").setInput(AllTestSuit.test_input)\r
+                   .setOutput("outtt.txt");\r
+           assertEquals(jronn.getInput(), AllTestSuit.test_input);\r
+           assertEquals(jronn.getError(), "errrr.txt");\r
+           assertEquals(jronn.getOutput(), "outtt.txt");\r
+           ConfiguredExecutable<Jronn> cJronn = Configurator\r
+                   .configureExecutable(jronn, Executable.ExecProvider.Local);\r
+\r
+           SyncExecutor sexec = Configurator.getSyncEngine(cJronn);\r
+           sexec.executeJob();\r
+           ConfiguredExecutable<?> al = sexec.waitForResult();\r
+           assertNotNull(al.getResults());\r
+           // Save run configuration\r
+           assertTrue(cJronn.saveRunConfiguration());\r
+\r
+           // See if loaded configuration is the same as saved\r
+           RunConfiguration loadedRun = RunConfiguration\r
+                   .load(new FileInputStream(new File(cJronn\r
+                           .getWorkDirectory(), RunConfiguration.rconfigFile)));\r
+           assertEquals(\r
+                   ((ConfExecutable<Jronn>) cJronn).getRunConfiguration(),\r
+                   loadedRun);\r
+           // Load run configuration as ConfExecutable\r
+           ConfiguredExecutable<Jronn> resurrectedCMuscle = (ConfiguredExecutable<Jronn>) cJronn\r
+                   .loadRunConfiguration(new FileInputStream(new File(cJronn\r
+                           .getWorkDirectory(), RunConfiguration.rconfigFile)));\r
+           assertNotNull(resurrectedCMuscle);\r
+           assertEquals(resurrectedCMuscle.getExecutable().getInput(),\r
+                   AllTestSuit.test_input);\r
+           assertEquals(resurrectedCMuscle.getExecutable().getError(),\r
+                   "errrr.txt");\r
+           assertEquals(resurrectedCMuscle.getExecutable().getOutput(),\r
+                   "outtt.txt");\r
+           // See in details whether executables are the same\r
+           assertEquals(resurrectedCMuscle.getExecutable(), jronn);\r
+\r
+           ConfiguredExecutable<Jronn> resJronn = Configurator\r
+                   .configureExecutable(resurrectedCMuscle.getExecutable(),\r
+                           Executable.ExecProvider.Local);\r
+\r
+           sexec = Configurator.getSyncEngine(resJronn,\r
+                   Executable.ExecProvider.Local);\r
+           sexec.executeJob();\r
+           al = sexec.waitForResult();\r
+           assertNotNull(al);\r
+\r
+       } catch (JobSubmissionException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       } catch (JobExecutionException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       } catch (FileNotFoundException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       } catch (IOException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       } catch (ResultNotAvailableException e) {\r
+           e.printStackTrace();\r
+           fail(e.getMessage());\r
+       }\r
+    }\r
+\r
+    @Test(groups = { AllTestSuit.test_group_runner })\r
+    public void testConfigurationLoading() {\r
+       try {\r
+           RunnerConfig<Jronn> jronnConfig = ConfExecutable\r
+                   .getRunnerOptions(Jronn.class);\r
+           assertNotNull(jronnConfig);\r
+           assertTrue(jronnConfig.getArguments().size() > 0);\r
+\r
+           PresetManager<Jronn> jronnPresets = ConfExecutable\r
+                   .getRunnerPresets(Jronn.class);\r
+           assertNotNull(jronnPresets);\r
+           assertTrue(jronnPresets.getPresets().size() > 0);\r
+           jronnPresets.validate(jronnConfig);\r
+\r
+           LimitsManager<Jronn> jronnLimits = ConfExecutable\r
+                   .getRunnerLimits(Jronn.class);\r
+           assertNotNull(jronnLimits);\r
+           assertTrue(jronnLimits.getLimits().size() > 0);\r
+           jronnLimits.validate(jronnPresets);\r
+\r
+       } catch (FileNotFoundException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (IOException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       } catch (ValidationException e) {\r
+           e.printStackTrace();\r
+           fail(e.getLocalizedMessage());\r
+       }\r
+    }\r
+\r
+}\r
diff --git a/testsrc/testdata/jronn.out b/testsrc/testdata/jronn.out
new file mode 100644 (file)
index 0000000..2752911
--- /dev/null
@@ -0,0 +1,13 @@
+\r
+>Foobar_dundeefriends\r
+M      T       A       D       G       P       R       E       L       L       Q       L       R       A       A       V       R       H       R       P       Q       D       F       V       A       W       L       M       L       A       D       A       E       L       G       M       G       D       T       T       A       G       E       M       A       V       Q       R       G       L       A       L       H       P       G       H       P       E       A       V       A       R       L       G       R       V       R       W       T       Q       Q       R       H       A       E       A       A       V       L       L       Q       Q       A       S       D       A       A       P       E       H       P       G       I       A       L       W       L       G       H       A       L       E       D       A       G       Q       A       E       A       A       A       A       A       Y       T       R       A       H       Q       L       L       P       E       E       P       Y       I       T       A       Q       L       L       N       W       R       R       R       L       C       D       W       R       A       L       D       V       L       S       A       Q       V       R       A       A       V       A       Q       G       V       G       A       V       E       P       F       A       F       L       S       E       D       A       S       A       A       E       Q       L       A       C       A       R       T       R       A       Q       A       I       A       A       S       V       R       P       L       A       P       T       R       V       R       S       K       G       P       L       R       V       G       F       V       S       N       G       F       G       A       H       P       T       G       L       L       T       V       A       L       F       E       A       L       Q       R       R       Q       P       D       L       Q       M       H       L       F       A       T       S       G       D       D       G       S       T       L       R       T       R       L       A       Q       A       S       T       L       H       D       V       T       A       L       G       H       L       A       T       A       K       H       I       R       H       H       G       I       D       L       L       F       D       L       R       G       W       G       G       G       G       R       P       E       V       F       A       L       R       P       A       P       V       Q       V       N       W       L       A       Y       P       G       T       S       G       A       P       W       M       D       Y       V       L       G       D       A       F       A       L       P       P       A       L       E       P       F       Y       S       E       H       V       L       R       L       Q       G       A       F       Q       P       S       D       T       S       R       V       V       A       E       P       P       S       R       T       Q       C       G       L       P       E       Q       G       V       V       L       C       C       F       N       N       S       Y       K       L       N       P       Q       S       M       A       R       M       L       A       V       L       R       E       V       P       D       S       V       L       W       L       L       S       G       P       G       E       A       D       A       R       L       R       A       F       A       H       A       Q       G       V       D       A       Q       R       L       V       F       M       P       K       L       P       H       P       Q       Y       L       A       R       Y       R       H       A       D       L       F       L       D       T       H       P       Y       N       A       H       T       T       A       S       D       A       L       W       T       G       C       P       V       L       T       T       P       G       E       T       F       A       A       R       V       A       G       S       L       N       H       H       L       G       L       D       E       M       N       V       A       D       D       A       A       F       V       A       K       A       V       A       L       A       S       D       P       A       A       L       T       A       L       H       A       R       V       D       V       L       R       R       E       S       G       V       F       E       M       D       G       F       A       D       D       F       G       A       L       L       Q       A       L       A       R       R       H       G       W       L       G       I       \r
+0.39   0.42    0.46    0.45    0.44    0.42    0.41    0.4     0.4     0.39    0.37    0.37    0.37    0.37    0.38    0.38    0.38    0.38    0.38    0.37    0.36    0.35    0.35    0.34    0.35    0.36    0.37    0.37    0.38    0.41    0.43    0.44    0.45    0.45    0.46    0.46    0.46    0.46    0.47    0.49    0.51    0.51    0.52    0.52    0.52    0.52    0.52    0.51    0.5     0.48    0.49    0.48    0.49    0.48    0.48    0.49    0.5     0.49    0.49    0.47    0.46    0.45    0.45    0.45    0.44    0.43    0.44    0.44    0.46    0.47    0.49    0.49    0.5     0.52    0.52    0.51    0.5     0.49    0.49    0.5     0.52    0.53    0.53    0.55    0.54    0.54    0.53    0.51    0.48    0.46    0.45    0.43    0.41    0.4     0.4     0.4     0.42    0.43    0.43    0.43    0.44    0.44    0.44    0.46    0.46    0.46    0.46    0.47    0.47    0.47    0.47    0.48    0.48    0.48    0.48    0.46    0.45    0.44    0.42    0.39    0.37    0.35    0.32    0.31    0.3     0.28    0.26    0.26    0.25    0.24    0.23    0.23    0.23    0.23    0.24    0.24    0.25    0.26    0.27    0.29    0.3     0.32    0.34    0.34    0.36    0.37    0.38    0.4     0.41    0.42    0.42    0.42    0.42    0.42    0.42    0.43    0.43    0.44    0.44    0.45    0.45    0.45    0.46    0.46    0.47    0.48    0.48    0.5     0.51    0.53    0.54    0.56    0.57    0.57    0.58    0.58    0.58    0.57    0.58    0.58    0.59    0.59    0.59    0.59    0.59    0.59    0.59    0.58    0.59    0.59    0.6     0.6     0.59    0.59    0.59    0.6     0.6     0.6     0.59    0.58    0.58    0.59    0.59    0.58    0.57    0.55    0.53    0.51    0.49    0.45    0.43    0.42    0.4     0.38    0.36    0.34    0.33    0.34    0.34    0.33    0.32    0.3     0.29    0.29    0.28    0.29    0.29    0.29    0.3     0.32    0.34    0.36    0.38    0.41    0.42    0.43    0.43    0.44    0.45    0.46    0.48    0.49    0.52    0.55    0.58    0.58    0.59    0.58    0.58    0.58    0.57    0.56    0.55    0.56    0.55    0.54    0.53    0.52    0.51    0.5     0.49    0.47    0.45    0.44    0.45    0.45    0.46    0.46    0.45    0.45    0.44    0.44    0.44    0.44    0.45    0.45    0.45    0.44    0.44    0.44    0.44    0.43    0.42    0.4     0.39    0.38    0.37    0.38    0.38    0.38    0.37    0.36    0.37    0.36    0.36    0.36    0.37    0.37    0.37    0.36    0.36    0.37    0.38    0.39    0.39    0.4     0.4     0.4     0.39    0.38    0.38    0.36    0.35    0.34    0.34    0.33    0.33    0.33    0.33    0.32    0.31    0.31    0.3     0.3     0.3     0.3     0.3     0.3     0.31    0.32    0.33    0.34    0.35    0.36    0.37    0.37    0.37    0.38    0.4     0.42    0.42    0.43    0.44    0.44    0.44    0.44    0.45    0.46    0.47    0.49    0.5     0.52    0.52    0.54    0.56    0.58    0.6     0.62    0.63    0.63    0.63    0.64    0.65    0.65    0.65    0.64    0.62    0.59    0.57    0.54    0.51    0.49    0.46    0.44    0.41    0.39    0.37    0.35    0.32    0.31    0.29    0.27    0.26    0.28    0.29    0.29    0.3     0.3     0.3     0.3     0.3     0.31    0.3     0.3     0.3     0.3     0.29    0.29    0.29    0.3     0.3     0.3     0.28    0.27    0.27    0.28    0.28    0.28    0.29    0.3     0.31    0.33    0.34    0.35    0.36    0.37    0.39    0.39    0.39    0.39    0.38    0.38    0.39    0.38    0.38    0.38    0.39    0.4     0.39    0.38    0.38    0.38    0.37    0.36    0.35    0.33    0.34    0.34    0.35    0.35    0.35    0.35    0.34    0.34    0.34    0.32    0.3     0.31    0.31    0.31    0.31    0.32    0.33    0.32    0.33    0.32    0.32    0.32    0.34    0.34    0.35    0.36    0.37    0.38    0.4     0.42    0.43    0.44    0.44    0.45    0.44    0.44    0.45    0.46    0.47    0.47    0.47    0.47    0.46    0.48    0.48    0.49    0.48    0.48    0.45    0.43    0.41    0.39    0.38    0.38    0.38    0.39    0.39    0.38    0.38    0.37    0.36    0.36    0.34    0.33    0.33    0.34    0.34    0.36    0.38    0.39    0.4     0.41    0.42    0.42    0.41    0.41    0.42    0.43    0.44    0.44    0.45    0.45    0.44    0.43    0.42    0.41    0.4     0.39    0.37    0.36    0.36    0.35    0.35    0.34    0.33    0.32    0.32    0.32    0.32    0.33    0.33    0.33    0.32    0.31    0.3     0.29    0.29    0.29    0.3     0.3     0.29    0.28    0.27    0.26    0.26    0.25    0.25    0.23    0.21    0.21    0.2     0.21    0.22    0.22    0.23    0.24    0.23    0.2     0.18    0.16    0.15    0.15    \r
+>Foobar\r
+M      G       D       T       T       A       G       E       M       A       V       Q       R       G       L       A       L       H       Q       Q       R       H       A       E       A       A       V       L       L       Q       Q       A       S       D       A       A       P       E       H       P       G       I       A       L       W       L       H       A       L       E       D       A       G       Q       A       E       A       A       A       A       Y       T       R       A       H       Q       L       L       P       E       E       P       Y       I       T       A       Q       L       L       N       A       V       A       Q       G       V       G       A       V       E       P       F       A       F       L       S       E       D       A       S       A       A       E       S       V       R       P       L       A       P       T       R       V       R       S       K       G       P       L       R       V       G       F       V       S       N       G       F       G       A       H       P       T       G       L       L       T       V       A       L       F       E       A       L       Q       R       R       Q       P       D       L       Q       M       H       L       F       A       T       S       G       D       D       G       S       T       L       R       T       R       L       A       Q       A       S       T       L       H       D       V       T       A       L       G       H       L       A       T       A       K       H       I       R       H       H       G       I       D       L       L       F       D       L       R       G       W       G       G       G       G       R       P       E       V       F       A       L       R       P       A       P       V       Q       V       N       W       L       A       Y       P       G       T       S       G       A       P       W       M       D       Y       V       L       G       D       A       F       A       L       P       P       A       L       E       P       F       Y       S       E       H       V       L       R       L       Q       G       A       F       Q       P       S       D       T       S       R       V       V       A       E       P       P       S       R       T       Q       C       G       L       P       E       Q       G       V       V       L       C       C       F       N       N       S       Y       K       L       N       P       Q       S       M       A       R       M       L       A       V       L       R       E       V       P       D       S       V       L       W       L       L       S       G       P       G       E       A       D       A       R       L       R       A       F       A       H       A       Q       G       V       D       A       Q       R       L       V       F       M       P       K       L       P       H       P       Q       Y       L       A       R       Y       R       H       A       D       L       F       L       D       T       H       P       Y       N       A       H       T       T       A       S       D       A       L       W       T       G       C       P       V       L       T       T       P       G       E       T       F       A       A       R       V       A       G       S       L       N       H       H       L       G       L       D       E       M       N       V       A       D       D       A       A       F       V       A       K       A       V       A       L       A       S       D       P       A       A       L       T       A       L       H       A       R       V       D       V       L       R       R       E       S       G       V       F       E       M       D       G       F       A       D       D       F       G       A       L       L       Q       A       L       A       R       R       H       G       W       L       G       I       \r
+0.48   0.42    0.42    0.48    0.52    0.53    0.54    0.53    0.52    0.5     0.49    0.49    0.49    0.48    0.47    0.47    0.47    0.49    0.51    0.53    0.54    0.55    0.55    0.54    0.53    0.52    0.51    0.5     0.51    0.52    0.51    0.51    0.52    0.52    0.52    0.51    0.5     0.48    0.45    0.45    0.43    0.43    0.42    0.42    0.43    0.45    0.47    0.47    0.47    0.47    0.47    0.46    0.47    0.47    0.49    0.48    0.47    0.47    0.47    0.47    0.46    0.46    0.46    0.45    0.44    0.42    0.41    0.41    0.41    0.41    0.4     0.4     0.39    0.39    0.4     0.4     0.39    0.38    0.38    0.38    0.38    0.38    0.38    0.38    0.39    0.41    0.42    0.42    0.43    0.44    0.44    0.44    0.46    0.46    0.48    0.5     0.52    0.55    0.57    0.59    0.6     0.61    0.62    0.63    0.63    0.63    0.63    0.63    0.64    0.64    0.64    0.63    0.62    0.61    0.61    0.61    0.59    0.57    0.55    0.53    0.51    0.49    0.45    0.43    0.42    0.4     0.38    0.36    0.34    0.33    0.34    0.34    0.33    0.32    0.3     0.29    0.29    0.28    0.29    0.29    0.29    0.3     0.32    0.34    0.36    0.38    0.41    0.42    0.43    0.43    0.44    0.45    0.46    0.48    0.49    0.52    0.55    0.58    0.58    0.59    0.58    0.58    0.58    0.57    0.56    0.55    0.56    0.55    0.54    0.53    0.52    0.51    0.5     0.49    0.47    0.45    0.44    0.45    0.45    0.46    0.46    0.45    0.45    0.44    0.44    0.44    0.44    0.45    0.45    0.45    0.44    0.44    0.44    0.44    0.43    0.42    0.4     0.39    0.38    0.37    0.38    0.38    0.38    0.37    0.36    0.37    0.36    0.36    0.36    0.37    0.37    0.37    0.36    0.36    0.37    0.38    0.39    0.39    0.4     0.4     0.4     0.39    0.38    0.38    0.36    0.35    0.34    0.34    0.33    0.33    0.33    0.33    0.32    0.31    0.31    0.3     0.3     0.3     0.3     0.3     0.3     0.31    0.32    0.33    0.34    0.35    0.36    0.37    0.37    0.37    0.38    0.4     0.42    0.42    0.43    0.44    0.44    0.44    0.44    0.45    0.46    0.47    0.49    0.5     0.52    0.52    0.54    0.56    0.58    0.6     0.62    0.63    0.63    0.63    0.64    0.65    0.65    0.65    0.64    0.62    0.59    0.57    0.54    0.51    0.49    0.46    0.44    0.41    0.39    0.37    0.35    0.32    0.31    0.29    0.27    0.26    0.28    0.29    0.29    0.3     0.3     0.3     0.3     0.3     0.31    0.3     0.3     0.3     0.3     0.29    0.29    0.29    0.3     0.3     0.3     0.28    0.27    0.27    0.28    0.28    0.28    0.29    0.3     0.31    0.33    0.34    0.35    0.36    0.37    0.39    0.39    0.39    0.39    0.38    0.38    0.39    0.38    0.38    0.38    0.39    0.4     0.39    0.38    0.38    0.38    0.37    0.36    0.35    0.33    0.34    0.34    0.35    0.35    0.35    0.35    0.34    0.34    0.34    0.32    0.3     0.31    0.31    0.31    0.31    0.32    0.33    0.32    0.33    0.32    0.32    0.32    0.34    0.34    0.35    0.36    0.37    0.38    0.4     0.42    0.43    0.44    0.44    0.45    0.44    0.44    0.45    0.46    0.47    0.47    0.47    0.47    0.46    0.48    0.48    0.49    0.48    0.48    0.45    0.43    0.41    0.39    0.38    0.38    0.38    0.39    0.39    0.38    0.38    0.37    0.36    0.36    0.34    0.33    0.33    0.34    0.34    0.36    0.38    0.39    0.4     0.41    0.42    0.42    0.41    0.41    0.42    0.43    0.44    0.44    0.45    0.45    0.44    0.43    0.42    0.41    0.4     0.39    0.37    0.36    0.36    0.35    0.35    0.34    0.33    0.32    0.32    0.32    0.32    0.33    0.33    0.33    0.32    0.31    0.3     0.29    0.29    0.29    0.3     0.3     0.29    0.28    0.27    0.26    0.26    0.25    0.25    0.23    0.21    0.21    0.2     0.21    0.22    0.22    0.23    0.24    0.23    0.2     0.18    0.16    0.15    0.15    \r
+\r
+\r
+>dundeefriends\r
+M      T       A       D       G       P       R       E       L       L       Q       L       R       A       A       V       R       H       R       P       Q       D       V       A       W       L       M       L       A       D       A       E       L       G       M       G       D       T       T       A       G       E       M       A       V       Q       R       G       L       A       L       H       P       G       H       P       E       A       V       A       R       L       G       R       V       R       W       T       Q       Q       R       H       A       E       A       A       V       L       L       Q       Q       A       S       D       A       A       P       E       H       P       G       I       A       L       W       L       G       H       A       L       E       D       H       Q       L       L       P       E       E       P       Y       I       T       A       Q       L       D       V       L       S       A       Q       V       R       A       A       V       A       Q       G       V       G       A       V       E       P       F       A       F       L       S       E       D       A       S       A       A       E       Q       L       A       C       A       R       T       R       A       Q       A       I       A       A       S       V       R       P       L       A       P       T       R       V       R       S       K       G       P       L       R       V       G       F       V       S       N       G       F       G       A       H       P       T       G       L       L       T       V       A       L       F       E       A       L       Q       R       R       Q       P       D       L       Q       M       H       L       F       A       T       S       G       D       D       G       S       T       L       R       T       R       L       A       Q       A       S       T       L       H       D       V       T       A       L       G       H       L       A       T       A       K       H       I       R       H       H       G       I       D       L       L       F       D       L       R       G       W       G       G       G       G       R       P       E       V       F       A       L       R       P       A       P       V       Q       V       N       W       L       A       Y       P       G       T       S       G       A       P       W       M       D       Y       V       L       G       D       A       F       A       L       P       P       A       L       E       P       F       Y       S       E       H       V       L       R       L       Q       G       A       F       Q       P       S       D       T       S       R       V       V       A       E       P       P       S       R       T       Q       C       G       L       P       E       Q       G       V       V       L       C       C       F       N       N       S       Y       K       L       N       P       Q       S       M       A       R       M       L       A       V       L       R       E       V       P       D       S       V       L       W       L       L       S       G       P       G       E       A       D       A       R       L       R       A       F       A       H       A       Q       G       V       D       A       Q       R       L       V       F       M       P       K       L       P       H       P       Q       Y       L       A       R       Y       R       H       A       D       L       F       L       D       T       H       P       Y       N       A       H       T       T       A       S       D       A       L       W       T       G       C       P       V       L       T       T       P       G       E       T       F       A       A       R       V       A       G       S       L       N       H       H       L       G       L       D       E       M       N       V       A       D       D       A       A       F       V       A       K       A       V       A       L       A       S       D       P       A       A       L       T       A       L       H       A       R       V       D       V       L       R       R       E       S       I       \r
+0.39   0.42    0.46    0.45    0.44    0.42    0.4     0.37    0.37    0.36    0.35    0.34    0.33    0.33    0.32    0.32    0.32    0.32    0.31    0.3     0.29    0.28    0.28    0.28    0.29    0.3     0.32    0.32    0.35    0.38    0.39    0.41    0.42    0.44    0.45    0.44    0.45    0.47    0.49    0.5     0.51    0.52    0.52    0.52    0.52    0.52    0.51    0.5     0.48    0.49    0.48    0.49    0.48    0.48    0.49    0.5     0.49    0.49    0.47    0.46    0.45    0.45    0.45    0.44    0.43    0.44    0.44    0.46    0.47    0.49    0.49    0.5     0.52    0.52    0.51    0.5     0.49    0.49    0.5     0.52    0.53    0.53    0.55    0.54    0.54    0.53    0.52    0.49    0.46    0.44    0.43    0.41    0.41    0.4     0.4     0.41    0.42    0.41    0.4     0.39    0.38    0.37    0.37    0.37    0.35    0.34    0.35    0.35    0.35    0.36    0.36    0.37    0.38    0.38    0.39    0.38    0.39    0.38    0.39    0.4     0.4     0.41    0.41    0.42    0.42    0.42    0.43    0.44    0.44    0.45    0.45    0.45    0.46    0.45    0.46    0.46    0.47    0.48    0.48    0.5     0.51    0.53    0.54    0.56    0.57    0.57    0.58    0.58    0.58    0.57    0.58    0.58    0.59    0.59    0.59    0.59    0.59    0.59    0.59    0.58    0.59    0.59    0.6     0.6     0.59    0.59    0.59    0.6     0.6     0.6     0.59    0.58    0.58    0.59    0.59    0.58    0.57    0.55    0.53    0.51    0.49    0.45    0.43    0.42    0.4     0.38    0.36    0.34    0.33    0.34    0.34    0.33    0.32    0.3     0.29    0.29    0.28    0.29    0.29    0.29    0.3     0.32    0.34    0.36    0.38    0.41    0.42    0.43    0.43    0.44    0.45    0.46    0.48    0.49    0.52    0.55    0.58    0.58    0.59    0.58    0.58    0.58    0.57    0.56    0.55    0.56    0.55    0.54    0.53    0.52    0.51    0.5     0.49    0.47    0.45    0.44    0.45    0.45    0.46    0.46    0.45    0.45    0.44    0.44    0.44    0.44    0.45    0.45    0.45    0.44    0.44    0.44    0.44    0.43    0.42    0.4     0.39    0.38    0.37    0.38    0.38    0.38    0.37    0.36    0.37    0.36    0.36    0.36    0.37    0.37    0.37    0.36    0.36    0.37    0.38    0.39    0.39    0.4     0.4     0.4     0.39    0.38    0.38    0.36    0.35    0.34    0.34    0.33    0.33    0.33    0.33    0.32    0.31    0.31    0.3     0.3     0.3     0.3     0.3     0.3     0.31    0.32    0.33    0.34    0.35    0.36    0.37    0.37    0.37    0.38    0.4     0.42    0.42    0.43    0.44    0.44    0.44    0.44    0.45    0.46    0.47    0.49    0.5     0.52    0.52    0.54    0.56    0.58    0.6     0.62    0.63    0.63    0.63    0.64    0.65    0.65    0.65    0.64    0.62    0.59    0.57    0.54    0.51    0.49    0.46    0.44    0.41    0.39    0.37    0.35    0.32    0.31    0.29    0.27    0.26    0.28    0.29    0.29    0.3     0.3     0.3     0.3     0.3     0.31    0.3     0.3     0.3     0.3     0.29    0.29    0.29    0.3     0.3     0.3     0.28    0.27    0.27    0.28    0.28    0.28    0.29    0.3     0.31    0.33    0.34    0.35    0.36    0.37    0.39    0.39    0.39    0.39    0.38    0.38    0.39    0.38    0.38    0.38    0.39    0.4     0.39    0.38    0.38    0.38    0.37    0.36    0.35    0.33    0.34    0.34    0.35    0.35    0.35    0.35    0.34    0.34    0.34    0.32    0.3     0.31    0.31    0.31    0.31    0.32    0.33    0.32    0.33    0.32    0.32    0.32    0.34    0.34    0.35    0.36    0.37    0.38    0.4     0.42    0.43    0.44    0.44    0.45    0.44    0.44    0.45    0.46    0.47    0.47    0.47    0.47    0.46    0.48    0.48    0.49    0.48    0.48    0.45    0.43    0.41    0.39    0.38    0.38    0.38    0.39    0.39    0.38    0.38    0.37    0.36    0.36    0.34    0.33    0.33    0.34    0.34    0.36    0.38    0.39    0.4     0.41    0.42    0.42    0.41    0.41    0.42    0.43    0.44    0.44    0.45    0.45    0.44    0.43    0.42    0.41    0.39    0.39    0.38    0.38    0.38    0.37    0.35    0.35    0.34    0.33    0.31    0.3     0.3     0.29    0.28    0.28    0.28    0.26    0.25    \r
+\r