def test_get_probanno(self): ''' Verify that we can successfully get a list of roleset probabilities from a valid ProbAnno object. ''' paClient = ProbabilisticAnnotation(self._config["probanno_url"], token=self._token) probAnnoData = paClient.get_probanno( { "probanno": self._config["probannoid"], "probanno_workspace": self._config["test_ws"] }) self.assertNotEqual(len(probAnnoData), 0, 'Length of output array is zero')
def test_get_probanno(self): ''' Verify that we can successfully get a list of roleset probabilities from a valid ProbAnno object. ''' paClient = ProbabilisticAnnotation(self._config["probanno_url"], token=self._token) probAnnoData = paClient.get_probanno({ "probanno": self._config["probannoid"], "probanno_workspace": self._config["test_ws"] }) self.assertNotEqual(len(probAnnoData), 0, 'Length of output array is zero')
input = dict() input['probanno'] = args.probanno if args.probannows is None: input['probanno_workspace'] = user_workspace() else: input['probanno_workspace'] = args.probannows input['probanno_version'] = args.probannover # Create a probabilistic annotation client. if args.url is None: args.url = get_url() paClient = ProbabilisticAnnotation(url=args.url) # Get the raw data from the server. try: output = paClient.get_probanno(input) except Exception as e: print 'Error getting ProbAnno object: %s' %(e.message) if args.showError: traceback.print_exc(file=sys.stdout) exit(1) # Format the data as a table of tab delimited fields. if args.roles: print '\t'.join(['gene', 'role', 'likelihood']) else: print '\t'.join(['gene', 'annotation', 'likelihood']) for gene in output: roleToProb = dict() for roleprob in output[gene]: if args.roles:
input = dict() input['probanno'] = args.probanno if args.probannows is None: input['probanno_workspace'] = user_workspace() else: input['probanno_workspace'] = args.probannows input['probanno_version'] = args.probannover # Create a probabilistic annotation client. if args.url is None: args.url = get_url() paClient = ProbabilisticAnnotation(url=args.url) # Get the raw data from the server. try: output = paClient.get_probanno(input) except Exception as e: print 'Error getting ProbAnno object: %s' % (e.message) if args.showError: traceback.print_exc(file=sys.stdout) exit(1) # Format the data as a table of tab delimited fields. if args.roles: print '\t'.join(['gene', 'role', 'likelihood']) else: print '\t'.join(['gene', 'annotation', 'likelihood']) for gene in output: roleToProb = dict() for roleprob in output[gene]: if args.roles: