From aa2899bfbde177873bc12449dba11c08176c8544 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Sun, 21 Jun 2020 18:54:10 -0700
Subject: [PATCH] fix sequence label for non-standard residues, #70

---
 docs/interesting-pdb-entries.md    | 9 ++++++---
 src/mol-model/sequence/sequence.ts | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/interesting-pdb-entries.md b/docs/interesting-pdb-entries.md
index 9912d58d4..a4a01e66b 100644
--- a/docs/interesting-pdb-entries.md
+++ b/docs/interesting-pdb-entries.md
@@ -10,8 +10,8 @@
     * GFP chromophores (5Z6Y)
 * Nucleotides that don’t have a parent base set, i.e. detect purine/pyrimidine from geometry (THX in 1AUL, OMC in e.g. 5D3G)
 * Bases with modified ring atoms
-    * DZ has C1 instead of N1 (e.g. 5I4N)
-    * DP has N5 instead of C5 and C7 instead of N7 (e.g. 5I4N)
+    * DZ has C1 instead of N1 (e.g. 6I4N)
+    * DP has N5 instead of C5 and C7 instead of N7 (e.g. 6I4N)
 * Beta & Gamma peptides (e.g. 1GAC, 6PQF)
 * Mixed (heterogeneous) all-atom/trace-only RNA model (1JGQ)
 * Polymers with residues with missing trace atoms (e.g. 2QFJ)
@@ -21,4 +21,7 @@
 * DNA (2np2, 1d66)
 * C-alpha only (2rcj)
 * Not cyclic, but termini are backbone-only and within distance but seqIds are not compatible (6SW3)
-* Close backbone atoms but not linked (e.g. 4HIV)
\ No newline at end of file
+* Close backbone atoms but not linked (e.g. 4HIV)
+* Non-standard residues
+    * Protein (1BRR, 5Z6Y)
+    * DNA (5D3G)
\ No newline at end of file
diff --git a/src/mol-model/sequence/sequence.ts b/src/mol-model/sequence/sequence.ts
index 198911355..722da04fc 100644
--- a/src/mol-model/sequence/sequence.ts
+++ b/src/mol-model/sequence/sequence.ts
@@ -137,7 +137,7 @@ namespace Sequence {
                     });
                     labels[i] = `(${l.join('|')})`;
                 } else {
-                    labels[i] = codes[i] === 'X' ? compIds[idx] : codes[i];
+                    labels[i] = codes[i] === 'X' ? compIds[i] : codes[i];
                 }
             }
 
-- 
GitLab