mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
add pdbx_structure_determination_methodology mmcif field and Model helpers
This commit is contained in:
@@ -16,6 +16,7 @@ Note that since we don't clearly distinguish between a public and private interf
|
||||
- Fix polymer-gap visual coloring with cartoon theme
|
||||
- Add formal-charge color theme (#328)
|
||||
- Add more coloring options to cartoon theme
|
||||
- Add `pdbx_structure_determination_methodology` mmcif field and `Model` helpers
|
||||
|
||||
## [v4.5.0] - 2024-07-28
|
||||
|
||||
|
||||
@@ -263,6 +263,7 @@ software.version
|
||||
struct.entry_id
|
||||
struct.title
|
||||
struct.pdbx_descriptor
|
||||
struct.pdbx_structure_determination_methodology
|
||||
|
||||
struct_asym.id
|
||||
struct_asym.pdbx_blank_PDB_chainid_flag
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
import { QualityAssessment, QualityAssessmentProvider } from '../prop';
|
||||
import { Location } from '../../../../mol-model/location';
|
||||
import { Bond, StructureElement, Unit } from '../../../../mol-model/structure';
|
||||
import { Bond, Model, StructureElement, Unit } from '../../../../mol-model/structure';
|
||||
import { ColorTheme, LocationColor } from '../../../../mol-theme/color';
|
||||
import { ThemeDataContext } from '../../../../mol-theme/theme';
|
||||
import { Color } from '../../../../mol-util/color';
|
||||
@@ -91,7 +91,7 @@ export const PLDDTConfidenceColorThemeProvider: ColorTheme.Provider<PLDDTConfide
|
||||
factory: PLDDTConfidenceColorTheme,
|
||||
getParams: getPLDDTConfidenceColorThemeParams,
|
||||
defaultValues: PD.getDefaultValues(getPLDDTConfidenceColorThemeParams({})),
|
||||
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure?.models.some(m => QualityAssessment.isApplicable(m, 'pLDDT') || m.atomicConformation.B_iso_or_equiv.isDefined),
|
||||
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure?.models.some(m => QualityAssessment.isApplicable(m, 'pLDDT') || (m.atomicConformation.B_iso_or_equiv.isDefined && !Model.isExperimental(m))),
|
||||
ensureCustomProperties: {
|
||||
attach: async (ctx: CustomProperty.Context, data: ThemeDataContext) => {
|
||||
if (data.structure) {
|
||||
|
||||
@@ -1033,6 +1033,10 @@ export const mmCIF_Schema = {
|
||||
* and to distinguish this structural result from others.
|
||||
*/
|
||||
title: str,
|
||||
/**
|
||||
* Indicates if the structure was determined using experimental, computational, or integrative methods
|
||||
*/
|
||||
pdbx_structure_determination_methodology: Aliased<'experimental' | 'integrative' | 'computational'>(str),
|
||||
/**
|
||||
* An automatically generated descriptor for an NDB structure or
|
||||
* the unstructured content of the PDB COMPND record.
|
||||
|
||||
@@ -378,6 +378,33 @@ export namespace Model {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isExperimental(model: Model): boolean {
|
||||
if (!MmcifFormat.is(model.sourceData)) return false;
|
||||
const { db } = model.sourceData.data;
|
||||
for (let i = 0; i < db.struct.pdbx_structure_determination_methodology.rowCount; i++) {
|
||||
if (db.struct.pdbx_structure_determination_methodology.value(i).toLowerCase() === 'experimental') return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isIntegrative(model: Model): boolean {
|
||||
if (!MmcifFormat.is(model.sourceData)) return false;
|
||||
const { db } = model.sourceData.data;
|
||||
for (let i = 0; i < db.struct.pdbx_structure_determination_methodology.rowCount; i++) {
|
||||
if (db.struct.pdbx_structure_determination_methodology.value(i).toLowerCase() === 'integrative') return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isComputational(model: Model): boolean {
|
||||
if (!MmcifFormat.is(model.sourceData)) return false;
|
||||
const { db } = model.sourceData.data;
|
||||
for (let i = 0; i < db.struct.pdbx_structure_determination_methodology.rowCount; i++) {
|
||||
if (db.struct.pdbx_structure_determination_methodology.value(i).toLowerCase() === 'computational') return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function hasXrayMap(model: Model): boolean {
|
||||
if (!MmcifFormat.is(model.sourceData)) return false;
|
||||
// Check exprimental method to exclude models solved with
|
||||
|
||||
Reference in New Issue
Block a user