Skip to content

Commit

Permalink
made another change relating to a case that cropped STAR alignments
Browse files Browse the repository at this point in the history
resulting in "null" junction labeling. 

The logic for defining exon boundaries assumed that the introns implied
by spliced reads will be longer than 1nt. Apparently read alignments are
sometimes reported with 1nt introns (cigar code 1N). While this doesn't
make much sense ( a 1D to represent a deletion from the reference would
be more appropriate) IsoSCM delegates to the aligner to identify intron
boundaries, and now will correctly incorporate these as 1nt introns in
the gene model.
  • Loading branch information
shenkers committed Jul 18, 2015
1 parent 81e46a5 commit ae2afd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions IsoSCM/src/processing/ClusterExpressedSegments.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ public static void identifySplicedExons(File acc_jnct_gtf, File segment_bed, GTF
StrandedGenomicIntervalTree<Map<String,Object>> written = new StrandedGenomicIntervalTree<Map<String,Object>>();

for(AnnotatedRegion splice5p : splice5ps.overlappingRegions(r.chr, r.start-1, r.end+1, r.strand)){
AnnotatedRegion splice3p = splice3ps.getClosestUpstream(splice5p.chr, splice5p.start, r.strand);
int p = IntervalTools.offsetPosition(splice5p.start, 2, r.isNegativeStrand(), true);
AnnotatedRegion splice3p = splice3ps.getClosestUpstream(splice5p.chr, p, r.strand);
if(splice3p!=null && intervalContains(splice3p.start, r.start-1, r.end+1)){
while(splice3p!=null && intervalContains(splice3p.start, r.start-1, r.end+1)){
// write internal exon
Expand All @@ -355,7 +356,7 @@ public static void identifySplicedExons(File acc_jnct_gtf, File segment_bed, GTF
Map<String,Object> attributes = new HashMap<String, Object>();
attributes.put("type", "internal_exon");
// as long as there is no nested splice junction
if(IntervalTools.ContainedIntervals(sj, r.chr, start, end, r.strand).size()==0){
if(IntervalTools.ContainedIntervals(sj, r.chr, start+1, end-1, r.strand).size()==0){
written.add(r.chr, start+1, end-1, r.strand);
exons.write("exon", r.chr, start+1, end-1, r.strand,AnnotatedRegion.GTFAttributeString(attributes));
}
Expand All @@ -380,7 +381,8 @@ public static void identifySplicedExons(File acc_jnct_gtf, File segment_bed, GTF
}

for(AnnotatedRegion splice3p : splice3ps.overlappingRegions(r.chr, r.start-1, r.end+1, r.strand)){
AnnotatedRegion splice5p = splice5ps.getClosestDownstream(splice3p.chr, splice3p.start, r.strand);
int p = IntervalTools.offsetPosition(splice3p.start, 2, r.isNegativeStrand(), false);
AnnotatedRegion splice5p = splice5ps.getClosestDownstream(splice3p.chr, p, r.strand);
if(splice5p!=null && intervalContains(splice5p.start, r.start-1, r.end+1)){
while(splice5p!=null && intervalContains(splice5p.start, r.start-1, r.end+1)){
// write internal exon
Expand All @@ -390,7 +392,7 @@ public static void identifySplicedExons(File acc_jnct_gtf, File segment_bed, GTF
Map<String,Object> attributes = new HashMap<String, Object>();
attributes.put("type", "internal_exon");
// as long as there is no nested splice junction
if(IntervalTools.ContainedIntervals(sj, r.chr, start, end, r.strand).size()==0){
if(IntervalTools.ContainedIntervals(sj, r.chr, start+1, end-1, r.strand).size()==0){
written.add(r.chr, start+1, end-1, r.strand);
exons.write("exon", r.chr, start+1, end-1, r.strand, AnnotatedRegion.GTFAttributeString(attributes));
}
Expand Down

0 comments on commit ae2afd0

Please sign in to comment.