Browse Source

Updated rasmol parser and spec

yakomaxa 2 years ago
parent
commit
655b334b0a

+ 4 - 2
src/mol-script/transpilers/_spec/rasmol.spec.ts

@@ -32,10 +32,12 @@ const general = {
         'within (   5 ,  [HEM] ) ',
         // un-braketed residue name
         'LEU and ILE',
+        // un-parenthesized residue index range
+        '100-120,220',
+        // un-parenthesized residue index
+        '20',
     ],
     unsupported: [
-        // un-parenthesized residue index
-        '100-120',
         // within in the head or the middle of sentence
         'within (   5 ,  [HEM] ) and backbone',
     ]

+ 1 - 3
src/mol-script/transpilers/rasmol/parser.ts

@@ -92,12 +92,10 @@ function atomExpressionQuery(x: any[]) {
     }
 
     const resnoRangeProps: any = [];
-    console.log(resnorange);
     if (resnorange) {
         resnorange.forEach((x: number) =>{
             resnoRangeProps.push(B.core.rel.eq([B.ammp('auth_seq_id'), x]));
         });
-        console.log(resnoRangeProps);
     };
     if (resnoRangeProps.length) tests['residue-test'] = h.orExpr(resnoRangeProps);
 
@@ -127,7 +125,7 @@ const lang = P.MonadicParser.createLanguage({
             r.Parens,
             r.Operator,
             r.Expression
-        ).wrap(P.MonadicParser.string('('), P.MonadicParser.string(')'));
+        ).wrap(P.MonadicParser.regexp(/\(\s*/), P.MonadicParser.regexp(/\s*\)/));
     },
 
     Expression: function (r: any) {