Skip to content
Snippets Groups Projects
Commit bf67546a authored by Alexander Rose's avatar Alexander Rose
Browse files

Merge branch 'master' of https://github.com/molstar/molstar into pr/corredD/252

parents 80d54afd 8c417ef3
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 59 deletions
......@@ -48,7 +48,13 @@
"prefer-const": ["error", {
"destructuring": "all",
"ignoreReadBeforeAssign": false
}]
}],
"space-before-function-paren": "off",
"func-call-spacing": "off",
"no-multi-spaces": "error",
"block-spacing": "error",
"keyword-spacing": "off",
"space-before-blocks": "error"
},
"overrides": [
{
......@@ -99,7 +105,14 @@
"error",
"1tbs", { "allowSingleLine": true }
],
"@typescript-eslint/comma-spacing": "error"
"@typescript-eslint/comma-spacing": "error",
"@typescript-eslint/space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}],
"@typescript-eslint/func-call-spacing": ["error"],
"@typescript-eslint/keyword-spacing": ["error"]
}
}
]
......
......@@ -115,10 +115,9 @@ async function getStructure(plugin: PluginContext, model: Model, source: Ingredi
}
let query;
if (source.source.selection) {
let sel: any = source.source.selection;
const sel = source.source.selection;
// selection can have the model ID as well. remove it
const asymIds: string[] = sel.replaceAll(' ', '').replaceAll(':', '').split('or').slice(1);
// console.log("selection is ", source.selection, asymIds);
const asymIds: string[] = sel.replace(/ /g, '').replace(/:/g, '').split('or').slice(1);
query = MS.struct.modifier.union([
MS.struct.generator.atomGroups({
'chain-test': MS.core.set.has([MS.set(...asymIds), MS.ammp('auth_asym_id')])
......@@ -351,7 +350,7 @@ async function getIngredientStructure(plugin: PluginContext, ingredient: Ingredi
structure = await getStructure(plugin, model, ingredient, { assembly: bu });
// transform with offset and pcp
let legacy: boolean = true;
let pcp = ingredient.principalVector ? ingredient.principalVector : ingredient.principalAxis;
const pcp = ingredient.principalVector ? ingredient.principalVector : ingredient.principalAxis;
if (pcp) {
legacy = false;
const structureMean = getStructureMean(structure);
......@@ -360,7 +359,7 @@ async function getIngredientStructure(plugin: PluginContext, ingredient: Ingredi
Mat4.setTranslation(m1, structureMean);
structure = Structure.transform(structure, m1);
if (ingredient.offset) {
let o: Vec3 = Vec3.create(ingredient.offset[0], ingredient.offset[1], ingredient.offset[2]);
const o: Vec3 = Vec3.create(ingredient.offset[0], ingredient.offset[1], ingredient.offset[2]);
if (!Vec3.exactEquals(o, Vec3.zero())) { // -1, 1, 4e-16 ??
if (location !== 'surface') {
Vec3.negate(o, o);
......@@ -371,7 +370,7 @@ async function getIngredientStructure(plugin: PluginContext, ingredient: Ingredi
}
}
if (pcp) {
let p: Vec3 = Vec3.create(pcp[0], pcp[1], pcp[2]);
const p: Vec3 = Vec3.create(pcp[0], pcp[1], pcp[2]);
if (!Vec3.exactEquals(p, Vec3.unitZ)) {
const q: Quat = Quat.identity();
Quat.rotationTo(q, p, Vec3.unitZ);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment