Queries Biomart for data using specified attributes and filters.
This function performs the main data retrieval from Biomart, allowing you to
query biological data by specifying which attributes to return and which filters
to apply. Includes automatic retry logic for resilience.
Args:
mart (str): The mart identifier (e.g., "ENSEMBL_MART_ENSEMBL")
dataset (str): The dataset identifier (e.g., "hsapiens_gene_ensembl")
attributes (list[str]): List of attributes to retrieve (e.g., ["ensembl_gene_id", "external_gene_name"])
filters (dict[str, str]): Dictionary of filters to apply (e.g., {"chromosome_name": "1"})
Returns:
str: CSV-formatted results of the query.
Example:
get_data(
"ENSEMBL_MART_ENSEMBL",
"hsapiens_gene_ensembl",
["ensembl_gene_id", "external_gene_name", "chromosome_name"],
{"chromosome_name": "X", "biotype": "protein_coding"}
)
>>> "ensembl_gene_id,external_gene_name,chromosome_name
ENSG00000000003,TSPAN6,X
ENSG00000000005,TNMD,X
..."