# HG changeset patch # User ntino-krampis # Date 1359657695 18000 # Node ID beaf42837914648feb7826b1b40c7a303cb65dab viral cloud resource galaxy tool definitions initial commit diff -r 000000000000 -r beaf42837914 viral_assembly_annotation/VIGOR.py --- /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__() diff -r 000000000000 -r beaf42837914 viral_assembly_annotation/VIGOR.xml --- /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 @@ + + Run VIGOR + + VIGOR.py $input $outputALN $outputCDS $outputFS $outputPEP $outputRPT $outputSTATS $outputTBL + + + + + + + + + + + + + + + +**What it does** + +This tool runs VIGOR on the input set of fasta sequences. + + diff -r 000000000000 -r beaf42837914 viral_assembly_annotation/viral_assembly.py --- /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__() diff -r 000000000000 -r beaf42837914 viral_assembly_annotation/viral_assembly.xml --- /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 @@ + + Run Viral assembly + + viral_assembly.py $input_454 $input_Sanger $input_Solexa $input_Solexa_tp $database $output_Fasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool uses vir-assembly-pipeline.sh to run viral assembly and consensus sequence generation on the input sequence data. + +