def get_taxon(self, ctx, ref):
        """
        Retrieve the Taxon associated with this GenomeAnnotation.
        @return Reference to TaxonAPI object
        :param ref: instance of type "ObjectReference"
        :returns: instance of type "ObjectReference"
        """
        # ctx is the context object
        # return variables are: returnVal
        #BEGIN get_taxon
        ga = GenomeAnnotationAPI_local(self.services, ctx['token'], ref)
        returnVal = ga.get_taxon(ref_only=True)
        #END get_taxon

        # At some point might do deeper type checking...
        if not isinstance(returnVal, basestring):
            raise ValueError('Method get_taxon return value ' +
                             'returnVal is not type basestring as required.')
        # return the results
        return [returnVal]
예제 #2
0
	'num_contigs' : 0,
	'contig_lengths' : [],
	'contig_ids' : [],
	'source' : "KBase",
	'source_id' : sys.argv[6],
#	'md5' : "",
	'taxonomy' : "Unknown",
	'gc_content' : 0.5,
	'complete' : 1,
	'features' : []
};

taxon = {};
success = 0;
try:
	taxon = ga.get_taxon();
	success = 1;
except Exception, e:
	success = 0
	
if success == 1:
	try:
		gto['scientific_name'] = taxon.get_scientific_name()
	except Exception, e:
		success = 0
	try:
		gto['domain'] = taxon.get_domain()
	except Exception, e:
		success = 0
	try:
		gto['genetic_code'] = taxon.get_genetic_code()