X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSeqCigar.java;h=84da27877cbb7fdb0684c4c9d3c15b09324a4361;hb=6d1bf1ef4e1af507f9e6f2393cf35cde82a1314a;hp=0203383cba18c117d2171b01d3ce196b094a20ce;hpb=108d9a136d1794445f2169c04d80b7662085390d;p=jalview.git diff --git a/src/jalview/datamodel/SeqCigar.java b/src/jalview/datamodel/SeqCigar.java index 0203383..84da278 100644 --- a/src/jalview/datamodel/SeqCigar.java +++ b/src/jalview/datamodel/SeqCigar.java @@ -1,3 +1,21 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ package jalview.datamodel; import jalview.analysis.*; @@ -62,10 +80,11 @@ public class SeqCigar throw new Error( "Implementation Error - unexpected null from getSequenceAndDeletions"); } - + int bounds[] = (int[]) edit_result[1]; seq = new Sequence(refseq.getName(), (String) edit_result[0], - refseq.getStart() + start+( (int[]) edit_result[1])[0], - refseq.getStart() + start+( (int[]) edit_result[1])[2]); + refseq.getStart() + start+bounds[0], + refseq.getStart() + start+((bounds[2]==0) ? -1 : bounds[2])); + // seq.checkValidRange(); probably not needed seq.setDatasetSequence(refseq); return seq; } @@ -416,16 +435,14 @@ public class SeqCigar SequenceI ref = alseqs[i].getRefSeq(); seqs[i] = new Sequence(ref.getName(), g_seqs[i].toString(), ref.getStart() + alseqs[i].start+bounds[0], - ref.getStart() + alseqs[i].start+bounds[2]); + ref.getStart() + alseqs[i].start+(bounds[2]==0 ? -1 : bounds[2])); seqs[i].setDatasetSequence(ref); } if (segments!=null) { - int delshift=0; // need to shift the segments to their absolute positions in the sequence cigar frame. for (int i=0; i