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

re-add using _struct_asym cat in getStructAsymMap

- needed for ihm model support
parent df23b3c0
No related branches found
No related tags found
No related merge requests found
......@@ -114,8 +114,7 @@ function createIntegrativeModel(data: BasicData, ihm: CoarseData, properties: Co
if (ihm.model_name) label.push(ihm.model_name);
if (ihm.model_group_name) label.push(ihm.model_group_name);
// TODO: should this contain anything from coarse hierarchy?
const structAsymMap = getStructAsymMap(atomic.hierarchy);
const structAsymMap = getStructAsymMap(atomic.hierarchy, data);
return {
id: UUID.create22(),
......
......@@ -109,7 +109,7 @@ const getUniqueComponentNames = memoize1((data: BasicData) => {
});
export function getStructAsymMap(atomic: AtomicHierarchy): Model['properties']['structAsymMap'] {
export function getStructAsymMap(atomic: AtomicHierarchy, data?: BasicData): Model['properties']['structAsymMap'] {
const map = new Map<string, StructAsym>();
const { auth_asym_id, label_asym_id, label_entity_id } = atomic.chains;
......@@ -119,5 +119,20 @@ export function getStructAsymMap(atomic: AtomicHierarchy): Model['properties']['
map.set(id, { id, auth_id: auth_asym_id.value(i), entity_id: label_entity_id.value(i) });
}
// to get asym mapping for coarse/ihm data
if (data?.struct_asym._rowCount) {
const { id, entity_id } = data.struct_asym;
for (let i = 0, il = id.rowCount; i < il; ++i) {
const _id = id.value(i);
if (!map.has(_id)) {
map.set(_id, {
id: _id,
auth_id: '',
entity_id: entity_id.value(i)
});
}
}
}
return map;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment