Entrez

class Entrez(email, api_key=None, tool='PhyloMAF')[source]

Remote class responsible for batch data fetching from NCBI’s Entrez API Schuler et al. [SEOK96]

Create Entrez instance to connect to NCBI database.

Parameters
  • email (str) – User’s email that will be passed to NCBI server

  • api_key (Optional[str]) – User’s API key obtained from NCBI account page. Default is None(without key). However, it is recommended to obtain an API key for faster access.

  • tool (str) – Label of the tool that will be passed to NCBI server. Default is “PhyloMAF”`

Attributes

state

State of the instance.

Methods

check_init()

Check instance ready status.

filter_genes_from_future_table(seq_raw_io, gene)

Filter/extract genes from NCBI gene feature table.

get_chromosome_id_by_genome_id(genome_id)

Get NCBI’s chromosome ID by target genome_id

get_fasta_sequence_by_param(accession_id, …)

Get FASTA string from NCBI database by accesion_id

get_gene_features_by_chromosome_id(chromosome_id)

Get gene features by chromosome ID.

get_genome_id_by_taxid(taxid)

Get NCBI’s genome ID by target taxid

get_request_logs()

Get low level request codes for debugging.

get_taxid_by_query(query)

Fetch NCBI taxonomy database using query and get a NCBI’s internal taxid.