Skip to content
Snippets Groups Projects
Commit eea1137a authored by Alexander Rose's avatar Alexander Rose
Browse files

prefer EMDB map for 'ELECTRON CRYSTALLOGRAPHY' entries

parent a1301216
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,26 @@ export function getStreamingMethod(s?: Structure, defaultKind: VolumeServerInfo.
const model = s.models[0];
if (model.sourceData.kind !== 'mmCIF') return defaultKind;
const data = model.sourceData.data.exptl.method;
for (let i = 0; i < data.rowCount; i++) {
const v = data.value(i).toUpperCase();
const { data } = model.sourceData;
// prefer EMDB entries over structure-factors (SF) e.g. for 'ELECTRON CRYSTALLOGRAPHY' entries
// like 6axz or 6kj3 for which EMDB entries are available but map calculation from SF is hard
for (let i = 0, il = data.pdbx_database_related._rowCount; i < il; ++i) {
if (data.pdbx_database_related.db_name.value(i).toUpperCase() === 'EMDB') {
return 'em'
}
}
if (data.pdbx_database_status.status_code_sf.isDefined && data.pdbx_database_status.status_code_sf.value(0) === 'REL') {
return 'x-ray'
}
// fallbacks
for (let i = 0; i < data.exptl.method.rowCount; i++) {
const v = data.exptl.method.value(i).toUpperCase();
if (v.indexOf('MICROSCOPY') >= 0) return 'em';
}
return 'x-ray';
return defaultKind;
}
/** Returns EMD ID when available, otherwise falls back to PDB ID */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment