*/\r
package jalview.datamodel;\r
\r
-import MCview.*;\r
-\r
import jalview.analysis.*;\r
\r
import java.awt.*;\r
*/\r
public Sequence(String name, String sequence, int start, int end)\r
{\r
- this.name = name;\r
- this.sequence = sequence;\r
- this.start = start;\r
- this.end = end;\r
+ this.name = name;\r
+ this.sequence = sequence;\r
+ this.start = start;\r
+ this.end = end;\r
+\r
+ if (end < 1)\r
+ {\r
+ int endRes = 0;\r
+ char ch;\r
+ for (int j = 0; j < sequence.length(); j++)\r
+ {\r
+ ch = sequence.charAt(j);\r
+ if (!jalview.util.Comparison.isGap( (ch)))\r
+ {\r
+ endRes++;\r
+ }\r
+ }\r
+ if (endRes > 0)\r
+ {\r
+ endRes += start - 1;\r
+ }\r
+\r
+ this.end = endRes;\r
+ }\r
\r
setDisplayId();\r
}\r