From: Jim Procter Date: Tue, 13 Feb 2018 16:15:12 +0000 (+0000) Subject: JAL-2780 SequenceI.findFeatures takes column numbers in base 1…
 X-Git-Tag: Release_2_10_4~68^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f18ea3ce4e450b363c5092a340d26bbed18e43a1;p=jalview.git JAL-2780 SequenceI.findFeatures takes column numbers in base 1…
 --- diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index ba90dd8..9efcef2 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -146,21 +146,24 @@ public class PDBSequenceFetcherTest sq.getAllPDBEntries().size() > 0); // FIXME: should test that all residues extracted as sequences from // chains in structure have a mapping to data in the structure - StringBuilder errors = new StringBuilder(); List prev = null; int lastp = -1; - for (int rs = sq.getStart(); rs < sq.getStart() - + sq.getLength(); rs++) + for (int col = 1; col <= sq.getLength(); col++) { - List sf = sq.findFeatures(rs, rs, "RESNUM"); + List sf = sq.findFeatures(col, col, "RESNUM"); if (sf.size() != 1) { errors.append( - "Expected feature at " + rs + ": saw " + sf.size()); + str.id + ": " + + "Expected one feature at column (position): " + + (col - 1) + + " (" + sq.findPosition(col - 1) + ")" + + ": saw " + + sf.size()); errors.append("\n"); if (prev != null) { - errors.append("Last Feature was at " + lastp + ": " + errors.append("Last Feature was at position " + lastp + ": " + prev.get(0).toString()); errors.append("\n"); } @@ -168,7 +171,7 @@ public class PDBSequenceFetcherTest else { prev = sf; - lastp = rs; + lastp = sq.findPosition(col - 1); } } if (errors.length() > 0)