From 65e30a5dff67bc2ab66779d3aa8f5cbe5fb78d05 Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:03:02 -0800 Subject: [PATCH] GFF3 parsing error -- fixes #1617 --- src/main/java/org/broad/igv/feature/Exon.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/broad/igv/feature/Exon.java b/src/main/java/org/broad/igv/feature/Exon.java index d23b38dab6..a19521dc51 100644 --- a/src/main/java/org/broad/igv/feature/Exon.java +++ b/src/main/java/org/broad/igv/feature/Exon.java @@ -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 {