# HG changeset patch # User bornea # Date 1462978252 14400 # Node ID 46a582eb1ea9f9b3b72227b366da6295e8316d0e Uploaded diff -r 000000000000 -r 46a582eb1ea9 nsaf_scoring.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nsaf_scoring.py Wed May 11 10:50:52 2016 -0400 @@ -0,0 +1,40 @@ +####################################################################################### +# Python-code: NSAF scoring wrapper +# Author: Adam L Borne +# Contributers: Paul A Stewart, Brent Kuenzi +####################################################################################### +# This program runs the R script that generates a nsaf scoring table. Python script simply +# handles arguments and interacts with Galaxy. +####################################################################################### +# Copyright (C) Adam Borne. +# Permission is granted to copy, distribute and/or modify this document +# under the terms of the GNU Free Documentation License, Version 1.3 +# or any later version published by the Free Software Foundation; +# with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +# A copy of the license is included in the section entitled "GNU +# Free Documentation License". +####################################################################################### +## REQUIRED INPUT ## + +# 1) listfile: SaintExpress output file. +# 2) preyfile: Prey file listing gene name, sequence legnth, and gene id. +# 3) crapfile: Crapome file can be created at http://crapome.org. (default = "None") +# 4) interfile: inter file from preprocessing script. +####################################################################################### +import os +import sys +import time + + +listfile = sys.argv[1] +preyfile = sys.argv[2] +crapfile = sys.argv[3] +interfile = sys.argv[4] +ins_path = sys.argv[6] + + +cmd = (r"Rscript "+ str(ins_path) + r"/nsaf_scoring.R " + str(listfile) + r" " + + str(preyfile) + r" " + str(crapfile) + r" " + str(inter_file)) +os.system(cmd) + +os.rename("SaintTable.txt", sys.argv[5])