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