From 52f42d57f0f08942ce54e3a739f1c9936cc5f293 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 27 Oct 2006 16:13:57 +0000 Subject: [PATCH] New padgaps works out number of gaps to insert, delete --- src/jalview/datamodel/Alignment.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index cb73d0c..713cb0d 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -597,7 +597,8 @@ public class Alignment implements AlignmentI return dataset; } - public boolean padGaps() { + public boolean padGaps() + { boolean modified=false; //Remove excess gaps from the end of alignment @@ -620,14 +621,17 @@ public class Alignment implements AlignmentI maxLength++; + int cLength; for (int i = 0; i < sequences.size(); i++) { current = getSequenceAt(i); + cLength = current.getLength(); - if (current.getLength() < maxLength) + if (cLength < maxLength) { - current.insertCharAt(maxLength - 1, gapCharacter); + current.insertCharAt(cLength, + maxLength-cLength, gapCharacter); modified=true; } else if(current.getLength() > maxLength) -- 1.7.10.2