RNAalifold.java runner and RNAalifoldTester incomplete
authorDaniel Barton <daluke.barton@gmail.com>
Thu, 1 Aug 2013 16:29:20 +0000 (17:29 +0100)
committerDaniel Barton <daluke.barton@gmail.com>
Thu, 1 Aug 2013 16:29:20 +0000 (17:29 +0100)
.gitignore
binaries/windows/ViennaRNA/RNAalifold.exe [new file with mode: 0644]
conf/Executable.properties
runner/compbio/runner/structure/RNAalifold.java [new file with mode: 0644]
testsrc/compbio/metadata/AllTestSuit.java
testsrc/compbio/runner/structure/RNAalifoldTester.java [new file with mode: 0644]

index 980cab6..b4de385 100644 (file)
@@ -2,4 +2,7 @@
 /web_site/full_javadoc
 /web_site/dm_javadoc
 
+# Daniel additions
+/jobsout
+
 
diff --git a/binaries/windows/ViennaRNA/RNAalifold.exe b/binaries/windows/ViennaRNA/RNAalifold.exe
new file mode 100644 (file)
index 0000000..474da0d
Binary files /dev/null and b/binaries/windows/ViennaRNA/RNAalifold.exe differ
index 9e2ccb4..55ffc28 100644 (file)
@@ -194,3 +194,8 @@ aacon.presets.file=conf/settings/AAConPresets.xml
 #aacon.cluster.cpunum=4\r
 ## This reserves a slot with CPUNUM on the cluster for the task\r
 #aacon.cluster.settings=-q 64bit-pri.q -pe smp 4 -l ram=1700M -l h_cpu=24:00:00\r
+\r
+#####                                  RNAALIFOLD CONFIGURATION                         ######\r
+# just the windows binary at the moment\r
+local.rnaalifold.bin.windows=binaries/windows/ViennaRNA/RNAalifold.exe\r
+\r
diff --git a/runner/compbio/runner/structure/RNAalifold.java b/runner/compbio/runner/structure/RNAalifold.java
new file mode 100644 (file)
index 0000000..43a0975
--- /dev/null
@@ -0,0 +1,60 @@
+package compbio.runner.structure;
+
+import java.util.Scanner; //temp
+import java.io.File; //temp
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import compbio.data.sequence.Alignment;
+import compbio.data.sequence.UnknownFileFormatException;
+import compbio.engine.client.SkeletalExecutable;
+import compbio.metadata.ResultNotAvailableException;
+import compbio.runner.Util;
+
+public class RNAalifold extends SkeletalExecutable<RNAalifold> {
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       //temp
+       public String getResults(String resultFile)
+                       throws ResultNotAvailableException {
+               Scanner s;
+               try {
+                       System.out.println("testfrom RNAalifold.getResults");
+                       s = new Scanner(new File(resultFile));
+                       System.out.println(s.nextLine());
+                       return "null";
+               } catch (FileNotFoundException e) {
+                       System.out.println("file not found");
+                       throw new ResultNotAvailableException(e);
+               } 
+       }
+
+       
+       @Override
+       public RNAalifold setOutput(String outFile) {
+               System.out.println("Set ouput file: " + outFile.toString());
+               super.setOutput(outFile);
+               return this;
+       }
+       
+       @Override
+       public RNAalifold setInput(String inFile) {
+               System.out.println("Set input file: " + inFile.toString());
+               super.setInput(inFile);
+               return this;
+       }
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       public Class<RNAalifold> getType() {
+               return (Class<RNAalifold>) this.getClass();
+       }
+       
+       
+}
index 3cef5ef..efbdcce 100644 (file)
@@ -72,5 +72,7 @@ public class AllTestSuit {
        public static final String test_input_dna = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "3dnaseqs.fasta";\r
 \r
        public static final String test_input_large = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "1000x3000Dna.fasta";\r
+       \r
+       public static final String test_input_rna = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "unfolded_RF00031.aln";\r
 \r
 }\r
diff --git a/testsrc/compbio/runner/structure/RNAalifoldTester.java b/testsrc/compbio/runner/structure/RNAalifoldTester.java
new file mode 100644 (file)
index 0000000..6a5056a
--- /dev/null
@@ -0,0 +1,74 @@
+package compbio.runner.structure;
+
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.text.ParseException;
+
+import javax.xml.bind.ValidationException;
+
+import org.ggf.drmaa.DrmaaException;
+import org.ggf.drmaa.JobInfo;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import compbio.data.sequence.Score;
+import compbio.data.sequence.ScoreManager;
+import compbio.data.sequence.ScoreManager.ScoreHolder;
+import compbio.data.sequence.SequenceUtil;
+import compbio.engine.AsyncExecutor;
+import compbio.engine.Configurator;
+import compbio.engine.SyncExecutor;
+import compbio.engine.client.ConfExecutable;
+import compbio.engine.client.ConfiguredExecutable;
+import compbio.engine.client.Executable;
+import compbio.engine.client.RunConfiguration;
+import compbio.engine.cluster.drmaa.ClusterUtil;
+import compbio.engine.cluster.drmaa.JobRunner;
+import compbio.engine.cluster.drmaa.StatisticManager;
+import compbio.engine.local.AsyncLocalRunner;
+import compbio.engine.local.LocalExecutorService;
+import compbio.engine.local.LocalRunner;
+import compbio.metadata.AllTestSuit;
+import compbio.metadata.JobExecutionException;
+import compbio.metadata.JobStatus;
+import compbio.metadata.JobSubmissionException;
+import compbio.metadata.LimitsManager;
+import compbio.metadata.PresetManager;
+import compbio.metadata.ResultNotAvailableException;
+import compbio.metadata.RunnerConfig;
+import compbio.runner.structure.RNAalifold;
+
+public class RNAalifoldTester {
+
+       private RNAalifold rnaalifold;
+       
+       public static String test_outfile = "rnaalifold.out";
+       
+       public static void main(String[] args) throws JobSubmissionException,
+                       JobExecutionException, InterruptedException {
+               
+               System.out.println("Run RNAalifold.main()");
+               
+               RNAalifold rnaalifold = new RNAalifold();
+               rnaalifold.setInput(AllTestSuit.test_input_rna).setOutput("test_outfile");
+               
+               ConfiguredExecutable<RNAalifold> confRNAalifold = Configurator
+                                       .configureExecutable(rnaalifold);
+               AsyncExecutor lr = new AsyncLocalRunner();
+               lr.submitJob(confRNAalifold);
+               Thread.sleep(3000);
+               LocalExecutorService.shutDown();
+               
+       }
+       
+}