[Python] BiomartException: Query ERROR for existing dataset in BioMart

Discussão em 'Python' iniciado por Stack, Abril 20, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to fetch protein sequences for a list of gene IDs using from BioMart API using the Python code:

    def fetch_protein_sequences(gene_ids):
    dataset = Dataset(name='taestivum_eg_gene', host='http://plants.ensembl.org')
    # Fetch protein sequences
    response = dataset.query(
    attributes=[
    'ensembl_gene_id',
    'peptide'
    ],
    filters={'gene_id': gene_ids}
    )
    return response

    # Read gene IDs from file
    with open('gene_ids.txt') as f:
    gene_ids = [line.strip() for line in f]

    # Fetch protein sequences
    protein_sequences = fetch_protein_sequences(gene_ids)


    but keep enoutering

    BiomartException: Query ERROR: caught BioMart::Exception::Usage: WITHIN Virtual Schema : default, Dataset taestivum_eg_gene NOT FOUND


    Verified dateset and attributes using:

    server = Server(host='http://plants.ensembl.org')
    for dataset in server.marts['plants_mart'].datasets:
    print(dataset)


    Could someone please help me understand why I am seeing this error?

    Thank you in advance!

    Continue reading...

Compartilhe esta Página