get gene ids
symbols = ['gyrB', 'atpD', 'lepA']
def get_gene_ids(symbols, taxon):
GeneApi =gene_api.GeneApi()
gene_metadata = GeneApi.gene_metadata_by_tax_and_symbol(symbols, taxon)
gene_id_dict = {
gene_data.gene.symbol: int(gene_data.gene.gene_id)
for gene_data in gene_metadata.genes
}
return gene_id_dict
I have written a function to get some of gene_ids of bacterial taxa, this function can't get these instance gene_ids for my requested bacterial species, while in NCBI database we can find them in most of bacterial taxa by web search tools.
for exapmle: taxon = Chryseobacterium indologenes, successfully done. taxon = Pseudomonas putida ,----> AtrributeError.
check the installation, updating the library, and setting an API key if required.
and finally try this way
which give u output as
u can also try another way
or