changeset 0:beaf42837914 draft

viral cloud resource galaxy tool definitions initial commit
author ntino-krampis
date Thu, 31 Jan 2013 13:41:35 -0500
parents
children c81aa7ffced2
files viral_assembly_annotation/VIGOR.py viral_assembly_annotation/VIGOR.xml viral_assembly_annotation/viral_assembly.py viral_assembly_annotation/viral_assembly.xml
diffstat 4 files changed, 142 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/viral_assembly_annotation/VIGOR.py	Thu Jan 31 13:41:35 2013 -0500
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+"""
+Runs VIGOR3 on given input fasta file.
+"""
+
+import os, sys, subprocess, tempfile, shutil
+
+def __main__():
+	# Parse the command line options
+	(inputFasta,outputALN,outputCDS,outputFS,outputPEP,outputRPT,outputSTATS,outputTBL) = sys.argv[1:]
+	
+	# Set up output variables
+	outputDir = "/usr/local/VIGOR/tools/vigor/test"
+	outputName = "output"
+	outputLog = "%s/%s_log.txt"      % (outputDir,outputName)
+	vigorOutputALN = "%s/%s.aln"     % (outputDir,outputName)
+	vigorOutputCDS = "%s/%s.cds"     % (outputDir,outputName)
+	vigorOutputFS = "%s/%s.fs"       % (outputDir,outputName)
+	vigorOutputPEP = "%s/%s.pep"     % (outputDir,outputName)
+	vigorOutputRPT = "%s/%s.rpt"     % (outputDir,outputName)
+	vigorOutputSTATS = "%s/%s.stats" % (outputDir,outputName)
+	vigorOutputTBL = "%s/%s.tbl"     % (outputDir,outputName)
+	
+	# Create empty output log file (cannot be created by VIGOR command alone).
+	os.system("sudo touch %s" % outputLog)
+	os.system("sudo chmod 777 %s" % outputLog)
+	
+	# Run command
+	command = "/usr/local/VIGOR/tools/vigor/prod3/VIGOR3.pl -A -i %s -O %s/%s > %s" % (inputFasta,outputDir,outputName,outputLog)
+	os.system("sudo %s" % command)
+	os.system("sudo chmod 777 %s/%s.*" % (outputDir,outputName))
+	os.system("sudo cp %s %s" % (vigorOutputALN,outputALN))
+	os.system("sudo cp %s %s" % (vigorOutputCDS,outputCDS))
+	os.system("sudo cp %s %s" % (vigorOutputFS,outputFS))
+	os.system("sudo cp %s %s" % (vigorOutputPEP,outputPEP))
+	os.system("sudo cp %s %s" % (vigorOutputRPT,outputRPT))
+	os.system("sudo cp %s %s" % (vigorOutputSTATS,outputSTATS))
+	os.system("sudo cp %s %s" % (vigorOutputTBL,outputTBL))
+
+if __name__=="__main__": 
+	__main__()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/viral_assembly_annotation/VIGOR.xml	Thu Jan 31 13:41:35 2013 -0500
@@ -0,0 +1,24 @@
+<tool id="VIGOR" name="VIGOR" version="1.0.0">
+	<description>Run VIGOR</description>
+	<command interpreter="python">
+		VIGOR.py $input $outputALN $outputCDS $outputFS $outputPEP $outputRPT $outputSTATS $outputTBL
+	</command>
+	<inputs>
+		<param name="input" label="Input FASTA" type="data" format="fasta" />
+	</inputs>
+	<outputs>
+		<data format="txt" name="outputALN" label="ALN from ${tool.name} on ${on_string}" />
+		<data format="fasta" name="outputCDS" label="CDS from ${tool.name} on ${on_string}" />
+		<data format="txt" name="outputFS" label="FS from ${tool.name} on ${on_string}" />
+		<data format="fasta" name="outputPEP" label="PEP from ${tool.name} on ${on_string}" />
+		<data format="txt" name="outputRPT" label="RPT from ${tool.name} on ${on_string}" />
+		<data format="txt" name="outputSTATS" label="STATS from ${tool.name} on ${on_string}" />
+		<data format="txt" name="outputTBL" label="TBL from ${tool.name} on ${on_string}" />
+	</outputs>
+	
+	<help>
+**What it does**
+
+This tool runs VIGOR on the input set of fasta sequences.
+	</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/viral_assembly_annotation/viral_assembly.py	Thu Jan 31 13:41:35 2013 -0500
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+
+"""
+Takes input from viral_assembly.xml and sends it to vir-assembly-pipeline.sh.
+"""
+
+import os, sys, subprocess, tempfile, shutil
+
+def __prepare_input__(draftFilename,finalFilename,finalDir):
+	result = "%s/%s" % (finalDir,finalFilename)
+	
+	if draftFilename == "None":
+		os.system("sudo touch %s" % result)
+	else:
+		os.system("sudo cp %s %s" % (draftFilename,result))
+	
+	return result
+
+def __main__():
+	# Parse the command line options
+	(input_454,input_Sanger,input_Solexa,input_Solexa_tp,database,outputFasta) = sys.argv[1:]
+	
+	# Copy the input files to the VHTNGS location. If an input file was not given, create an empty dummy file as a replacement.
+	inputDir = "/usr/local/VHTNGS"
+	
+	input_454_ready = __prepare_input__(input_454,"input_454.sff",inputDir)
+	input_Sanger_ready = __prepare_input__(input_Sanger,"input_Sanger.fasta",inputDir)
+	input_Solexa_ready = __prepare_input__(input_Solexa,"input_Solexa.fastq",inputDir)
+	input_Solexa_tp_ready = __prepare_input__(input_Solexa_tp,"input_Solexa.fastq.trimpoints",inputDir)
+	
+	command = "/usr/local/VHTNGS/vir-assembly-pipeline.sh %s %s %s %s %s" % (input_454_ready,input_Sanger_ready,input_Solexa_ready,input_Solexa_tp_ready,database)
+	virAssemblyOutput = "/usr/local/VHTNGS/project/mapping/sample_hybrid_edited_refs_consensus.fasta"
+	os.system("sudo %s" % command)
+	os.system("sudo chmod 777 %s" % virAssemblyOutput)
+	os.system("sudo cp %s %s" % (virAssemblyOutput,outputFasta))
+
+if __name__=="__main__": 
+  __main__()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/viral_assembly_annotation/viral_assembly.xml	Thu Jan 31 13:41:35 2013 -0500
@@ -0,0 +1,38 @@
+<tool id="vir_assembly" name="Viral Assembly" version="1.0.0">
+  <description>Run Viral assembly</description>
+  <command interpreter="python">
+    viral_assembly.py $input_454 $input_Sanger $input_Solexa $input_Solexa_tp $database $output_Fasta
+  </command>
+  <inputs>
+    <param name="input_454" label="454 reads" type="data" format="sff" optional="true"/>
+	<param name="input_Sanger" label="Sanger reads" type="data" format="fasta" optional="true" />
+	<param name="input_Solexa" label="Solexa reads" type="data" format="fastq" optional="true"/>
+	<param name="input_Solexa_tp" label="Solexa trimpoints" type="data" format="tabular" optional="true"/>
+    <param name="database" label="Viral database" type="select">
+	  <option value="barda">barda</option>
+	  <option value="giv">giv</option>
+	  <option value="giv3">giv3</option>
+	  <option value="piv">piv</option>
+	  <option value="swiv">swiv</option>
+	  <option value="rtv">rtv</option>
+	  <option value="gcv">gcv</option>
+	  <option value="veev">veev</option>
+	  <option value="hadv">hadv</option>
+	  <option value="mpv">mpv</option>
+	  <option value="norv">norv</option>
+	  <option value="vzv">vzv</option>
+	  <option value="rsv">rsv</option>
+	  <option value="jev">jev</option>
+	  <option value="yfv">yfv</option>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="fasta" name="output_Fasta" label="${tool.name} on ${on_string}" />
+  </outputs>
+  <help>
+
+**What it does**
+
+This tool uses vir-assembly-pipeline.sh to run viral assembly and consensus sequence generation on the input sequence data.
+  </help>
+</tool>