annotate nsaf_scoring.py @ 1:e3625c710dd3 draft

Uploaded
author bornea
date Wed, 11 May 2016 10:51:03 -0400
parents 46a582eb1ea9
children 9ff511e32040
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
1 #######################################################################################
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
2 # Python-code: NSAF scoring wrapper
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
3 # Author: Adam L Borne
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
4 # Contributers: Paul A Stewart, Brent Kuenzi
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
5 #######################################################################################
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
6 # This program runs the R script that generates a nsaf scoring table. Python script simply
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
7 # handles arguments and interacts with Galaxy.
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
8 #######################################################################################
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
9 # Copyright (C) Adam Borne.
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
10 # Permission is granted to copy, distribute and/or modify this document
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
11 # under the terms of the GNU Free Documentation License, Version 1.3
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
12 # or any later version published by the Free Software Foundation;
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
13 # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
14 # A copy of the license is included in the section entitled "GNU
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
15 # Free Documentation License".
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
16 #######################################################################################
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
17 ## REQUIRED INPUT ##
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
18
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
19 # 1) listfile: SaintExpress output file.
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
20 # 2) preyfile: Prey file listing gene name, sequence legnth, and gene id.
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
21 # 3) crapfile: Crapome file can be created at http://crapome.org. (default = "None")
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
22 # 4) interfile: inter file from preprocessing script.
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
23 #######################################################################################
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
24 import os
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
25 import sys
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
26 import time
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
27
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
28
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
29 listfile = sys.argv[1]
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
30 preyfile = sys.argv[2]
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
31 crapfile = sys.argv[3]
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
32 interfile = sys.argv[4]
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
33 ins_path = sys.argv[6]
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
34
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
35
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
36 cmd = (r"Rscript "+ str(ins_path) + r"/nsaf_scoring.R " + str(listfile) + r" "
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
37 + str(preyfile) + r" " + str(crapfile) + r" " + str(inter_file))
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
38 os.system(cmd)
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
39
46a582eb1ea9 Uploaded
bornea
parents:
diff changeset
40 os.rename("SaintTable.txt", sys.argv[5])