Mercurial > repos > melissacline > ucsc_xena_platform
changeset 36:d64a002c3b0c
modify
author | jingchunzhu |
---|---|
date | Fri, 24 Jul 2015 11:39:31 -0700 |
parents | d8dc482ef970 |
children | 97325a1202d2 |
files | xena_import.py xena_utils.py |
diffstat | 2 files changed, 7 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/xena_import.py Thu Jul 23 16:14:33 2015 -0700 +++ b/xena_import.py Fri Jul 24 11:39:31 2015 -0700 @@ -118,29 +118,27 @@ xenaFileDir, genomicDataFile, xena.port()) - loadInToXena (xenaLoadCmd, fp2) + loadInToXena (xenaLoadCmd, genomicDataFile, fp2) if args.probeMap is not None: xenaLoadCmd = "java -jar %s -l --force %s/%s -p %s" % (xena.jarPath(), xenaFileDir, probeMapDataFile, xena.port()) - loadInToXena (xenaLoadCmd, fp2) + loadInToXena (xenaLoadCmd, probeMapDataFile, fp2) + fp2.close() - -def loadInToXena (xenaLoadCmd, fp2): +def loadInToXena (xenaLoadCmd, name, fp2): + print xenaLoadCmd try: subprocess.call(xenaLoadCmd, shell=True) except: exc_type, exc_value, exc_traceback = sys.exc_info() lines = traceback.format_exception(exc_type, exc_value, exc_traceback) allLines = ''.join('!! ' + line for line in lines) + fp2.write("Unsuccessful: Import %s\n" % (name)) fp2.write("Unsuccessful: error %s\n" % allLines) - fp2.close() - sys.exit(-1) else: - fp2.write( "Import successful\n") - fp2.close() - sys.exit(0) + fp2.write( "Import %s is successful\n" % (name)) if __name__ == "__main__": main()
--- a/xena_utils.py Thu Jul 23 16:14:33 2015 -0700 +++ b/xena_utils.py Fri Jul 24 11:39:31 2015 -0700 @@ -41,15 +41,6 @@ return False return (content == "3.0") - """ - query = "wget -q -O- http://%s:%s/data/'(+ 1 2)'" % (hostname, xenaPort) - try: - result = subprocess.check_output(query, shell=True) - except: - return False - else: - return(result == "3.0") - """ def findUnusedPort(): """Find a random port that is available on the local system, and return