Answers.Body: <p>Hi An Ignorant Wanderer,</p>
  <p>Filters allow you to narrow down the dataset to query a specific subset of features within your dataset. A description and tutorial of the filtering steps within BioMart can be found here:
  <a href="https://www.ensembl.org/info/data/biomart/how_to_use_biomart.html" rel="nofollow noreferrer">https://www.ensembl.org/info/data/biomart/how_to_use_biomart.html</a></p>
  <p>If you remove filters, you will query the full dataset (all human genes, in the example above). However, this is not recommended for BioMart as large, genome-wide queries will overload the BioMart servers. For queries of this size, we suggest using the Ensembl REST API or FTP site.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-09T12:05:21.980Z
Answers.LastActivityDate: 2022-11-09T12:05:21.980Z
Answers.UserDisplayName: Ben_Moore
Body: <p>In the <code>biomaRt</code> package, there is a function <code>getBM</code> which among a few things is useful for mapping between different gene representations. Currently, I'm using it as follows, to map Ensembl transcript IDs to gene names and Ensembl gene IDs.</p>
  <pre><code>ensemble2gene &lt;- getBM(attributes=c(&quot;ensembl_transcript_id&quot;, 
                                      &quot;external_gene_name&quot;,
                                      &quot;ensembl_gene_id&quot;),
                         values = as.list(transcripts), 
                         mart = mart)
  </code></pre>
  <p>How is the following code different:</p>
  <pre><code>ensemble2gene &lt;- getBM(attributes=c(&quot;ensembl_transcript_id&quot;, 
                                      &quot;external_gene_name&quot;,
                                      &quot;ensembl_gene_id&quot;),
                         filters = &quot;ensembl_transcript_id&quot;,
                         values = as.list(transcripts), 
                         mart = mart)
  </code></pre>
  <p>It's unclear to me from the description of the <code>filters</code> argument <a href="https://www.rdocumentation.org/packages/biomaRt/versions/2.28.0/topics/getBM" rel="nofollow noreferrer">here</a>. But just based on results, I get less results when I run the second one.</p>
  
Tags: <ensembl><biomart>
Title: What does the "filters" argument in "getBM" do?
ThreadText: # What does the "filters" argument in "getBM" do?
  
  (Asked by: username_0 on 2022-11-05)
  
  In the `biomaRt` package, there is a function `getBM` which among a few things is useful for mapping between different gene representations. Currently, I'm using it as follows, to map Ensembl transcript IDs to gene names and Ensembl gene IDs.
  
  ```
  ensemble2gene <- getBM(attributes=c("ensembl_transcript_id", 
                                      "external_gene_name",
                                      "ensembl_gene_id"),
                         values = as.list(transcripts), 
                         mart = mart)
  
  ```
  
  How is the following code different:
  
  ```
  ensemble2gene <- getBM(attributes=c("ensembl_transcript_id", 
                                      "external_gene_name",
                                      "ensembl_gene_id"),
                         filters = "ensembl_transcript_id",
                         values = as.list(transcripts), 
                         mart = mart)
  
  ```
  
  It's unclear to me from the description of the `filters` argument [here](https://www.rdocumentation.org/packages/biomaRt/versions/2.28.0/topics/getBM). But just based on results, I get less results when I run the second one.
  
  **Tags:** ensembl, biomart
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-11-09. Score: 0 | Accepted answer
  
  Hi An Ignorant username_0,
  
  Filters allow you to narrow down the dataset to query a specific subset of features within your dataset. A description and tutorial of the filtering steps within BioMart can be found here:
  <https://www.ensembl.org/info/data/biomart/how_to_use_biomart.html>
  
  If you remove filters, you will query the full dataset (all human genes, in the example above). However, this is not recommended for BioMart as large, genome-wide queries will overload the BioMart servers. For queries of this size, we suggest using the Ensembl REST API or FTP site.
  
  
  ---
  
  