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
4e6a08c9
Commit
4e6a08c9
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
added support for extra enum values to cif schema generator
parent
b7f005f4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/apps/schema-generator/util/cif-dic.ts
+21
-0
21 additions, 0 deletions
src/apps/schema-generator/util/cif-dic.ts
src/mol-io/reader/cif/schema/mmcif.ts
+1
-1
1 addition, 1 deletion
src/mol-io/reader/cif/schema/mmcif.ts
with
22 additions
and
1 deletion
src/apps/schema-generator/util/cif-dic.ts
+
21
−
0
View file @
4e6a08c9
...
...
@@ -189,6 +189,20 @@ const SEMICOLON_SEPARATED_LIST_FIELDS = [
'
_chem_comp.pdbx_synonyms
'
// GLYCERIN; PROPANE-1,2,3-TRIOL
]
/**
* Useful when a dictionary extension will add enum values to an existing dictionary.
* By adding them here, the dictionary extension can be tested before the added enum
* values are available in the existing dictionary.
*/
const
EXTRA_ENUM_VALUES
:
{
[
k
:
string
]:
string
[]
}
=
{
// TODO for carbohydrate extension draft, remove when added to chem_comp dic
'
_pdbx_chem_comp_identifier.type
'
:
[
'
CONDENSED IUPAC CARB SYMBOL
'
,
'
IUPAC CARB SYMBOL
'
,
'
SNFG CARB SYMBOL
'
]
}
export
function
generateSchema
(
frames
:
CifFrame
[])
{
const
schema
:
Database
=
{}
...
...
@@ -310,6 +324,13 @@ export function generateSchema (frames: CifFrame[]) {
console
.
log
(
`forcing space separated:
${
d
.
header
}
`
)
}
}
if
(
d
.
header
in
EXTRA_ENUM_VALUES
)
{
if
(
fieldType
.
type
===
'
enum
'
)
{
fieldType
.
values
.
push
(...
EXTRA_ENUM_VALUES
[
d
.
header
])
}
else
{
console
.
warn
(
`expected enum:
${
d
.
header
}
`
)
}
}
fields
[
itemName
]
=
fieldType
}
else
{
console
.
log
(
`could not determine code for '
${
d
.
header
}
'`
)
...
...
This diff is collapsed.
Click to expand it.
src/mol-io/reader/cif/schema/mmcif.ts
+
1
−
1
View file @
4e6a08c9
...
...
@@ -1536,7 +1536,7 @@ export const mmCIF_Schema = {
/**
* This data item contains the identifier type.
*/
type
:
Aliased
<
'
COMMON NAME
'
|
'
SYSTEMATIC NAME
'
|
'
CAS REGISTRY NUMBER
'
|
'
PUBCHEM Identifier
'
|
'
MDL Identifier
'
|
'
SYNONYM
'
>
(
str
),
type
:
Aliased
<
'
COMMON NAME
'
|
'
SYSTEMATIC NAME
'
|
'
CAS REGISTRY NUMBER
'
|
'
PUBCHEM Identifier
'
|
'
MDL Identifier
'
|
'
SYNONYM
'
|
'
CONDENSED IUPAC CARB SYMBOL
'
|
'
IUPAC CARB SYMBOL
'
|
'
SNFG CARB SYMBOL
'
>
(
str
),
/**
* This data item contains the name of the program
* or library used to compute the identifier.
...
...
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