X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=21b877d4083609affa599393782ab5f92ad741a6;hb=e33b171845992fd21094ba754498f9ab3d29f110;hp=3240f843b243b378d17bfc056bee572d3cc8517d;hpb=e1c9c652059a67ee96f9fc5f6617fd5d604cbdbb;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 3240f84..21b877d 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1,26 +1,26 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 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 + * 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. + * + * Jalview 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 3 of the License, or (at your option) any later version. + * + * Jalview 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 Jalview. If not, see . */ package jalview.datamodel; -import java.util.*; +import jalview.analysis.AlignSeq; -import jalview.analysis.*; +import java.util.Enumeration; +import java.util.Vector; /** * @@ -54,6 +54,11 @@ public class Sequence implements SequenceI * to the residues of this sequence */ Vector annotation; + + /** + * The index of the sequence in a MSA + */ + int index = -1; /** array of seuqence features - may not be null for a valid sequence object */ public SequenceFeature[] sequenceFeatures; @@ -62,14 +67,14 @@ public class Sequence implements SequenceI * Creates a new Sequence object. * * @param name - * display name string + * display name string * @param sequence - * string to form a possibly gapped sequence out of + * string to form a possibly gapped sequence out of * @param start - * first position of non-gap residue in the sequence + * first position of non-gap residue in the sequence * @param end - * last position of ungapped residues (nearly always only used - * for display purposes) + * last position of ungapped residues (nearly always only used for + * display purposes) */ public Sequence(String name, String sequence, int start, int end) { @@ -117,7 +122,7 @@ public class Sequence implements SequenceI void checkValidRange() { - if (end < 1) + // Note: JAL-774 : http://issues.jalview.org/browse/JAL-774?focusedCommentId=11239&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-11239 { int endRes = 0; for (int j = 0; j < sequence.length; j++) @@ -132,7 +137,9 @@ public class Sequence implements SequenceI endRes += start - 1; } - this.end = endRes; + if (end