From: Jim Procter Date: Thu, 27 Jun 2024 16:52:01 +0000 (+0100) Subject: JAL-4386 account for null entries in sequence array passed to the score model - usual... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b1b730f3af908258040654202f4540c8a57c56a7;p=jalview.git JAL-4386 account for null entries in sequence array passed to the score model - usually only for the tests --- diff --git a/src/jalview/analysis/scoremodels/SecondaryStructureDistanceModel.java b/src/jalview/analysis/scoremodels/SecondaryStructureDistanceModel.java index 468c3c5..97200bf 100644 --- a/src/jalview/analysis/scoremodels/SecondaryStructureDistanceModel.java +++ b/src/jalview/analysis/scoremodels/SecondaryStructureDistanceModel.java @@ -120,20 +120,27 @@ public class SecondaryStructureDistanceModel extends DistanceScoreModel for (SeqCigar scig : seqData.getSequences()) { + // get the next sequence that should be bound to this scig: may be null SequenceI alSeq = sequences[sq++]; List ssec = ssAlignmentAnnotationForSequences.get(scig.getRefSeq()); if (ssec == null) { // not defined newSequences.add(alSeq); - labels.add(alSeq.getName()+"|"+" No Secondary Structure"); + if (alSeq!=null) { + labels.add(alSeq.getName()+"|"+" No Secondary Structure"); + } SeqCigar newSeqCigar = scig; //new SeqCigar(scig); newCigs.add(newSeqCigar); ssForSeqs.add(null); } else { for (int i = 0; i < ssec.size(); i++) { - labels.add(alSeq.getName()+"|"+AlignmentUtils.extractSSSourceFromAnnotationDescription(ssec.get(i))); + if (alSeq != null) + { + labels.add(alSeq.getName() + "|" + AlignmentUtils + .extractSSSourceFromAnnotationDescription(ssec.get(i))); + } //newSequences.add(seq); newSequences.add(alSeq); SeqCigar newSeqCigar = scig; // new SeqCigar(scig);