From 227721bfd3cf27e014849a9b0dc8702f7661fb78 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Wed, 15 Jan 2020 14:14:37 -0500
Subject: [PATCH] fix sequence creation from hierarchy

---
 src/mol-model/structure/model/properties/sequence.ts | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mol-model/structure/model/properties/sequence.ts b/src/mol-model/structure/model/properties/sequence.ts
index aa0970fad..1e8b787b0 100644
--- a/src/mol-model/structure/model/properties/sequence.ts
+++ b/src/mol-model/structure/model/properties/sequence.ts
@@ -69,11 +69,10 @@ namespace StructureSequence {
             cI--;
 
             const rStart = residueAtomSegments.index[offsets[start]];
-            const rEnd = residueAtomSegments.index[offsets[cI + 1]];
+            const rEnd = residueAtomSegments.index[offsets[cI + 1] - 1] + 1;
 
             const compId = Column.window(label_comp_id, rStart, rEnd);
             const num = Column.window(label_seq_id, rStart, rEnd);
-
             byEntityKey[entityKey] = {
                 entityId: entities.data.id.value(entityKey),
                 sequence: Sequence.ofResidueNames(compId, num, modResMap)
@@ -115,7 +114,7 @@ namespace StructureSequence {
             cI--;
 
             const eStart = offsets[start];
-            const eEnd = offsets[cI + 1];
+            const eEnd = offsets[cI + 1] - 1;
 
             const seqIdBegin = Column.window(seq_id_begin, eStart, eEnd);
             const seqIdEnd = Column.window(seq_id_end, eStart, eEnd);
-- 
GitLab