23
|
1 #######################################################################################
|
|
2 # Python-code: Bubblebeam wrapper
|
|
3 # Author: Adam L Borne
|
|
4 # Contributers: Paul A Stewart, Brent Kuenzi
|
|
5 #######################################################################################
|
|
6 # This program runs the R script that generates a bubble plot. Python script simply
|
|
7 # handles arguments and interacts with Galaxy.
|
|
8 #######################################################################################
|
|
9 # Copyright (C) Adam Borne.
|
|
10 # Permission is granted to copy, distribute and/or modify this document
|
|
11 # under the terms of the GNU Free Documentation License, Version 1.3
|
|
12 # or any later version published by the Free Software Foundation;
|
|
13 # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
|
14 # A copy of the license is included in the section entitled "GNU
|
|
15 # Free Documentation License".
|
|
16 #######################################################################################
|
|
17 ## REQUIRED INPUT ##
|
|
18
|
|
19 # 1) list_file: SaintExpress output file.
|
|
20 # 2) prey_file: Prey file listing gene name, sequence legnth, and gene id.
|
|
21 # 3) crapome: Crapome file can be created at http://crapome.org. (default = "None")
|
|
22 # 4) color: Fill color of the bubbles, if set to crapome it shades based on crapome
|
|
23 # potential. (default = "Red")
|
|
24 # 5) cutoff: Lower limit saint score for generating bubble plot. (default = 0.8)
|
|
25 # 6) mq_sc: MQ for MaxQuant data and SC for Scaffold data.
|
|
26 # 7) inc_file: List of uniprot ids to be used exclusively. (default = "None")
|
|
27 # 8) exc_file: List of uniprot ids to be excluded from plot. (default = "None")
|
|
28 #######################################################################################
|
|
29
|
|
30
|
|
31 import os
|
|
32 import sys
|
|
33 import time
|
|
34
|
|
35
|
|
36 list_file = sys.argv[1]
|
|
37 prey_file = sys.argv[2]
|
|
38 crapome = sys.argv[3]
|
|
39 color = sys.argv[4]
|
|
40 label = sys.argv[5]
|
|
41 cutoff = sys.argv[6]
|
|
42 mq_sc = sys.argv[7]
|
|
43 inc_file = sys.argv[8]
|
|
44 exc_file = sys.argv[9]
|
|
45 output_file_name = sys.argv[10]
|
|
46 bub_zoom_NSAF = sys.argv[11]
|
|
47 bub_zoom_SAINT = sys.argv[12]
|
|
48 bub_SAINT = sys.argv[13]
|
|
49 bub_NSAF = sys.argv[14]
|
|
50 ins_path = sys.argv[15]
|
|
51
|
|
52 if crapome == "None":
|
|
53 crapome = "FALSE"
|
|
54
|
|
55
|
|
56 if label == "false":
|
|
57 label = "FALSE"
|
|
58 elif label == "true":
|
|
59 label = "TRUE"
|
|
60
|
|
61 cmd = r"Rscript "+ str(ins_path) + r"/bubbles_v9_NSAF_natural_log.R " + str(list_file) + r" "
|
|
62 + str(prey_file) + r" " + str(crapome) + r" " + str(color) + r" " + str(label) + r" "
|
|
63 + str(cutoff) + r" " + str(mq_sc) + r" " + str(inc_file) + r" " + str(exc_file)
|
|
64 os.system(cmd)
|
|
65 time.sleep(3)
|
|
66
|
|
67 open('./output.txt')
|
|
68 os.rename('output.txt', str(output_file_name))
|
|
69
|
|
70 open('./bubble_zoom_NSAF.png')
|
|
71 os.rename('bubble_zoom_NSAF.png', str(bub_zoom_NSAF))
|
|
72
|
|
73 open('./bubble_zoom_SAINT.png')
|
|
74 os.rename('bubble_zoom_SAINT.png', str(bub_zoom_SAINT))
|
|
75
|
|
76 open('./bubble_SAINT.png')
|
|
77 os.rename('bubble_SAINT.png', str(bub_SAINT))
|
|
78
|
|
79 open('./bubble_NSAF.png')
|
|
80 os.rename('bubble_NSAF.png', str(bub_NSAF))
|