From 15317aa11b5099af82ec36e13a7ab5bc275dde2d Mon Sep 17 00:00:00 2001 From: yakomaxa <47655565+yakomaxa@users.noreply.github.com> Date: Sun, 21 Aug 2022 19:37:20 +0900 Subject: [PATCH] give pymol the ability to deal with negatively indexed residue numbering --- src/mol-script/transpilers/pymol/properties.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mol-script/transpilers/pymol/properties.ts b/src/mol-script/transpilers/pymol/properties.ts index 66279b481..71cc81ab5 100644 --- a/src/mol-script/transpilers/pymol/properties.ts +++ b/src/mol-script/transpilers/pymol/properties.ts @@ -37,7 +37,7 @@ function listOrRangeMap(x: string) { for (let i = min; i <= max; i++) { res.push(i); } - }else if (x.includes('-') && x.startsWith("-") && !x.match(/[0-9]+-[0-9]+/)) { + }else if (x.includes('-') && x.startsWith("-") && !x.match(/[0-9]+-[-0-9]+/)) { res.push(parseInt(x)); }else{ res.push(parseInt(x)); @@ -63,7 +63,7 @@ function listOrRangeMap(x: string) { for (let i = min; i <= max; i++) { res.push(i); } - }else if (x.startsWith("-") && !x.match(/[0-9]+-[0-9]+/)) { + }else if (x.startsWith("-") && !x.match(/[0-9]+-[-0-9]+/)) { res.push(parseInt(x)); }else{ res.push(parseInt(x)); -- GitLab