Compare commits

..

6 Commits

Author SHA1 Message Date
Alexander Rose
d4ba13a2f2 2.0.0-dev.6 2021-03-07 01:22:30 -08:00
Alexander Rose
3b25e037aa remove obsolete viewer query params 2021-03-07 01:18:37 -08:00
Alexander Rose
189fad3d84 better handle focus on structure update
- fixes #123
2021-03-07 00:30:35 -08:00
Alexander Rose
c3c22ee3bc fix typos in xyz format 2021-03-06 23:39:12 -08:00
Alexander Rose
8a3222005c fix calculated label_seq_id 2021-03-06 23:38:21 -08:00
Alexander Rose
a17da36410 coarse grained tweaks
- coarse grained if less than three times as many atoms as polymer residues
- don't try dssp if coarse grained
2021-03-06 23:37:48 -08:00
8 changed files with 12 additions and 12 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "molstar",
"version": "2.0.0-dev.5",
"version": "2.0.0-dev.6",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@@ -1,6 +1,6 @@
{
"name": "molstar",
"version": "2.0.0-dev.5",
"version": "2.0.0-dev.6",
"description": "A comprehensive macromolecular library.",
"homepage": "https://github.com/molstar/molstar#readme",
"repository": {

View File

@@ -48,9 +48,6 @@
var debugMode = getParam('debug-mode', '[^&]+').trim() === '1';
if (debugMode) molstar.setDebugMode(debugMode, debugMode);
var disableAntialiasing = getParam('disable-antialiasing', '[^&]+').trim() === '1';
var pixelScale = parseFloat(getParam('pixel-scale', '[^&]+').trim() || '1');
var disableWboit = getParam('disable-wboit', '[^&]+').trim() === '1';
var hideControls = getParam('hide-controls', '[^&]+').trim() === '1';
var pdbProvider = getParam('pdb-provider', '[^&]+').trim().toLowerCase();
var emdbProvider = getParam('emdb-provider', '[^&]+').trim().toLowerCase();

View File

@@ -74,7 +74,7 @@ function createHierarchyData(atom_site: AtomSite, sourceIndex: Column<number>, o
let cI = 0;
let seqId = 0;
for (let i = 0, il = seqIds.length; i < il; ++i) {
if (residueOffsets[i] > chainOffsets[cI + 1]) {
if (residueOffsets[i] >= chainOffsets[cI + 1]) {
cI += 1;
seqId = 0;
}

View File

@@ -84,7 +84,7 @@ function getModels(mol: XyzFile, ctx: RuntimeContext) {
atom_site
});
return createModels(basics, MolFormat.create(mol), ctx);
return createModels(basics, XyzFormat.create(mol), ctx);
}
//
@@ -93,9 +93,9 @@ export { XyzFormat };
type XyzFormat = ModelFormat<XyzFile>
namespace MolFormat {
namespace XyzFormat {
export function is(x?: ModelFormat): x is XyzFormat {
return x?.kind === 'mol';
return x?.kind === 'xyz';
}
export function create(mol: XyzFile): XyzFormat {

View File

@@ -69,7 +69,7 @@ async function computeDssp(structure: Structure, props: DSSPComputationProps): P
const map = new Map<number, SecondaryStructure>();
for (let i = 0, il = structure.unitSymmetryGroups.length; i < il; ++i) {
const u = structure.unitSymmetryGroups[i].units[0];
if (Unit.isAtomic(u)) {
if (Unit.isAtomic(u) && !Model.isCoarseGrained(u.model)) {
const secondaryStructure = await computeUnitDSSP(u, props);
map.set(u.invariantId, secondaryStructure);
}

View File

@@ -227,7 +227,7 @@ export namespace Model {
const CoarseGrainedProp = '__CoarseGrained__';
/**
* Has typical coarse grained atom names (BB, SC1) or less than twice as many
* Has typical coarse grained atom names (BB, SC1) or less than three times as many
* atoms as polymer residues (C-alpha only models).
*/
export function isCoarseGrained(model: Model): boolean {
@@ -251,7 +251,7 @@ export namespace Model {
const coarseGrained = (hasBB && hasSC1) || (
polymerResidueCount && atomCount
? atomCount / polymerResidueCount < 2
? atomCount / polymerResidueCount < 3
: false
);
model._staticPropertyData[CoarseGrainedProp] = coarseGrained;

View File

@@ -164,7 +164,10 @@ export class StructureFocusManager extends StatefulPluginComponent<StructureFocu
plugin.state.data.events.object.updated.subscribe(({ oldData, obj, action }) => {
if (!PluginStateObject.Molecule.Structure.is(obj)) return;
// structure NOT changed, keep everything as is; fixes #123
if (oldData === obj.data) return;
// structure changed (e.g. coordinates), try to remap and re-focus
if (action === 'in-place') {
const current = this.state.current;
const structure = obj.data as Structure;