From: amwaterhouse Date: Fri, 27 Oct 2006 16:13:57 +0000 (+0000) Subject: New padgaps works out number of gaps to insert, delete X-Git-Tag: Release_2_2~207 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=52f42d57f0f08942ce54e3a739f1c9936cc5f293;p=jalview.git New padgaps works out number of gaps to insert, delete --- 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)