- org.testng.Assert.assertEquals(sq.getEnd() - sq.getStart() + 1,
- sq.getLength(),
- "Sequence start/end doesn't match number of residues in sequence for "
- + sq.getName());
+ // FIXME: should test that all residues extracted as sequences from
+ // chains in structure have a mapping to data in the structure
+ List<SequenceFeature> prev = null;
+ int lastp = -1;
+ for (int col = 1; col <= sq.getLength(); col++)
+ {
+ List<SequenceFeature> sf = sq.findFeatures(col, col, "RESNUM");
+ if (sf.size() != 1)
+ {
+ errors.append(
+ 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 position " + lastp + ": "
+ + prev.get(0).toString());
+ errors.append("\n");
+ }
+ }
+ else
+ {
+ prev = sf;
+ lastp = sq.findPosition(col - 1);
+ }
+ }