X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequence.java;h=293528d13c186a1ef6db43720f0e8b615e0d4be1;hb=e015538903c8cabb2b90dd030e3e0c419a730db9;hp=76704523bdb63ab4eb50cb3e2bf8f9ac96a3ea9d;hpb=2de8acfae59aced665e4c37ad0f7dcc2ed68818e;p=jalview.git
diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java
index 7670452..293528d 100755
--- a/src/jalview/datamodel/Sequence.java
+++ b/src/jalview/datamodel/Sequence.java
@@ -1,26 +1,26 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, 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 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 file is part of Jalview.
*
- * 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.
+ * 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.
*
- * 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 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