From: Daniel Barton Date: Thu, 1 Aug 2013 16:29:20 +0000 (+0100) Subject: RNAalifold.java runner and RNAalifoldTester incomplete X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=48f5ddd853a8ec92d7444e8ee330121ffd33cda1;p=jabaws.git RNAalifold.java runner and RNAalifoldTester incomplete --- diff --git a/.gitignore b/.gitignore index 980cab6..b4de385 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 0000000..474da0d Binary files /dev/null and b/binaries/windows/ViennaRNA/RNAalifold.exe differ diff --git a/conf/Executable.properties b/conf/Executable.properties index 9e2ccb4..55ffc28 100644 --- a/conf/Executable.properties +++ b/conf/Executable.properties @@ -194,3 +194,8 @@ aacon.presets.file=conf/settings/AAConPresets.xml #aacon.cluster.cpunum=4 ## This reserves a slot with CPUNUM on the cluster for the task #aacon.cluster.settings=-q 64bit-pri.q -pe smp 4 -l ram=1700M -l h_cpu=24:00:00 + +##### RNAALIFOLD CONFIGURATION ###### +# just the windows binary at the moment +local.rnaalifold.bin.windows=binaries/windows/ViennaRNA/RNAalifold.exe + diff --git a/runner/compbio/runner/structure/RNAalifold.java b/runner/compbio/runner/structure/RNAalifold.java new file mode 100644 index 0000000..43a0975 --- /dev/null +++ b/runner/compbio/runner/structure/RNAalifold.java @@ -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 { + + @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 getType() { + return (Class) this.getClass(); + } + + +} diff --git a/testsrc/compbio/metadata/AllTestSuit.java b/testsrc/compbio/metadata/AllTestSuit.java index 3cef5ef..efbdcce 100644 --- a/testsrc/compbio/metadata/AllTestSuit.java +++ b/testsrc/compbio/metadata/AllTestSuit.java @@ -72,5 +72,7 @@ public class AllTestSuit { public static final String test_input_dna = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "3dnaseqs.fasta"; public static final String test_input_large = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "1000x3000Dna.fasta"; + + public static final String test_input_rna = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "unfolded_RF00031.aln"; } diff --git a/testsrc/compbio/runner/structure/RNAalifoldTester.java b/testsrc/compbio/runner/structure/RNAalifoldTester.java new file mode 100644 index 0000000..6a5056a --- /dev/null +++ b/testsrc/compbio/runner/structure/RNAalifoldTester.java @@ -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 confRNAalifold = Configurator + .configureExecutable(rnaalifold); + AsyncExecutor lr = new AsyncLocalRunner(); + lr.submitJob(confRNAalifold); + Thread.sleep(3000); + LocalExecutorService.shutDown(); + + } + +}