From 108d9a136d1794445f2169c04d80b7662085390d Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 9 Aug 2006 16:19:24 +0000 Subject: [PATCH] refactored hidden regions methods and made an AlignmentView preserve the alignment in hidden regions. --- src/jalview/datamodel/AlignmentView.java | 5 +- src/jalview/datamodel/CigarArray.java | 28 ++++++++--- src/jalview/datamodel/CigarBase.java | 81 ++++++++++++++++++++++++++++-- src/jalview/datamodel/CigarSimple.java | 1 + src/jalview/datamodel/SeqCigar.java | 39 ++++++-------- 5 files changed, 119 insertions(+), 35 deletions(-) diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index 15309b7..727bc76 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -23,7 +23,8 @@ public class AlignmentView { if (!seqcigararray.isSeqCigarArray()) throw new Error("Implementation Error - can only make an alignment view from a CigarArray of sequences."); - contigs = seqcigararray.applyDeletions(); + //contigs = seqcigararray.applyDeletions(); + contigs = seqcigararray.getDeletedRegions(); sequences = seqcigararray.getSeqCigarArray(); } @@ -49,7 +50,7 @@ public class AlignmentView public Object[] getAlignmentAndColumnSelection(char gapCharacter) { ColumnSelection colsel = new ColumnSelection(); - return new Object[] { SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel), colsel}; + return new Object[] { SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel, contigs), colsel}; } /** * getSequenceStrings diff --git a/src/jalview/datamodel/CigarArray.java b/src/jalview/datamodel/CigarArray.java index b8cdf52..33e91a8 100644 --- a/src/jalview/datamodel/CigarArray.java +++ b/src/jalview/datamodel/CigarArray.java @@ -118,7 +118,7 @@ public class CigarArray extends CigarBase * applyDeletions * edits underlying refCigars to propagate deleted regions, and removes deletion * operations from CigarArray operation list. - * @return int[] position where deletion occured in cigarArray or null if none occured + * @return int[] position after deletion occured and range of deletion in cigarArray or null if none occured */ public int[] applyDeletions() { @@ -127,31 +127,45 @@ public class CigarArray extends CigarBase return null; int cursor=0; // range counter for deletions int vcursor=0; // visible column index - for (int i=0; i