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
83a1e6c8
Commit
83a1e6c8
authored
5 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
improved entity subtype assignment (use chem comp type)
parent
c18888b8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-model-formats/structure/mmcif/parser.ts
+9
-1
9 additions, 1 deletion
src/mol-model-formats/structure/mmcif/parser.ts
src/mol-model/structure/model/types.ts
+38
-12
38 additions, 12 deletions
src/mol-model/structure/model/types.ts
with
47 additions
and
13 deletions
src/mol-model-formats/structure/mmcif/parser.ts
+
9
−
1
View file @
83a1e6c8
...
@@ -374,11 +374,19 @@ function getEntities(format: mmCIF_Format): Entities {
...
@@ -374,11 +374,19 @@ function getEntities(format: mmCIF_Format): Entities {
}
}
if
(
assignSubtype
)
{
if
(
assignSubtype
)
{
const
chemCompType
=
new
Map
<
string
,
string
>
()
const
{
id
,
type
}
=
format
.
data
.
chem_comp
;
for
(
let
i
=
0
,
il
=
format
.
data
.
chem_comp
.
_rowCount
;
i
<
il
;
i
++
)
{
chemCompType
.
set
(
id
.
value
(
i
),
type
.
value
(
i
))
}
const
{
label_entity_id
,
label_comp_id
}
=
format
.
data
.
atom_site
;
const
{
label_entity_id
,
label_comp_id
}
=
format
.
data
.
atom_site
;
for
(
let
i
=
0
as
ElementIndex
,
il
=
format
.
data
.
atom_site
.
_rowCount
;
i
<
il
;
i
++
)
{
for
(
let
i
=
0
as
ElementIndex
,
il
=
format
.
data
.
atom_site
.
_rowCount
;
i
<
il
;
i
++
)
{
const
entityId
=
label_entity_id
.
value
(
i
);
const
entityId
=
label_entity_id
.
value
(
i
);
if
(
!
entityIds
.
has
(
entityId
))
{
if
(
!
entityIds
.
has
(
entityId
))
{
subtypes
[
getEntityIndex
(
entityId
)]
=
getEntitySubtype
(
label_comp_id
.
value
(
i
))
const
compId
=
label_comp_id
.
value
(
i
)
const
compType
=
chemCompType
.
get
(
compId
)
||
''
subtypes
[
getEntityIndex
(
entityId
)]
=
getEntitySubtype
(
compId
,
compType
)
entityIds
.
add
(
entityId
)
entityIds
.
add
(
entityId
)
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mol-model/structure/model/types.ts
+
38
−
12
View file @
83a1e6c8
...
@@ -113,19 +113,34 @@ export const NucleicBackboneAtoms = new Set([
...
@@ -113,19 +113,34 @@ export const NucleicBackboneAtoms = new Set([
'
O2*
'
,
'
O3*
'
,
'
O4*
'
,
'
O5*
'
,
'
C1*
'
,
'
C2*
'
,
'
C3*
'
,
'
C4*
'
,
'
C5*
'
'
O2*
'
,
'
O3*
'
,
'
O4*
'
,
'
O5*
'
,
'
C1*
'
,
'
C2*
'
,
'
C3*
'
,
'
C4*
'
,
'
C5*
'
])
])
/** Chemical component type names for protein */
/** Chemical component type names for D-linked protein */
export
const
ProteinComponentTypeNames
=
new
Set
([
export
const
DProteinComponentTypeNames
=
new
Set
([
'
D-PEPTIDE LINKING
'
,
'
L-PEPTIDE LINKING
'
,
'
D-PEPTIDE NH3 AMINO TERMINUS
'
,
'
D-PEPTIDE LINKING
'
,
'
D-PEPTIDE NH3 AMINO TERMINUS
'
,
'
L-PEPTIDE NH3 AMINO TERMINUS
'
,
'
D-PEPTIDE COOH CARBOXY TERMINUS
'
,
'
D-PEPTIDE COOH CARBOXY TERMINUS
'
,
'
D-GAMMA-PEPTIDE, C-DELTA LINKING
'
,
'
L-PEPTIDE COOH CARBOXY TERMINUS
'
,
'
PEPTIDE LINKING
'
,
'
PEPTIDE-LIKE
'
,
'
D-BETA-PEPTIDE, C-GAMMA LINKING
'
'
L-GAMMA-PEPTIDE, C-DELTA LINKING
'
,
'
D-GAMMA-PEPTIDE, C-DELTA LINKING
'
,
])
'
L-BETA-PEPTIDE, C-GAMMA LINKING
'
,
'
D-BETA-PEPTIDE, C-GAMMA LINKING
'
,
/** Chemical component type names for L-linked protein */
export
const
LProteinComponentTypeNames
=
new
Set
([
'
L-PEPTIDE LINKING
'
,
'
L-PEPTIDE NH3 AMINO TERMINUS
'
,
'
L-PEPTIDE COOH CARBOXY TERMINUS
'
,
'
L-GAMMA-PEPTIDE, C-DELTA LINKING
'
,
'
L-BETA-PEPTIDE, C-GAMMA LINKING
'
])
/** Chemical component type names for pepdite-like protein */
export
const
OtherProteinComponentTypeNames
=
new
Set
([
'
PEPTIDE LINKING
'
,
'
PEPTIDE-LIKE
'
,
])
])
/** Chemical component type names for protein */
export
const
ProteinComponentTypeNames
=
SetUtils
.
unionMany
(
DProteinComponentTypeNames
,
LProteinComponentTypeNames
,
OtherProteinComponentTypeNames
)
/** Chemical component type names for DNA */
/** Chemical component type names for DNA */
export
const
DNAComponentTypeNames
=
[
export
const
DNAComponentTypeNames
=
new
Set
(
[
'
DNA LINKING
'
,
'
L-DNA LINKING
'
,
'
DNA OH 5 PRIME TERMINUS
'
,
'
DNA OH 3 PRIME TERMINUS
'
,
'
DNA LINKING
'
,
'
L-DNA LINKING
'
,
'
DNA OH 5 PRIME TERMINUS
'
,
'
DNA OH 3 PRIME TERMINUS
'
,
]
]
)
/** Chemical component type names for RNA */
/** Chemical component type names for RNA */
export
const
RNAComponentTypeNames
=
new
Set
([
export
const
RNAComponentTypeNames
=
new
Set
([
...
@@ -200,7 +215,7 @@ export function getMoleculeType(compType: string, compId: string) {
...
@@ -200,7 +215,7 @@ export function getMoleculeType(compType: string, compId: string) {
return
MoleculeType
.
protein
return
MoleculeType
.
protein
}
else
if
(
RNAComponentTypeNames
.
has
(
compType
))
{
}
else
if
(
RNAComponentTypeNames
.
has
(
compType
))
{
return
MoleculeType
.
RNA
return
MoleculeType
.
RNA
}
else
if
(
DNAComponentTypeNames
.
include
s
(
compType
))
{
}
else
if
(
DNAComponentTypeNames
.
ha
s
(
compType
))
{
return
MoleculeType
.
DNA
return
MoleculeType
.
DNA
}
else
if
(
SaccharideComponentTypeNames
.
has
(
compType
))
{
}
else
if
(
SaccharideComponentTypeNames
.
has
(
compType
))
{
return
MoleculeType
.
saccharide
return
MoleculeType
.
saccharide
...
@@ -243,9 +258,20 @@ export function getEntityType(compId: string): mmCIF_Schema['entity']['type']['T
...
@@ -243,9 +258,20 @@ export function getEntityType(compId: string): mmCIF_Schema['entity']['type']['T
}
}
}
}
export
function
getEntitySubtype
(
compId
:
string
):
EntitySubtype
{
export
function
getEntitySubtype
(
compId
:
string
,
compType
:
string
):
EntitySubtype
{
compId
=
compId
.
toUpperCase
()
compId
=
compId
.
toUpperCase
()
if
(
SaccharideCompIdMap
.
has
(
compId
))
{
compType
=
compType
.
toUpperCase
()
if
(
LProteinComponentTypeNames
.
has
(
compType
))
{
return
'
polypeptide(L)
'
}
else
if
(
DProteinComponentTypeNames
.
has
(
compType
))
{
return
'
polypeptide(D)
'
}
else
if
(
RNAComponentTypeNames
.
has
(
compType
))
{
return
'
polyribonucleotide
'
}
else
if
(
DNAComponentTypeNames
.
has
(
compType
))
{
return
'
polydeoxyribonucleotide
'
}
else
if
(
SaccharideComponentTypeNames
.
has
(
compType
))
{
return
'
oligosaccharide
'
}
else
if
(
SaccharideCompIdMap
.
has
(
compId
))
{
return
'
oligosaccharide
'
return
'
oligosaccharide
'
}
else
if
(
PeptideBaseNames
.
has
(
compId
))
{
}
else
if
(
PeptideBaseNames
.
has
(
compId
))
{
return
'
peptide nucleic acid
'
return
'
peptide nucleic acid
'
...
...
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