Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
198f884d
Unverified
Commit
198f884d
authored
May 13, 2023
by
Alexander Rose
Committed by
GitHub
May 13, 2023
Browse files
Options
Downloads
Plain Diff
Merge pull request #817 from molstar/pdb-assemblies-fix
Fix Archive PDB assembly loading
parents
7ef15ede
2c7d0a67
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/mol-model-formats/structure/pdb/atom-site.ts
+5
-3
5 additions, 3 deletions
src/mol-model-formats/structure/pdb/atom-site.ts
src/mol-model-formats/structure/pdb/to-cif.ts
+4
-2
4 additions, 2 deletions
src/mol-model-formats/structure/pdb/to-cif.ts
with
10 additions
and
5 deletions
CHANGELOG.md
+
1
−
0
View file @
198f884d
...
...
@@ -20,6 +20,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
...
...
This diff is collapsed.
Click to expand it.
src/mol-model-formats/structure/pdb/atom-site.ts
+
5
−
3
View file @
198f884d
/**
* Copyright (c) 2019-202
2
mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2019-202
3
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
}
`
;
...
...
This diff is collapsed.
Click to expand it.
src/mol-model-formats/structure/pdb/to-cif.ts
+
4
−
2
View file @
198f884d
/**
* Copyright (c) 2019-202
1
mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2019-202
3
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>
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment