mirror of
https://github.com/molstar/molstar.git
synced 2026-06-05 14:04:36 +08:00
Compare commits
6 Commits
v2.0.0-dev
...
v2.0.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4ba13a2f2 | ||
|
|
3b25e037aa | ||
|
|
189fad3d84 | ||
|
|
c3c22ee3bc | ||
|
|
8a3222005c | ||
|
|
a17da36410 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "molstar",
|
||||
"version": "2.0.0-dev.5",
|
||||
"version": "2.0.0-dev.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user