add pdbx_structure_determination_methodology mmcif field and Model helpers

This commit is contained in:
Alexander Rose
2024-08-18 13:32:57 -07:00
parent fc7e9501b2
commit 1a88126af8
5 changed files with 35 additions and 2 deletions

View File

@@ -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

View File

@@ -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
1 atom_sites.entry_id
263 struct_conn.ptnr1_label_seq_id struct_conn.ptnr1_label_comp_id
264 struct_conn.ptnr1_label_atom_id struct_conn.ptnr1_label_seq_id
265 struct_conn.pdbx_ptnr1_label_alt_id struct_conn.ptnr1_label_atom_id
266 struct_conn.pdbx_ptnr1_label_alt_id
267 struct_conn.pdbx_ptnr1_PDB_ins_code
268 struct_conn.pdbx_ptnr1_standard_comp_id
269 struct_conn.ptnr1_symmetry

View File

@@ -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) {

View File

@@ -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.

View File

@@ -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