From: gmungoc Date: Tue, 11 Oct 2016 08:33:13 +0000 (+0100) Subject: JAL-1479 small tidy of error message when Sifts mapping fails X-Git-Tag: Release_2_10_1~28 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=290f1ace41a61281440573d87f8415e08978360a;p=jalview.git JAL-1479 small tidy of error message when Sifts mapping fails --- diff --git a/src/jalview/ws/sifts/SiftsClient.java b/src/jalview/ws/sifts/SiftsClient.java index fb59071..e85edd2 100644 --- a/src/jalview/ws/sifts/SiftsClient.java +++ b/src/jalview/ws/sifts/SiftsClient.java @@ -390,8 +390,8 @@ public class SiftsClient implements SiftsClientI String pdbFile, String chain) throws SiftsException { structId = (chain == null) ? pdbId : pdbId + "|" + chain; - System.out.println("Getting mapping for: " + pdbId + "|" + chain - + " : seq- " + seq.getName()); + System.out.println("Getting SIFTS mapping for " + structId + ": seq " + + seq.getName()); final StringBuilder mappingDetails = new StringBuilder(128); PrintStream ps = new PrintStream(System.out) @@ -470,12 +470,14 @@ public class SiftsClient implements SiftsClientI int pdbStart = UNASSIGNED; int pdbEnd = UNASSIGNED; - Integer[] keys = mapping.keySet().toArray(new Integer[0]); - Arrays.sort(keys); - if (keys.length < 1) + if (mapping.isEmpty()) { - throw new SiftsException(">>> Empty SIFTS mapping generated!!"); + throw new SiftsException( + "SIFTS mapping failed - falling back on Needleman-Wunsch"); } + + Integer[] keys = mapping.keySet().toArray(new Integer[0]); + Arrays.sort(keys); seqStart = keys[0]; seqEnd = keys[keys.length - 1];