Mercurial > repos > ntino-krampis > viralcloud
comparison viral_assembly_annotation/VIGOR.py @ 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:beaf42837914 |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 """ | |
4 Runs VIGOR3 on given input fasta file. | |
5 """ | |
6 | |
7 import os, sys, subprocess, tempfile, shutil | |
8 | |
9 def __main__(): | |
10 # Parse the command line options | |
11 (inputFasta,outputALN,outputCDS,outputFS,outputPEP,outputRPT,outputSTATS,outputTBL) = sys.argv[1:] | |
12 | |
13 # Set up output variables | |
14 outputDir = "/usr/local/VIGOR/tools/vigor/test" | |
15 outputName = "output" | |
16 outputLog = "%s/%s_log.txt" % (outputDir,outputName) | |
17 vigorOutputALN = "%s/%s.aln" % (outputDir,outputName) | |
18 vigorOutputCDS = "%s/%s.cds" % (outputDir,outputName) | |
19 vigorOutputFS = "%s/%s.fs" % (outputDir,outputName) | |
20 vigorOutputPEP = "%s/%s.pep" % (outputDir,outputName) | |
21 vigorOutputRPT = "%s/%s.rpt" % (outputDir,outputName) | |
22 vigorOutputSTATS = "%s/%s.stats" % (outputDir,outputName) | |
23 vigorOutputTBL = "%s/%s.tbl" % (outputDir,outputName) | |
24 | |
25 # Create empty output log file (cannot be created by VIGOR command alone). | |
26 os.system("sudo touch %s" % outputLog) | |
27 os.system("sudo chmod 777 %s" % outputLog) | |
28 | |
29 # Run command | |
30 command = "/usr/local/VIGOR/tools/vigor/prod3/VIGOR3.pl -A -i %s -O %s/%s > %s" % (inputFasta,outputDir,outputName,outputLog) | |
31 os.system("sudo %s" % command) | |
32 os.system("sudo chmod 777 %s/%s.*" % (outputDir,outputName)) | |
33 os.system("sudo cp %s %s" % (vigorOutputALN,outputALN)) | |
34 os.system("sudo cp %s %s" % (vigorOutputCDS,outputCDS)) | |
35 os.system("sudo cp %s %s" % (vigorOutputFS,outputFS)) | |
36 os.system("sudo cp %s %s" % (vigorOutputPEP,outputPEP)) | |
37 os.system("sudo cp %s %s" % (vigorOutputRPT,outputRPT)) | |
38 os.system("sudo cp %s %s" % (vigorOutputSTATS,outputSTATS)) | |
39 os.system("sudo cp %s %s" % (vigorOutputTBL,outputTBL)) | |
40 | |
41 if __name__=="__main__": | |
42 __main__() |