Answers.Body: <p>I used BioMart (and then tabix) to get the answer to this question:</p>
  <pre class="lang-r prettyprint-override"><code>if (!requireNamespace(&quot;BiocManager&quot;, quietly = TRUE)) {
    install.packages(&quot;BiocManager&quot;)
  }
  
  BiocManager::install(&quot;biomaRt&quot;)
  
  ## F**kery:
  install.packages(&quot;devtools&quot;)
  devtools::install_version(&quot;dbplyr&quot;, version = &quot;2.3.4&quot;)
  
  
  library(biomaRt)
  
  listEnsembl()
  
  ensembl &lt;- useEnsembl(
    biomart = &quot;ensembl&quot;,
    dataset = &quot;hsapiens_gene_ensembl&quot;,
    GRCh = 37
  )
  
  chrs &lt;- c(1:22, &quot;X&quot;, &quot;Y&quot;, &quot;MT&quot;)
  
  genes &lt;-
    getBM(
      attributes = c(
        &quot;chromosome_name&quot;,
        &quot;start_position&quot;,
        &quot;end_position&quot;,
        &quot;ensembl_gene_id&quot;,
        &quot;ensembl_transcript_id&quot;,
        &quot;ensembl_peptide_id&quot;,
        &quot;hgnc_symbol&quot;
      ),
      filters = &quot;chromosome_name&quot;,
      values = chrs,
      mart = ensembl
    )
  
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-15T15:13:16.753Z
Answers.LastActivityDate: 2024-02-15T15:34:03.310Z
Answers.LastEditDate: 2024-02-15T15:34:03.310Z
Answers.UserDisplayName: Dan Bolser
Body: <p>I'd like a tabix file that, for every position in the genome, gives me a list of every ENSP within 5kb of that position.</p>
  <p>This should be easy right... I know VEP /kinda/ gives me this, but I'd rather not run it for every postition in the genome </p>
  <p>Can I use biomart to get the start/end position for every ENSP, then bedtools to somehow expand those coords?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-12T18:13:32.703Z
Comments.Text: This seems like an XY problem. What is the overarching reason for this task?
Comments.UserDisplayName: Ram RS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-13T12:58:01.417Z
Comments.Text: What's an "ENSP"? Do you mean Ensembl protein IDs? What species are you working with? Which genome version? What you describe is simply every single annotated protein, so why aren't you just taking all proteins? Please [edit] your question and explain what the end goal is so we can understand what you need better.
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-14T19:27:19.170Z
Comments.Text: I'm assuming by "ENSP" you mean Ensembl proteing (which have codes starting with ENSP, then a number). Is that correct?
Comments.UserDisplayName: gringer
Tags: <ensembl><bed><bedtools><biomart>
Title: Chromosome position -> ENSP
ThreadText: # Chromosome position -> ENSP
  
  (Asked by: username_0 on 2024-01-12)
  
  I'd like a tabix file that, for every position in the genome, gives me a list of every ENSP within 5kb of that position.
  
  This should be easy right... I know VEP /kinda/ gives me this, but I'd rather not run it for every postition in the genome
  
  Can I use biomart to get the start/end position for every ENSP, then bedtools to somehow expand those coords?
  
  **Tags:** ensembl, bed, bedtools, biomart
  
  > **Comments:**
  > **username_1**: This seems like an XY problem. What is the overarching reason for this task?  
  > **username_2**: What's an "ENSP"? Do you mean Ensembl protein IDs? What species are you working with? Which genome version? What you describe is simply every single annotated protein, so why aren't you just taking all proteins? Please [edit] your question and explain what the end goal is so we can understand what you need better.  
  > **username_3**: I'm assuming by "ENSP" you mean Ensembl proteing (which have codes starting with ENSP, then a number). Is that correct?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-02-15. Score: 1
  
  I used BioMart (and then tabix) to get the answer to this question:
  
  ```r
  if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
  }
  
  BiocManager::install("biomaRt")
  
  ## F**kery:
  install.packages("devtools")
  devtools::install_version("dbplyr", version = "2.3.4")
  
  library(biomaRt)
  
  listEnsembl()
  
  ensembl <- useEnsembl(
    biomart = "ensembl",
    dataset = "hsapiens_gene_ensembl",
    GRCh = 37
  )
  
  chrs <- c(1:22, "X", "Y", "MT")
  
  genes <-
    getBM(
      attributes = c(
        "chromosome_name",
        "start_position",
        "end_position",
        "ensembl_gene_id",
        "ensembl_transcript_id",
        "ensembl_peptide_id",
        "hgnc_symbol"
      ),
      filters = "chromosome_name",
      values = chrs,
      mart = ensembl
    )
  
  ```
  
  
  ---
  
  