From f18ea3ce4e450b363c5092a340d26bbed18e43a1 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 13 Feb 2018 16:15:12 +0000 Subject: [PATCH] =?utf8?q?JAL-2780=20SequenceI.findFeatures=20takes=20column?= =?utf8?q?=20numbers=20in=20base=201=E2=80=A6=E2=80=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/jalview/ws/PDBSequenceFetcherTest.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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) -- 1.7.10.2