X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=e4bc25e0910a0cab4b8057c01da79f5662729d88;hb=3193f6774b111974d609ea5d5adc95ff50f92b68;hp=86c140f0a8071566edb454d883f52c1e3b0caa0b;hpb=12aa3352bd2981b8aa86d9d28e4c405fa56a2c29;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 86c140f..e4bc25e 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -172,11 +172,17 @@ public class Alignment implements AlignmentI { return groups; } - /** Takes out columns consisting entirely of gaps (-,.," ") */ - public void removeGaps() - { + public void removeGaps() { + removeGaps((ShiftList)null); + } + /** + * remove gaps in alignment - recording any frame shifts in shiftrecord + * intended to be passed to ColumnSelection.compensateForEdits(shiftrecord) + * @param shiftrecord + */ + public void removeGaps(ShiftList shiftrecord) { SequenceI[] seqs = getVisibleAndRepresentedSeqs(); int j, jSize = seqs.length; @@ -219,6 +225,9 @@ public class Alignment implements AlignmentI if (!delete && startCol > -1) { deleteColumns(seqs, startCol, endCol); + if (shiftrecord!=null) { + shiftrecord.addShift(startCol, 1+endCol-startCol); + } width -= (endCol - startCol); i -= (endCol - startCol); startCol = -1; @@ -229,6 +238,9 @@ public class Alignment implements AlignmentI if (delete && startCol > -1) { deleteColumns(seqs, startCol, endCol); + if (shiftrecord!=null) { + shiftrecord.addShift(startCol, 1+endCol-startCol); + } } } @@ -394,8 +406,7 @@ public class Alignment implements AlignmentI while (i < sequences.size()) { - Sequence s = (Sequence)getSequenceAt(i); - s.hiddenSequences = null; + SequenceI s = getSequenceAt(i); s.setColor(java.awt.Color.white); i++; } @@ -406,9 +417,6 @@ public class Alignment implements AlignmentI { if (groups.contains(g)) { - //remove any hidden representatives - // for(int i=0; i