<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>

CC BY-SA 4.0
2024-02-15T15:13:16.753Z
2024-02-15T15:34:03.310Z
2024-02-15T15:34:03.310Z
Dan Bolser
<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>

CC BY-SA 4.0
2024-01-12T18:13:32.703Z
This seems like an XY problem. What is the overarching reason for this task?
Ram RS
CC BY-SA 4.0
2024-01-13T12:58:01.417Z
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.
terdon
CC BY-SA 4.0
2024-01-14T19:27:19.170Z
I'm assuming by "ENSP" you mean Ensembl proteing (which have codes starting with ENSP, then a number). Is that correct?
gringer
<ensembl><bed><bedtools><biomart>
Chromosome position -> ENSP
# 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:
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
  )


---

