Skip to content

Commit

Permalink
GFF3 parsing error -- fixes #1617 (#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso authored Nov 18, 2024
1 parent af07c3b commit 07a8c59
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/org/broad/igv/feature/Exon.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ private void computeAminoAcidSequence(Genome genome, Exon prevExon, Exon nextExo
// Grab nucleotides from next exon if needed for last codon
int phase = (3 - readingFrame) % 3;
int diff = 3 - ((readEnd - (codingStart + phase)) % 3);
if (diff > 0 && nextExon != null) {
if (diff > 0 && diff < 3 && nextExon != null && !nextExon.isNonCoding()) {
byte[] d = genome.getSequence(chr, nextExon.getCdStart(), nextExon.getCdStart() + diff);
byte[] tmp = new byte[d.length + seqBytes.length];
System.arraycopy(seqBytes, 0, tmp, 0, seqBytes.length);
System.arraycopy(d, 0, tmp, seqBytes.length, d.length);
seqBytes = tmp;
if(d != null) {
byte[] tmp = new byte[d.length + seqBytes.length];
System.arraycopy(seqBytes, 0, tmp, 0, seqBytes.length);
System.arraycopy(d, 0, tmp, seqBytes.length, d.length);
seqBytes = tmp;
}
}

} else {
Expand Down

0 comments on commit 07a8c59

Please sign in to comment.