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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
ee43a971
Commit
ee43a971
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
added model.properties.asymIdSerialMap
parent
f56574eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-model/structure/model/formats/mmcif.ts
+23
-3
23 additions, 3 deletions
src/mol-model/structure/model/formats/mmcif.ts
src/mol-model/structure/model/model.ts
+3
-2
3 additions, 2 deletions
src/mol-model/structure/model/model.ts
with
26 additions
and
5 deletions
src/mol-model/structure/model/formats/mmcif.ts
+
23
−
3
View file @
ee43a971
...
...
@@ -135,7 +135,7 @@ function isHierarchyDataEqual(a: AtomicData, b: AtomicData) {
&&
Table
.
areEqual
(
a
.
atoms
as
Table
<
AtomsSchema
>
,
b
.
atoms
as
Table
<
AtomsSchema
>
)
}
function
modRes
Map
(
format
:
mmCIF_Format
)
{
function
getModifiedResidueName
Map
(
format
:
mmCIF_Format
)
{
const
data
=
format
.
data
.
pdbx_struct_mod_residue
;
const
map
=
new
Map
<
string
,
string
>
();
const
comp_id
=
data
.
label_comp_id
.
isDefined
?
data
.
label_comp_id
:
data
.
auth_comp_id
;
...
...
@@ -148,6 +148,24 @@ function modResMap(format: mmCIF_Format) {
return
map
;
}
function
getAsymIdSerialMap
(
format
:
mmCIF_Format
)
{
const
data
=
format
.
data
.
struct_asym
;
const
map
=
new
Map
<
string
,
number
>
();
let
serial
=
0
const
id
=
data
.
id
const
count
=
data
.
_rowCount
for
(
let
i
=
0
;
i
<
count
;
++
i
)
{
const
_id
=
id
.
value
(
i
)
if
(
!
map
.
has
(
_id
))
{
map
.
set
(
_id
,
serial
)
serial
+=
1
}
}
return
map
;
}
function
createModel
(
format
:
mmCIF_Format
,
atom_site
:
AtomSite
,
previous
?:
Model
):
Model
{
const
hierarchyOffsets
=
findHierarchyOffsets
(
atom_site
);
const
hierarchyData
=
createHierarchyData
(
atom_site
,
hierarchyOffsets
);
...
...
@@ -176,7 +194,8 @@ function createModel(format: mmCIF_Format, atom_site: AtomSite, previous?: Model
?
format
.
data
.
entry
.
id
.
value
(
0
)
:
format
.
data
.
_name
;
const
modifiedResidueNameMap
=
modResMap
(
format
);
const
modifiedResidueNameMap
=
getModifiedResidueNameMap
(
format
);
const
asymIdSerialMap
=
getAsymIdSerialMap
(
format
)
return
{
id
:
UUID
.
create
(),
...
...
@@ -191,7 +210,8 @@ function createModel(format: mmCIF_Format, atom_site: AtomSite, previous?: Model
coarseConformation
:
coarse
.
conformation
,
properties
:
{
secondaryStructure
:
getSecondaryStructureMmCif
(
format
.
data
,
atomicHierarchy
),
modifiedResidueNameMap
modifiedResidueNameMap
,
asymIdSerialMap
},
symmetry
:
getSymmetry
(
format
)
};
...
...
This diff is collapsed.
Click to expand it.
src/mol-model/structure/model/model.ts
+
3
−
2
View file @
ee43a971
...
...
@@ -13,7 +13,7 @@ import { CoarseHierarchy, CoarseConformation } from './properties/coarse'
import
{
Entities
}
from
'
./properties/common
'
;
import
{
SecondaryStructure
}
from
'
./properties/seconday-structure
'
;
//import from_gro from './formats/gro'
//
import from_gro from './formats/gro'
import
from_mmCIF
from
'
./formats/mmcif
'
/**
* Interface to the "source data" of the molecule.
...
...
@@ -40,6 +40,7 @@ interface Model extends Readonly<{
readonly
secondaryStructure
:
SecondaryStructure
,
// maps modified residue name to its parent
readonly
modifiedResidueNameMap
:
Map
<
string
,
string
>
,
readonly
asymIdSerialMap
:
Map
<
string
,
number
>
,
[
customName
:
string
]:
any
},
...
...
@@ -54,7 +55,7 @@ interface Model extends Readonly<{
namespace
Model
{
export
function
create
(
format
:
Format
)
{
switch
(
format
.
kind
)
{
//case 'gro': return from_gro(format);
//
case 'gro': return from_gro(format);
case
'
mmCIF
'
:
return
from_mmCIF
(
format
);
}
}
...
...
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