Answers.Body: <p><strong>Short Answer:</strong>
  In my opinion, my approach would be to pull out the CDS exons and run bedtools on those.  </p>
  
  <p><strong>A Few More Details:</strong>
  When you pull out the exons, make sure that you assign them all IDs if the don't already have them assigned and record which IDs "belong" to which genes. Now when you get exons that overlap, you know that they are coding and you can tie them back to which genes they originate from.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-17T14:56:36.030Z
Answers.LastActivityDate: 2017-05-17T14:56:36.030Z
Answers.UserDisplayName: Gus
Body: <p>I have two annotations of the same genome generated with different annotation pipelines. I want to identify overlapping gene models. </p>
  
  <p><em>An important feature of this genome is that there are many 'genes within genes', i.e. a genemodel in the intron of another genemodel</em>. Therefore, I only want to count two genemodels as overlapping when their coding sequence exon annotations overlap.</p>
  
  <p>Using something like <code>bedtools intersect</code> it is straightforward to calculate overlap between the gene-level annotations. </p>
  
  <p>However: I am not sure how to select genes as overlapping when only their coding sequence exons (CDS features) overlap.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-17T11:58:50.757Z
Comments.Text: Why not extract the coordinates of your CDS regions from your bed/gff files, then do the bedtools intersect?
Comments.UserDisplayName: Chris_Rands
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-17T13:50:49.180Z
Comments.Text: That would still only leave me with the overlapping CDSs features. In the end I want to know the _genes_. Why not write your comment into an answer?
Comments.UserDisplayName: holmrenser
Tags: <sequence-annotation>
Title: How to calculate overlapping genes between two genome annotation versions
ThreadText: # How to calculate overlapping genes between two genome annotation versions
  
  (Asked by: username_0 on 2017-05-17)
  
  I have two annotations of the same genome generated with different annotation pipelines. I want to identify overlapping gene models.
  
  *An important feature of this genome is that there are many 'genes within genes', i.e. a genemodel in the intron of another genemodel*. Therefore, I only want to count two genemodels as overlapping when their coding sequence exon annotations overlap.
  
  Using something like `bedtools intersect` it is straightforward to calculate overlap between the gene-level annotations.
  
  However: I am not sure how to select genes as overlapping when only their coding sequence exons (CDS features) overlap.
  
  **Tags:** sequence-annotation
  
  > **Comments:**
  > **username_1**: Why not extract the coordinates of your CDS regions from your bed/gff files, then do the bedtools intersect?  
  > **username_0**: That would still only leave me with the overlapping CDSs features. In the end I want to know the _genes_. Why not write your comment into an answer?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-05-17. Score: 6 | Accepted answer
  
  **Short Answer:**
  In my opinion, my approach would be to pull out the CDS exons and run bedtools on those.
  
  **A Few More Details:**
  When you pull out the exons, make sure that you assign them all IDs if the don't already have them assigned and record which IDs "belong" to which genes. Now when you get exons that overlap, you know that they are coding and you can tie them back to which genes they originate from.
  
  
  ---
  
  