1
|
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
|
4
|
29 FDR1 = sys.argv[2]
|
|
30 FDR2 = sys.argv[3]
|
|
31 spec_max = sys.argv[4]
|
|
32 os.rename(sys.argv[1], "saint_input.txt")
|
|
33 ins_path = sys.argv[9]
|
|
34
|
|
35
|
1
|
36 dirs_list = []
|
|
37 for (dirpath, dirnames, filename) in os.walk(str(ins_path)):
|
|
38 dirs_list.extend(dirnames)
|
|
39 break
|
|
40 if r"Dotplot_Release" in dirs_list:
|
|
41 pass
|
|
42 else:
|
|
43 cmd = r"tar -xvf /Dotplot_Release.tar.gz " + str(ins_path) + "/Dotplot_Release.tar.gz"
|
|
44 os.system(cmd)
|
|
45
|
|
46
|
|
47 cmd = (str(ins_path) + r"Dotplot_Release/dotplot.bash -f saint_input.txt" + r" -c b -s " + str(FDR1) +
|
|
48 r" -t " + str(FDR2) + " -m " + str(spec_max))
|
|
49 os.system(cmd)
|
|
50
|
|
51 cmd1 = r"cp -a ./Output_saint_input/. ."
|
|
52 os.system(cmd1)
|
|
53
|
|
54 os.rename("saint_input.txt", str(sys.argv[1]))
|
|
55 os.rename('dotplot.pdf', str(sys.argv[5]))
|
|
56 os.rename('bait2bait.pdf', str(sys.argv[6]))
|
|
57 os.rename('estimated.pdf', str(sys.argv[7]))
|
|
58 os.rename('stats.pdf', str(sys.argv[8]))
|