}
/**
+ * like makeExactMapping but using a sequence mapping object
+ * @param sqmpping
+ * @param seq
+ */
+ public void mapChainWith(Mapping sqmpping, SequenceI seq)
+ {
+ for (Atom atom : atoms)
+ {
+ atom.alignmentMapping = -1;
+ }
+ // and now map sqmapping to the atom set.
+ int[] range = sqmpping.locateRange(seq.getStart(),seq.getEnd());
+ int r=0,from,to;
+ while (r<range.length)
+ {
+ from=range[r++];
+ to=range[r++];
+ for (int pdbpos=from;pdbpos<=to;pdbpos++)
+ {
+ if (pdbpos >= residues.size())
+ {
+ continue;
+ }
+ Residue res = residues.elementAt(pdbpos);
+ for (Atom atom : res.atoms)
+ {
+ atom.alignmentMapping = sqmpping.getPosition(pdbpos);
+ }
+ }
+ }
+ }
+
+ /**
* Annotate the residues with their corresponding positions in s1 using the
* alignment in as NOTE: This clears all atom.alignmentMapping values on the
* structure.