Exemplo n.º 1
0
    def set_taxonID(self, name):

        taxids = {}
        nameset = set([self.name, self.binomial, self.tnrs_acceptedname, self.tnrs_binomial])
        if 'NA' in nameset: nameset.remove('NA')
        
        for name in nameset:
            taxid = genbank.get_taxid(name)
            taxids[name] = taxid
        
        taxid_set = set(taxids.values())
        if 'NA' in taxid_set: taxid_set.remove('NA')

        if len(taxid_set)>1:
            out = json.dumps(taxids, indent=2)
            log.warning("More than one taxon ID found: \n%s" %taxids)
            self.taxid = "NA"
            log.info("TaxonID set to 'NA'")
        if len(taxid_set)==1:
            self.taxid = list(taxid_set)[0]
            log.info("TaxonID set to %s" % self.taxid)
        if len(taxid_set)==0:
            log.warning("No taxon ID found")
            self.taxid = "NA"
            log.info("TaxonID set to 'NA'")
Exemplo n.º 2
0
    def set_taxonID(self, name):

        taxids = {}
        nameset = set([
            self.name, self.binomial, self.tnrs_acceptedname,
            self.tnrs_binomial
        ])
        if 'NA' in nameset: nameset.remove('NA')

        for name in nameset:
            taxid = genbank.get_taxid(name)
            taxids[name] = taxid

        taxid_set = set(taxids.values())
        if 'NA' in taxid_set: taxid_set.remove('NA')

        if len(taxid_set) > 1:
            out = json.dumps(taxids, indent=2)
            log.warning("More than one taxon ID found: \n%s" % taxids)
            self.taxid = "NA"
            log.info("TaxonID set to 'NA'")
        if len(taxid_set) == 1:
            self.taxid = list(taxid_set)[0]
            log.info("TaxonID set to %s" % self.taxid)
        if len(taxid_set) == 0:
            log.warning("No taxon ID found")
            self.taxid = "NA"
            log.info("TaxonID set to 'NA'")
Exemplo n.º 3
0
 def get_taxonID(self, name):
     taxid = genbank.get_taxid(name)
     return taxid
Exemplo n.º 4
0
 def get_taxonID(self, name):
     taxid = genbank.get_taxid(name)
     return taxid