<p>I would like to find a few genes that are similar in length to a gene of interest, and by that I mean the total length of a canonical transcript including introns. This is proving to be surprisingly hard using web based lookups.</p>
<p>The gene of interest is 14.5Kb long and I wanted a table of genes and their canonical lengths to compare and contrast to in order to pick a few to have a look at in some vcfs I have.</p>
<p>I have a low bioinformatics ability but happy to give things a go!</p>
<p>All the best</p>
<p>I have tried:</p>
<ul>
<li>first download a file of all gene files from ensembl which looks like this:
<a href="https://i.sstatic.net/GJrPI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GJrPI.png" alt="enter image description here" /></a></li>
</ul>
<p>Then in R:</p>
<pre><code>x &lt;- read.delim(&quot;all_genes_bed.txt&quot;)
x<span class="math-container">$length &lt;- (x$</span>Gene.end..bp.-x<span class="math-container">$Gene.start..bp.)
x &lt;- subset(x, x$</span>length &gt;14000 &amp; x$length &lt;15000)
</code></pre>
<p>Then I just had a look in the RStudio browser.</p>
<p>That seemed to work!</p>

CC BY-SA 4.0
2020-12-03T12:57:03.467Z
@ATpoint many thanks for taking the time to answer. Would I get this from ensembl? I think once I have the file I could do that in R. Not sure how to get the whole gene table though
tacrolimus
CC BY-SA 4.0
2020-12-03T15:37:28.377Z
@ATpoint I think I solved it, let me know if this seems reasonble
tacrolimus
<gene><ensembl>
Finding a gene of similar length
# Finding a gene of similar length

(Asked by: username_0 on 2020-12-03)

I would like to find a few genes that are similar in length to a gene of interest, and by that I mean the total length of a canonical transcript including introns. This is proving to be surprisingly hard using web based lookups.
The gene of interest is 14.5Kb long and I wanted a table of genes and their canonical lengths to compare and contrast to in order to pick a few to have a look at in some vcfs I have.
I have a low bioinformatics ability but happy to give things a go!
All the best
I have tried:

first download a file of all gene files from ensembl which looks like this:


Then in R:
x <- read.delim("all_genes_bed.txt")
x$length <- (x$Gene.end..bp.-x$Gene.start..bp.)
x <- subset(x, x$length >14000 & x$length <15000)

Then I just had a look in the RStudio browser.
That seemed to work!

**Tags:** gene, ensembl
> **Comments:**
> **username_0**: @ATpoint many thanks for taking the time to answer. Would I get this from ensembl? I think once I have the file I could do that in R. Not sure how to get the whole gene table though  
> **username_0**: @ATpoint I think I solved it, let me know if this seems reasonble  

---

## 0 answers

