Compare commits

...

3 Commits

Author SHA1 Message Date
dsehnal
4484a4452c 2.3.5 2021-10-19 18:22:50 +02:00
dsehnal
65b654a0a2 fix index pair bonds order assignment 2021-10-19 18:20:54 +02:00
dsehnal
a8e0c13b0e fix sequence viewer for PDB files with COMPND record and multichain entities 2021-10-17 13:21:57 +02:00
5 changed files with 35 additions and 6 deletions

View File

@@ -6,6 +6,11 @@ Note that since we don't clearly distinguish between a public and private interf
## [Unreleased]
## [v2.3.5] - 2021-10-19
- Fix sequence viewer for PDB files with COMPND record and multichain entities.
- Fix index pair bonds order assignment
## [v2.3.4] - 2021-10-12
- Fix pickScale not taken into account in line/point shader

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "molstar",
"version": "2.3.4",
"version": "2.3.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

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

View File

@@ -25,7 +25,7 @@ export function parseCmpnd(lines: Tokens, lineStart: number, lineEnd: number) {
let currentSpec: Spec | undefined;
let currentCompound: EntityCompound = { chains: [], description: '' };
const Compounds: EntityCompound[] = [];
const compounds: EntityCompound[] = [];
for (let i = lineStart; i < lineEnd; i++) {
const line = getLine(i);
@@ -55,7 +55,7 @@ export function parseCmpnd(lines: Tokens, lineStart: number, lineEnd: number) {
chains: [],
description: ''
};
Compounds.push(currentCompound);
compounds.push(currentCompound);
} else if (currentSpec === 'MOLECULE') {
if (currentCompound.description) currentCompound.description += ' ';
currentCompound.description += value;
@@ -64,7 +64,31 @@ export function parseCmpnd(lines: Tokens, lineStart: number, lineEnd: number) {
}
}
return Compounds;
// Define a seprate entity for each chain
// --------------------------------------
//
// This is a workaround for how sequences are currently determined for PDB files.
//
// The current approach infers the "observed sequence" from the atomic hierarchy.
// However, for example for PDB ID 3HHR, this approach fails, since chains B and C
// belong to the same entity but contain different observed sequence, which causes display
// errors in the sequence viewer (since the sequences are determined "per entity").
//
// A better approach could be to parse SEQRES categories and use it to construct
// entity_poly_seq category. However, this would require constructing label_seq_id (with gaps)
// from RES ID pdb column (auth_seq_id), which isn't a trivial exercise.
//
// (properly formatted) mmCIF structures do not exhibit this issue.
const singletons: EntityCompound[] = [];
for (const comp of compounds) {
for (const chain of comp.chains) {
singletons.push({
description: comp.description,
chains: [chain]
});
}
}
return singletons;
}
export function parseHetnam(lines: Tokens, lineStart: number, lineEnd: number) {

View File

@@ -79,7 +79,7 @@ function findIndexPairBonds(unit: Unit.Atomic) {
if ((d !== -1 && equalEps(dist, d, 0.5)) || dist < maxDistance) {
atomA[atomA.length] = _aI;
atomB[atomB.length] = _bI;
orders[order.length] = order[i];
orders[orders.length] = order[i];
flags[flags.length] = flag[i];
}
}