diff --git a/src/mol-model/structure/query/queries/atom-set.ts b/src/mol-model/structure/query/queries/atom-set.ts index ffa96741ce916a4f7d90f5ef75b61fa331c04214..52c26570cd8dd7a8e7c80d7afd0b68f29b18c60f 100644 --- a/src/mol-model/structure/query/queries/atom-set.ts +++ b/src/mol-model/structure/query/queries/atom-set.ts @@ -86,9 +86,9 @@ export function pick(env: Environment, selection: Selection, pred: Expression<bo -//export function atomCount(env: Environment) { - // return AtomSet.count(env.slots.atomSet); -//} +// export function atomCount(env: Environment) { +// return AtomSet.count(env.slots.atomSet); +// } /* export function atomCount(ctx: QueryContext) { @@ -109,12 +109,12 @@ export function atomCount(ctx: QueryContext) { } -//export function atomCount(ctx: QueryContext) { +// export function atomCount(ctx: QueryContext) { // return (ctx: any) => { // const x: number = StructureSelection.structureCount(ctx); // return x; // }; -//} +// } // export function countQuery(env: Environment, query: Expression<AtomSelection>) { // const sel = query(Environment(Context.ofAtomSet(env.context, env.slots.atomSet))) @@ -122,7 +122,7 @@ export function atomCount(ctx: QueryContext) { // } export function countQuery(ctx: QueryContext, query: StructureQuery) { - return (ctx : QueryContext) => { + return (ctx: QueryContext) => { const sel = query(ctx); const x: number = StructureSelection.structureCount(sel); return x; @@ -131,11 +131,11 @@ export function countQuery(ctx: QueryContext, query: StructureQuery) { export function propertySet(ctx: QueryContext, prop: UnitTypeProperties) { - return (ctx : QueryContext) => { - const set = new Set(); - const x = getCurrentStructureProperties(ctx, prop, set); -// console.log(x) - return x; + return (ctx: QueryContext) => { + const set = new Set(); + const x = getCurrentStructureProperties(ctx, prop, set); + // console.log(x) + return x; }; } diff --git a/src/mol-model/structure/query/queries/filters.ts b/src/mol-model/structure/query/queries/filters.ts index 5c989134a3c1092fab1e9733fbd72a7a2545dec9..6dd33397059740f1bab6e5a2737a53ed9682e234 100644 --- a/src/mol-model/structure/query/queries/filters.ts +++ b/src/mol-model/structure/query/queries/filters.ts @@ -86,10 +86,10 @@ function getCurrentStructurePropertiesInternal(ctx: QueryContext, props: QueryFn l.unit = unit; const elements = unit.elements; - let fn = props -// if (Unit.isAtomic(unit)) fn = props.atomic; -// else fn = props.coarse; -// if (!fn) continue; + const fn = props; + // if (Unit.isAtomic(unit)) fn = props.atomic; + // else fn = props.coarse; + // if (!fn) continue; for (let j = 0, _j = elements.length; j < _j; j++) { l.element = elements[j]; diff --git a/src/mol-script/runtime/query/table.ts b/src/mol-script/runtime/query/table.ts index 411084e311ac46f752252bce006e1cf178b42fea..6605d7d33b10c7f35285327142bb7a88a89f69de 100644 --- a/src/mol-script/runtime/query/table.ts +++ b/src/mol-script/runtime/query/table.ts @@ -362,25 +362,25 @@ const symbols = [ // D(MolScript.structureQuery.combinator.merge, (ctx, xs) => Queries.combinators.merge(xs as any)(ctx)), D(MolScript.structureQuery.atomSet.atomCount, function structureQuery_atomset_atomCount(ctx, xs) { -// console.log('From atomCount'); -// console.log(Queries.atomset.atomCount(ctx)(ctx)); + // console.log('From atomCount'); + // console.log(Queries.atomset.atomCount(ctx)(ctx)); return Queries.atomset.atomCount(ctx)(ctx); }), D(MolScript.structureQuery.atomSet.countQuery, function structureQuery_atomset_countQuery(ctx, xs) { -// console.log('From countQuery'); -// console.log(Queries.atomset.countQuery(ctx, xs[0] as any)(ctx)); + // console.log('From countQuery'); + // console.log(Queries.atomset.countQuery(ctx, xs[0] as any)(ctx)); return Queries.atomset.countQuery(ctx, xs[0] as any)(ctx); }), // env, v[0](env) D(MolScript.structureQuery.atomSet.propertySet, - function structureQuery_atomset_propertySet(ctx, xs) { + function structureQuery_atomset_propertySet(ctx, xs) { return Queries.atomset.propertySet(ctx, xs[0] as any)(ctx); - }), + }), // D(MolScript.structureQuery.filter.withSameAtomProperties, (ctx, xs) => Queries.filters.withSameAtomProperties(xs[0] as any, xs['source'] as any, xs['property'] as any)(ctx)), diff --git a/src/mol-script/transpilers/jmol/parser.ts b/src/mol-script/transpilers/jmol/parser.ts index 31e524f73832d4efc1cc16222b69a1a99a3e7bde..ca67b5265de14aedb69a9881ee028f4b5573d014 100644 --- a/src/mol-script/transpilers/jmol/parser.ts +++ b/src/mol-script/transpilers/jmol/parser.ts @@ -33,20 +33,20 @@ const valueOperators: OperatorList = [ type: h.binaryLeft, rule: P.MonadicParser.regexp(/\s*(LIKE|>=|<=|=|!=|>|<)\s*/i, 1), map: (op, e1, e2) => { - console.log(op, e1, e2) + console.log(op, e1, e2); let expr; if (e1 === 'structure') { expr = B.core.flags.hasAny([B.ammp('secondaryStructureFlags'), structureMap(e2)]); } else if (e2 === 'structure') { expr = B.core.flags.hasAny([B.ammp('secondaryStructureFlags'), structureMap(e1)]); - } else if (e1.head !== undefined){ - if (e1.head.name === 'core.type.regex') { + } else if (e1.head !== undefined) { + if (e1.head.name === 'core.type.regex') { expr = B.core.str.match([e1, B.core.type.str([e2])]); - } - } else if (e2.head !== undefined){ - if (e2.head.name === 'core.type.regex') { + } + } else if (e2.head !== undefined) { + if (e2.head.name === 'core.type.regex') { expr = B.core.str.match([e2, B.core.type.str([e1])]); - } + } } else if (op.toUpperCase() === 'LIKE') { if (e1.head) { expr = B.core.str.match([ diff --git a/src/mol-script/transpilers/rasmol/parser.ts b/src/mol-script/transpilers/rasmol/parser.ts index ba3ff595da142ce165b9c36046c1a3afb55bd16f..58d0bf978f774a89722842e3d7693771e55c180f 100644 --- a/src/mol-script/transpilers/rasmol/parser.ts +++ b/src/mol-script/transpilers/rasmol/parser.ts @@ -39,14 +39,14 @@ const valueOperators: OperatorList = [ expr = B.core.flags.hasAny([B.ammp('secondaryStructureFlags'), structureMap(e2)]); } else if (e2 === 'structure') { expr = B.core.flags.hasAny([B.ammp('secondaryStructureFlags'), structureMap(e1)]); - } else if (e1.head !== undefined){ - if (e1.head.name === 'core.type.regex') { + } else if (e1.head !== undefined) { + if (e1.head.name === 'core.type.regex') { expr = B.core.str.match([e1, B.core.type.str([e2])]); - } - } else if (e2.head !== undefined){ - if (e2.head.name === 'core.type.regex') { + } + } else if (e2.head !== undefined) { + if (e2.head.name === 'core.type.regex') { expr = B.core.str.match([e2, B.core.type.str([e1])]); - } + } } else if (op.toUpperCase() === 'LIKE') { if (e1.head) { expr = B.core.str.match([ diff --git a/src/mol-script/transpilers/vmd/parser.ts b/src/mol-script/transpilers/vmd/parser.ts index bf65a6bc825c473a536181eee5e64cfd32d1e788..b5760a257be5ca1eb891a11aa16c8c6ba4b9279c 100644 --- a/src/mol-script/transpilers/vmd/parser.ts +++ b/src/mol-script/transpilers/vmd/parser.ts @@ -57,30 +57,30 @@ const valueOperators: OperatorList = [ type: h.binaryLeft, rule: P.MonadicParser.alt(P.MonadicParser.regexp(/\s*(=~|==|>=|<=|=|!=|>|<)\s*/, 1), P.MonadicParser.whitespace.result('=')), map: (op, e1, e2) => { -// console.log(e1.head !== undefined && e2.head !==undefined) - console.log(op, e1, e2) + // console.log(e1.head !== undefined && e2.head !==undefined) + console.log(op, e1, e2); let expr; - if (e1.head !== undefined){ - if (e1.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') { + if (e1.head !== undefined) { + if (e1.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') { expr = B.core.flags.hasAny([e1, sstrucMap(e2)]); - } - if (e1.head.name === 'core.type.regex') { + } + if (e1.head.name === 'core.type.regex') { expr = B.core.str.match([e1, B.core.type.str([e2])]); - } - }else if (e2.head !== undefined){ - if (e2.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') { + } + } else if (e2.head !== undefined) { + if (e2.head.name === 'structure-query.atom-property.macromolecular.secondary-structure-flags') { expr = B.core.flags.hasAny([e2, sstrucMap(e1)]); - } - if (e2.head.name === 'core.type.regex') { + } + if (e2.head.name === 'core.type.regex') { expr = B.core.str.match([e2, B.core.type.str([e1])]); - } - }else if (op === '=~') { + } + } else if (op === '=~') { if (e1.head) { expr = B.core.str.match([ B.core.type.regex([`^${e2}$`, 'i']), B.core.type.str([e1]) ]); - }else{ + } else { expr = B.core.str.match([ B.core.type.regex([`^${e1}$`, 'i']), B.core.type.str([e2])