X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSeqCigar.java;h=7363e9ef334537956f1fc4d517d25b8ebae2e986;hb=3d9d1f6c1c1da3b2657f9ebb95430d0bc8dde873;hp=3366dcd75ad3f98ca6c4dc640be1eccda2fe858d;hpb=cb0b6d61c64714d571e89bc7f229a2c3626b4bdb;p=jalview.git diff --git a/src/jalview/datamodel/SeqCigar.java b/src/jalview/datamodel/SeqCigar.java index 3366dcd..7363e9e 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.*; @@ -41,7 +59,7 @@ public class SeqCigar public String getSequenceString(char GapChar) { return (length == 0) ? "" : - (String) getSequenceAndDeletions(refseq.getSequence().substring(start, end), GapChar)[0]; + (String) getSequenceAndDeletions(refseq.getSequenceAsString(start, end), GapChar)[0]; } /** @@ -55,7 +73,7 @@ public class SeqCigar { return null; } - Object[] edit_result = getSequenceAndDeletions(refseq.getSequence().substring(start,end), + Object[] edit_result = getSequenceAndDeletions(refseq.getSequenceAsString(start,end), GapChar); if (edit_result == null) { @@ -68,6 +86,7 @@ public class SeqCigar refseq.getStart() + start+((bounds[2]==0) ? -1 : bounds[2])); // seq.checkValidRange(); probably not needed seq.setDatasetSequence(refseq); + seq.setDescription(refseq.getDescription()); return seq; } @@ -95,7 +114,7 @@ public class SeqCigar } if (_s<0) throw new Error("Implementation Error: _s="+_s); - String seq_string = seq.getSequence(); + String seq_string = seq.getSequenceAsString(); if (_e==0 || _e<_s || _e>seq_string.length()) _e=seq_string.length(); // resolve start and end positions relative to ungapped reference sequence @@ -357,7 +376,7 @@ public class SeqCigar for (int i = 0; i < alseqs.length; i++) { alseqs_string[i]=alseqs[i].getRefSeq(). - getSequence().substring(alseqs[i].start,alseqs[i].end); + getSequenceAsString(alseqs[i].start,alseqs[i].end); gs_regions[i] = alseqs[i].getSequenceAndDeletions(alseqs_string[i], gapCharacter); // gapped sequence, {start, start col, end. endcol}, hidden regions {{start, end, col}}) if (gs_regions[i] == null) { @@ -419,6 +438,7 @@ public class SeqCigar ref.getStart() + alseqs[i].start+bounds[0], ref.getStart() + alseqs[i].start+(bounds[2]==0 ? -1 : bounds[2])); seqs[i].setDatasetSequence(ref); + seqs[i].setDescription(ref.getDescription()); } if (segments!=null) { for (int i=0; i