# HG changeset patch # User jingchunzhu # Date 1438024915 25200 # Node ID 78d6e6772e30a210524d4f25ab0c919e8223db57 # Parent bc978430001507bc34648b0d4925f9b51f5dd70a more reliable diff -r bc9784300015 -r 78d6e6772e30 getXenaData.py --- a/getXenaData.py Mon Jul 27 12:01:42 2015 -0700 +++ b/getXenaData.py Mon Jul 27 12:21:55 2015 -0700 @@ -16,22 +16,29 @@ url = "https://galaxyxena.soe.ucsc.edu:443/xena" #testing if the url is reachable -#try: -r =json.loads(xena.post(url, "(+ 1 2)")) -if r!=3.0: - print "The hub seems can not be reached, either it is not running, the url has a typo, or it is not accessible to you." - print "You entered hub: %s" % (url) - fout.write("The hub seems can not be reached, either it is not running, the url has a typo, or it is not accessible to you.\n") - fout.write("You entered hub: %s\n" % (url)) - fout.close() - sys.exit(1) +try: + r =json.loads(xena.post(url, "(+ 1 2)")) + if r!=3.0: + print "The hub seems can not be reached, either it is not running, the url has a typo, or it is not accessible to you." + print "You entered hub: %s" % (url) + fout.write("The hub seems can not be reached, either it is not running, the url has a typo, or it is not accessible to you.\n") + fout.write("You entered hub: %s\n" % (url)) + fout.close() + sys.exit(1) +except: + print "The hub seems can not be reached, either it is not running, the url has a typo, or it is not accessible to you." + print "You entered hub: %s" % (url) + fout.write("The hub seems can not be reached, either it is not running, the url has a typo, or it is not accessible to you.\n") + fout.write("You entered hub: %s\n" % (url)) + fout.close() + sys.exit(1) samples = xena.dataset_samples (url, dataset) if not samples: print "Dataset does not exist" print "You entered dataset id: %s" % (dataset) fout.write("Dataset does not exists\n") - fout.wriet("You entered dataset id: %s\n" % (dataset)) + fout.write("You entered dataset id: %s\n" % (dataset)) fout.close() sys.exit(1) diff -r bc9784300015 -r 78d6e6772e30 xenaGetDataset.xml --- a/xenaGetDataset.xml Mon Jul 27 12:01:42 2015 -0700 +++ b/xenaGetDataset.xml Mon Jul 27 12:21:55 2015 -0700 @@ -29,7 +29,7 @@ - + Given the data hub name and the dataset id, download the dataset into this Galaxy. Xena dataset id can be obtained through the Explore Data in Xena tool.