comparison dotplot_runner.py @ 1:7e98f893e9ae draft

Uploaded
author bornea
date Fri, 29 Jan 2016 09:57:31 -0500
parents
children a0b4bcf67972
comparison
equal deleted inserted replaced
0:dfa3436beb67 1:7e98f893e9ae
1 #######################################################################################
2 # Python-code: Dotplot Runner
3 # Author: Adam L Borne
4 # Contributers: Paul A Stewart, Brent Kuenzi
5 #######################################################################################
6 # This script runs the dotplot program found at http://prohitstools.mshri.on.ca/.
7 #######################################################################################
8 # Copyright (C) Adam Borne.
9 # Permission is granted to copy, distribute and/or modify this document
10 # under the terms of the GNU Free Documentation License, Version 1.3
11 # or any later version published by the Free Software Foundation;
12 # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
13 # A copy of the license is included in the section entitled "GNU
14 # Free Documentation License".
15 #######################################################################################
16 ## REQUIRED INPUT ##
17
18 # 1) list_file: SaintExpress output file.
19 # 2) FDR1: Primary false discovery rate. (default = 0.01)
20 # 3) FDR2: Secondary false discovery rate. (default = 0.025)
21 # 4) spec_max: Maximum spectral count. (default = 50)
22 #######################################################################################
23
24
25 import os
26 import sys
27
28
29 dirs_list = []
30 for (dirpath, dirnames, filename) in os.walk(str(ins_path)):
31 dirs_list.extend(dirnames)
32 break
33 if r"Dotplot_Release" in dirs_list:
34 pass
35 else:
36 cmd = r"tar -xvf /Dotplot_Release.tar.gz " + str(ins_path) + "/Dotplot_Release.tar.gz"
37 os.system(cmd)
38
39
40 FDR1 = sys.argv[2]
41 FDR2 = sys.argv[3]
42 spec_max = sys.argv[4]
43 os.rename(sys.argv[1], "saint_input.txt")
44 ins_path = sys.argv[9]
45
46 cmd = (str(ins_path) + r"Dotplot_Release/dotplot.bash -f saint_input.txt" + r" -c b -s " + str(FDR1) +
47 r" -t " + str(FDR2) + " -m " + str(spec_max))
48 os.system(cmd)
49
50 cmd1 = r"cp -a ./Output_saint_input/. ."
51 os.system(cmd1)
52
53 os.rename("saint_input.txt", str(sys.argv[1]))
54 os.rename('dotplot.pdf', str(sys.argv[5]))
55 os.rename('bait2bait.pdf', str(sys.argv[6]))
56 os.rename('estimated.pdf', str(sys.argv[7]))
57 os.rename('stats.pdf', str(sys.argv[8]))