From: James Procter Date: Fri, 15 Dec 2023 13:56:57 +0000 (+0000) Subject: JAL-4366 build a mapping to a PDBChain with an arbitrary SequenceMapping X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=63f2e226f8be5776a7146b6eddf8e55ac545db46;p=jalview.git JAL-4366 build a mapping to a PDBChain with an arbitrary SequenceMapping --- diff --git a/src/mc_view/PDBChain.java b/src/mc_view/PDBChain.java index 2970ccf..7e220bb 100755 --- a/src/mc_view/PDBChain.java +++ b/src/mc_view/PDBChain.java @@ -187,6 +187,39 @@ public class PDBChain } /** + * 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= 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.