|
@@ -1,5 +1,5 @@
|
|
|
/**
|
|
|
- * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
|
+ * Copyright (c) 2019-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
|
*
|
|
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -39,7 +39,7 @@ export function getAtomSiteTemplate(data: string, count: number) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-export function getAtomSite(sites: AtomSiteTemplate, terIndices: Set<number>): { [K in keyof mmCIF_Schema['atom_site'] | 'partial_charge']?: CifField } {
|
|
|
+export function getAtomSite(sites: AtomSiteTemplate, terIndices: Set<number>, options: { hasAssemblies: boolean }): { [K in keyof mmCIF_Schema['atom_site'] | 'partial_charge']?: CifField } {
|
|
|
const pdbx_PDB_model_num = CifField.ofStrings(sites.pdbx_PDB_model_num);
|
|
|
const auth_asym_id = CifField.ofTokens(sites.auth_asym_id);
|
|
|
const auth_seq_id = CifField.ofTokens(sites.auth_seq_id);
|
|
@@ -87,7 +87,9 @@ export function getAtomSite(sites: AtomSiteTemplate, terIndices: Set<number>): {
|
|
|
if (asymIdCounts.has(asymId)) {
|
|
|
// only change the chains name if there are TER records
|
|
|
// otherwise assume repeated chain name use is from interleaved chains
|
|
|
- if (terIndices.has(i)) {
|
|
|
+ // also don't change the chains name if there are assemblies
|
|
|
+ // as those require the original chain name
|
|
|
+ if (terIndices.has(i) && !options.hasAssemblies) {
|
|
|
const asymIdCount = asymIdCounts.get(asymId)! + 1;
|
|
|
asymIdCounts.set(asymId, asymIdCount);
|
|
|
currLabelAsymId = `${asymId}_${asymIdCount}`;
|