diff --git a/CHANGELOG.md b/CHANGELOG.md index d32f33ebb288e1aba69a53ba96b98eae17448aa7..f8412175fb9d7b31ce78ba0e3de68f2c7b333c7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Note that since we don't clearly distinguish between a public and private interf - Parse HEADER record when reading PDB file - Support `ignoreHydrogens` in interactions representation - Add hydroxyproline (HYP) commonly present in collagen molecules to the list of amino acids +- Fix assemblies for Archive PDB files (do not generate unique `label_asym_id` if `REMARK 350` is present) ## [v3.34.0] - 2023-04-16 diff --git a/src/mol-model-formats/structure/pdb/atom-site.ts b/src/mol-model-formats/structure/pdb/atom-site.ts index c8b1c996077de39d522b6916f161b69de7fcb27b..fec4c452c22de60470500404017b53b4ea4be8f9 100644 --- a/src/mol-model-formats/structure/pdb/atom-site.ts +++ b/src/mol-model-formats/structure/pdb/atom-site.ts @@ -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,7 @@ 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)) { + if (terIndices.has(i) && !options.hasAssemblies) { const asymIdCount = asymIdCounts.get(asymId)! + 1; asymIdCounts.set(asymId, asymIdCount); currLabelAsymId = `${asymId}_${asymIdCount}`; diff --git a/src/mol-model-formats/structure/pdb/to-cif.ts b/src/mol-model-formats/structure/pdb/to-cif.ts index 99d6184b523f7d663eb546ffaf54e93e1debe76b..5c1dd9c9a7ea0719663daae0d2b0efbd07014a9a 100644 --- a/src/mol-model-formats/structure/pdb/to-cif.ts +++ b/src/mol-model-formats/structure/pdb/to-cif.ts @@ -54,6 +54,7 @@ export async function pdbToMmCif(pdb: PdbFile): Promise<CifFrame> { let modelNum = 0, modelStr = ''; let conectRange: [number, number] | undefined = undefined; + let hasAssemblies = false; const terIndices = new Set<number>(); for (let i = 0, _i = lines.count; i < _i; i++) { @@ -152,6 +153,7 @@ export async function pdbToMmCif(pdb: PdbFile): Promise<CifFrame> { } helperCategories.push(...parseRemark350(lines, i, j)); i = j - 1; + hasAssemblies = true; } break; case 'S': @@ -208,7 +210,7 @@ export async function pdbToMmCif(pdb: PdbFile): Promise<CifFrame> { atomSite.label_entity_id[i] = entityBuilder.getEntityId(compId, moleculeType, asymIds.value(i)); } - const atom_site = getAtomSite(atomSite, terIndices); + const atom_site = getAtomSite(atomSite, terIndices, { hasAssemblies }); if (!isPdbqt) delete atom_site.partial_charge; if (conectRange) {