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
8df8a1e1
Commit
8df8a1e1
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
more resilient handling of chemp comp names, isPolymer helper method
parent
a3fe5cce
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-model/structure/model/types.ts
+16
-10
16 additions, 10 deletions
src/mol-model/structure/model/types.ts
with
16 additions
and
10 deletions
src/mol-model/structure/model/types.ts
+
16
−
10
View file @
8df8a1e1
...
@@ -79,28 +79,28 @@ export enum ComponentType {
...
@@ -79,28 +79,28 @@ export enum ComponentType {
/** Chemical component type names for protein */
/** Chemical component type names for protein */
export
const
ProteinComponentTypeNames
=
[
export
const
ProteinComponentTypeNames
=
[
'
D-
peptide linking
'
,
'
L-peptide linking
'
,
'
D-peptide NH3 amino terminus
'
,
'
D-
PEPTIDE LINKING
'
,
'
L-PEPTIDE LINKING
'
,
'
D-PEPTIDE NH3 AMINO TERMINUS
'
,
'
L-
peptide NH3 amino terminus
'
,
'
D-peptide COOH carboxy terminus
'
,
'
L-
PEPTIDE NH3 AMINO TERMINUS
'
,
'
D-PEPTIDE COOH CARBOXY TERMINUS
'
,
'
L-
peptide COOH carboxy terminus
'
,
'
peptide linking
'
,
'
peptide-like
'
,
'
L-
PEPTIDE COOH CARBOXY TERMINUS
'
,
'
PEPTIDE LINKING
'
,
'
PEPTIDE-LIKE
'
,
'
L-
gamma-peptide, C-delta linking
'
,
'
D-gamma-peptide, C-delta 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
'
,
'
L-
BETA-PEPTIDE, C-GAMMA LINKING
'
,
'
D-BETA-PEPTIDE, C-GAMMA LINKING
'
,
]
]
/** Chemical component type names for DNA */
/** Chemical component type names for DNA */
export
const
DNAComponentTypeNames
=
[
export
const
DNAComponentTypeNames
=
[
'
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
=
[
export
const
RNAComponentTypeNames
=
[
'
RNA
linking
'
,
'
L-RNA
linking
'
,
'
RNA OH 5
prime terminus
'
,
'
RNA OH 3 prime terminus
'
,
'
RNA
LINKING
'
,
'
L-RNA
LINKING
'
,
'
RNA OH 5
PRIME TERMINUS
'
,
'
RNA OH 3 PRIME TERMINUS
'
,
]
]
/** Chemical component type names for saccharide */
/** Chemical component type names for saccharide */
export
const
SaccharideComponentTypeNames
=
[
export
const
SaccharideComponentTypeNames
=
[
'
D-
saccharide
1,4
and
1,4
linking
'
,
'
L-saccharide
1,4
and
1,4
linking
'
,
'
D-
SACCHARIDE
1,4
AND
1,4
LINKING
'
,
'
L-SACCHARIDE
1,4
AND
1,4
LINKING
'
,
'
D-
saccharide
1,4
and
1,6
linking
'
,
'
L-saccharide
1,4
and
1,6
linking
'
,
'
L-saccharide
'
,
'
D-
SACCHARIDE
1,4
AND
1,6
LINKING
'
,
'
L-SACCHARIDE
1,4
AND
1,6
LINKING
'
,
'
L-SACCHARIDE
'
,
'
D-
saccharide
'
,
'
saccharide
'
,
'
D-
SACCHARIDE
'
,
'
SACCHARIDE
'
,
]
]
/** Common names for water molecules */
/** Common names for water molecules */
...
@@ -110,6 +110,8 @@ export const WaterNames = [
...
@@ -110,6 +110,8 @@ export const WaterNames = [
/** get the molecule type from component type and id */
/** get the molecule type from component type and id */
export
function
getMoleculeType
(
compType
:
string
,
compId
:
string
)
{
export
function
getMoleculeType
(
compType
:
string
,
compId
:
string
)
{
compType
=
compType
.
toUpperCase
()
compId
=
compId
.
toUpperCase
()
if
(
ProteinComponentTypeNames
.
includes
(
compType
))
{
if
(
ProteinComponentTypeNames
.
includes
(
compType
))
{
return
MoleculeType
.
protein
return
MoleculeType
.
protein
}
else
if
(
RNAComponentTypeNames
.
includes
(
compType
))
{
}
else
if
(
RNAComponentTypeNames
.
includes
(
compType
))
{
...
@@ -127,6 +129,10 @@ export function getMoleculeType(compType: string, compId: string) {
...
@@ -127,6 +129,10 @@ export function getMoleculeType(compType: string, compId: string) {
}
}
}
}
export
function
isPolymer
(
moleculeType
:
MoleculeType
)
{
return
moleculeType
===
MoleculeType
.
protein
||
moleculeType
===
MoleculeType
.
DNA
||
moleculeType
===
MoleculeType
.
RNA
}
/**
/**
* all chemical components with the word "ion" in their name, Sep 2016
* all chemical components with the word "ion" in their name, Sep 2016
*
*
...
...
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