This function extracts the id_mapping table from the UniProt API based on the specified taxonomic ID.
It fetches protein information and then maps UniProt IDs to the target gene ID type using
the UniProt ID mapping API.
Usage
fetch_id_mapping(tax_id, source_db = c("ncbi", "ensembl"), txid2gid = NULL)
Arguments
- tax_id
Taxonomic ID to filter the UniProt database.
- source_db
The source database of gene ID to fetch. Either "ncbi" (for GeneID) or "ensembl".
Value
A data frame containing the id_mapping table with columns:
uniprot, status, names, gene_names, gid, score
Examples
if (FALSE) { # \dontrun{
id_mapping <- fetch_id_mapping(tax_id = 9606)
id_mapping_ensembl <- fetch_id_mapping(tax_id = 9606, source_db = "ensembl")
} # }