From b1ec29190c2aceda61a94197040c0d3288cc2702 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 6 Apr 2005 16:05:43 +0000 Subject: [PATCH] New method for helping to quickly map different aligned versions of a sequence. --- src/jalview/datamodel/Sequence.java | 16 ++++++++++++++++ src/jalview/datamodel/SequenceI.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 99f2de2..5db051a 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -194,6 +194,22 @@ public class Sequence implements SequenceI } return pos; } + + public int[] gapMap() { + // Returns an int array giving the position of each residue in the sequence in the alignment + String seq = jalview.analysis.AlignSeq.extractGaps("-. ",sequence); + int[] map = new int[seq.length()]; + int j=0; + int p=0; + while (j