Getting gene attributes from biomart

Biomart is an Ensembl service for querying and retrieving data. Here I’ll use R/Bioconductor to get gene positions for a list of genes.

We basically need a mart object which encapsulates the species, host and database information. Here I’m using the US west coast mirror. This defaults to the current build (GRCh38) of the human genome.

In Biomart parlance, filters are search parameters (like the WHERE clause in SQL) while atttributes are the information you are searching for.

Here, I have a list of gene symbols and I want to query Biomart. This basically says to query the database using the field external_gene_name for any values that match my list of genes. Then return to me the ensembl gene id, gene symbol, chrom, start, stop positions as a data.frame.