From 4826177c4126bfa7bb79eb1b7bd43f5c7cb62132 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Wed, 18 Oct 2023 15:50:32 +0200 Subject: [PATCH] JAL-1601 Reuse existing "getNonEmptySequenceSet" method --- .../actions/secstructpred/SecStructPredMsaTask.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/jalview/ws2/actions/secstructpred/SecStructPredMsaTask.java b/src/jalview/ws2/actions/secstructpred/SecStructPredMsaTask.java index 5067ff7..21d8807 100644 --- a/src/jalview/ws2/actions/secstructpred/SecStructPredMsaTask.java +++ b/src/jalview/ws2/actions/secstructpred/SecStructPredMsaTask.java @@ -2,6 +2,7 @@ package jalview.ws2.actions.secstructpred; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -67,22 +68,13 @@ public class SecStructPredMsaTask referenceSeq.setSequence(alignmentView.getASequenceString('-', 0)); for (int i = 0; i < sequences.length; i++) sequences[i].setSequence(alignmentView.getASequenceString('-', i)); - var sequencesList = filterEmptySequences(sequences); - var job = new SecStructPredJob(sequencesList, referenceSeq, delMap, - sequenceInfo); + var nonEmptySeqs = SeqsetUtils.getNonEmptySequenceSet(sequences); + var job = new SecStructPredJob(Arrays.asList(nonEmptySeqs), + referenceSeq, delMap, sequenceInfo); job.setStatus(JobStatus.READY); return List.of(job); } - private static List filterEmptySequences(SequenceI[] seqs) - { - var filtered = new ArrayList(); - for (var seq : seqs) - if (seq.getEnd() - seq.getStart() > 0) - filtered.add(seq); - return filtered; - } - @Override protected AlignmentI collectResult(List jobs) throws IOException -- 1.7.10.2