X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=cc541be40ef6f5d934d590e39d6609ee0155ff79;hb=7a4781bea6b4b598a31c3abb9deebd415754eaec;hp=722edf21259bf2076967cd4906072f78d57fd7e6;hpb=45d4eb5f2d3772ac51e2512d49fb0a3a958f2260;p=jalview.git diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 722edf2..cc541be 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, 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