X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentView.java;h=8e596ceca355d76c01c33a364ebdb45fb6af9145;hb=34286266321abbbab6d462c39f500650f9c860c9;hp=e0d8d4478606f7c9af7f200278de925eaf626698;hpb=ea1129578da8007d62c540724d0856165181f8ec;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index e0d8d44..8e596ce 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -107,7 +107,7 @@ public class AlignmentView { Vector sel = selection.getSequences(null); this.selected = new Vector(); - selseqs = selection.getSequencesInOrder(alignment, false); + selseqs = selection.getSequencesInOrder(alignment, selectedRegionOnly); } else { @@ -150,6 +150,9 @@ public class AlignmentView { sg.setEndRes(esel); } + sg.setStartRes(sg.getStartRes()-ssel+1); + sg.setEndRes(sg.getEndRes()-ssel+1); + isg.addElement(sg); } } @@ -348,9 +351,14 @@ public class AlignmentView continue; } } + + // clone group properties + nsg[g] = new SequenceGroup(sg); + // may need to shift/trim start and end ? if (r && !viscontigs) { + // Not fully tested code - routine not yet called with viscontigs==false if (nsg[g].getStartRes() < gstart) { nsg[g].setStartRes(0); @@ -360,14 +368,11 @@ public class AlignmentView nsg[g].setStartRes(nsg[g].getStartRes() - gstart); nsg[g].setEndRes(nsg[g].getEndRes() - gstart); } - if (nsg[g].getEndRes() > gend) + if (nsg[g].getEndRes() > (gend-gstart)) { - nsg[g].setEndRes(gend); + nsg[g].setEndRes(gend-gstart); } } - - // clone group properties - nsg[g] = new SequenceGroup(sg); } if (viscontigs) { @@ -989,9 +994,13 @@ public class AlignmentView public static void summariseAlignmentView(AlignmentView view, PrintStream os) { - os.println("View has " + view.sequences.length + " of which " - + (view.selected == null ? "None" : view.selected.size()) - + " are selected."); + os.print("View has " + view.sequences.length + " of which "); + if (view.selected == null) { + os.print("None"); + } else { + os.print(" "+view.selected.size()); + } + os.println(" are selected."); os.print("View is " + view.getWidth() + " columns wide"); int viswid = 0; int[] contigs = view.getContigs();