| download_proteins {GCModeller} | R Documentation |
Queries the UniProt database for protein information based on a search term and an optional taxonomy ID. This function acts as a wrapper around the UniProt REST API, allowing for the retrieval of either raw query results or formatted protein sequences in FASTA format.
download_proteins(q,
tax.id = NULL,
as.fasta = TRUE);
The return value depends on the \code{as_fasta} argument: \itemize{ \item If \code{as_fasta = TRUE}: Returns the protein sequences in FASTA format (typically as a character vector or raw text). \item If \code{as_fasta = FALSE}: Returns the raw response object from \code{UniProt::rest_query}. }
#\dontrun{
# Search for insulin protein sequences in humans (TaxID: 9606)
fasta_seqs <- download_proteins(q = "insulin", tax_id = 9606)
# Search for a specific accession and get the raw result object
raw_data <- download_proteins(q = "P69905", as_fasta = FALSE)
#}