pybiomart error retrieving sequences
1
0
Entering edit mode
19 months ago
ngarber ▴ 60

I'm new to pybiomart, and I'm trying to retrieve peptide sequences from a sequence dataset, but I get a BiomartException. Here's my code:

mart = server["ENSEMBL_MART_ENSEMBL"]
seq_mart = server["ENSEMBL_MART_SEQUENCE"]
seq_dataset = seq_mart["hsapiens_genomic_sequence"]
seq_dataset.query(attributes=["peptide"])

But this gives an error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tiltwolf/.local/lib/python3.10/site-packages/pybiomart/dataset.py", line 266, in query
    raise BiomartException(response.text)
pybiomart.base.BiomartException: Query ERROR: caught BioMart::Exception::Configuration: No Importable Recieved in GenomicSequence

What's going on?

pybiomart python biomart • 605 views
ADD COMMENT
0
Entering edit mode
19 months ago
zorbax ▴ 610

Try this:

from pybiomart import Server

server = Server(host='http://www.ensembl.org')

dataset = server.marts['ENSEMBL_MART_ENSEMBL']['hsapiens_gene_ensembl']

dataset.query(attributes=['ensembl_gene_id', 'peptide'],
              filters={'chromosome_name': '1'})

You need to create an instance of the Server class and select your dataset. This example is only for the first chromosome, you can remove the filter.

ADD COMMENT

Login before adding your answer.

Traffic: 1697 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6