update cif-core schema

This commit is contained in:
Alexander Rose
2026-02-28 13:19:05 -08:00
parent 01e95dada0
commit 2ce126a8f5
5 changed files with 68 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ chemical.melting_point
chemical_formula.moiety
chemical_formula.sum
chemical_formula.iupac
chemical_formula.weight
atom_type.symbol
@@ -25,6 +26,8 @@ atom_type_scat.source
space_group.crystal_system
space_group.name_h-m_full
space_group.name_h-m_alt
space_group.name_hall
space_group.it_number
space_group_symop.operation_xyz
1 audit.block_doi
14 chemical_formula.weight chemical_formula.iupac
15 atom_type.symbol chemical_formula.weight
16 atom_type.description atom_type.symbol
17 atom_type.description
18 atom_type_scat.dispersion_real
19 atom_type_scat.dispersion_imag
20 atom_type_scat.source
26 cell.length_b space_group_symop.operation_xyz
27 cell.length_c cell.length_a
28 cell.angle_alpha cell.length_b
29 cell.length_c
30 cell.angle_alpha
31 cell.angle_beta
32 cell.angle_gamma
33 cell.volume

View File

@@ -166,9 +166,9 @@ const MA_DIC_URL = 'https://raw.githubusercontent.com/ihmwg/ModelCIF/master/dist
const CIF_CORE_DIC_PATH = `${DIC_DIR}/cif_core.dic`;
const CIF_CORE_DIC_URL = 'https://raw.githubusercontent.com/COMCIFS/cif_core/master/cif_core.dic';
const CIF_CORE_ENUM_PATH = `${DIC_DIR}/templ_enum.cif`;
const CIF_CORE_ENUM_URL = 'https://raw.githubusercontent.com/COMCIFS/cif_core/master/templ_enum.cif';
const CIF_CORE_ENUM_URL = 'https://raw.githubusercontent.com/COMCIFS/Enumeration_Templates/refs/heads/main/templ_enum.cif';
const CIF_CORE_ATTR_PATH = `${DIC_DIR}/templ_attr.cif`;
const CIF_CORE_ATTR_URL = 'https://raw.githubusercontent.com/COMCIFS/cif_core/master/templ_attr.cif';
const CIF_CORE_ATTR_URL = 'https://raw.githubusercontent.com/COMCIFS/Attribute_Templates/refs/heads/main/templ_attr.cif';
const parser = new argparse.ArgumentParser({
add_help: true,

View File

@@ -93,6 +93,7 @@ export function getFieldType(type: string, description: string, values?: string[
case 'Implied':
case 'Word':
case 'Uri':
case 'Iri':
return wrapContainer('str', ',', description, container);
case 'Real':
return wrapContainer('float', ',', description, container);

View File

@@ -125,6 +125,17 @@ export const CifCore_Schema = {
* _chemical_formula.weight 768.81
*/
chemical_formula: {
/**
* Formula expressed in conformance with IUPAC rules for inorganic
* and metal-organic compounds where these conflict with the rules
* for any other chemical_formula entries. Typically used for
* formatting a formula in accordance with journal rules. This
* should appear in the data block in addition to the most
* appropriate of the other chemical_formula data names.
* Ref: IUPAC (1990). Nomenclature of Inorganic Chemistry.
* Oxford: Blackwell Scientific Publications.
*/
iupac: str,
/**
* Formula with each discrete bonded residue or ion shown as a
* separate moiety. See above CHEMICAL_FORMULA for rules
@@ -194,6 +205,32 @@ export const CifCore_Schema = {
* the space group type but not the coordinate system expressed.
*/
it_number: int,
/**
* _space_group.name_H-M_alt allows for any Hermann-Mauguin symbol
* to be given. The way in which this item is used is determined
* by the user and in general is not intended to be interpreted by
* computer. It may, for example, be used to give one of the
* extended Hermann-Mauguin symbols given in Table 4.3.1 of
* International Tables for Crystallography Vol. A (1995) or
* a Hermann-Mauguin symbol for a conventional or unconventional
* setting.
* Each component of the space group name is separated by a
* space or underscore. The use of space is strongly
* recommended. The underscore is only retained because it
* was used in earlier archived files. It should not be
* used in new CIFs. Subscripts should appear without special
* symbols. Bars should be given as negative signs before the
* numbers to which they apply.
* The commonly used Hermann-Mauguin symbol determines the space
* group type uniquely, but a given space group type may be
* described by more than one Hermann-Mauguin symbol. The space
* group type is best described using _space_group.IT_number.
* The Hermann-Mauguin symbol may contain information on the
* choice of basis though not on the choice of origin. To
* define the setting uniquely use _space_group.name_Hall or
* list the symmetry operations.
*/
'name_h-m_alt': str,
/**
* The full international Hermann-Mauguin space-group symbol as
* defined in Section 2.1.3.3 and given as the second item of the
@@ -225,6 +262,18 @@ export const CifCore_Schema = {
* Chichester: John Wiley & Sons.
*/
'name_h-m_full': str,
/**
* Space group symbol defined by Hall. Each component of the
* space group name is separated by a space or an underscore.
* The use of space is strongly recommended because it specifies
* the coordinate system. The underscore in the name is only
* retained because it was used in earlier archived files. It
* should not be used in new CIFs.
* Ref: Hall, S. R. (1981). Acta Cryst. A37, 517-525
* [See also International Tables for Crystallography,
* Vol. B (1993) 1.4 Appendix B]
*/
name_hall: str,
},
/**
* The category of data items used to describe symmetry equivalent sites
@@ -725,13 +774,23 @@ export const CifCore_Aliases = {
'cell.formula_units_z': [
'cell_formula_units_Z',
],
'chemical_formula.iupac': [
'chemical_formula_IUPAC',
],
'space_group.it_number': [
'space_group_IT_number',
'symmetry_Int_Tables_number',
],
'space_group.name_h-m_alt': [
'space_group_name_H-M_alt',
],
'space_group.name_h-m_full': [
'symmetry_space_group_name_H-M',
],
'space_group.name_hall': [
'space_group_name_Hall',
'symmetry_space_group_name_Hall',
],
'space_group_symop.operation_xyz': [
'symmetry_equiv_pos_as_xyz',
],

View File

@@ -26,9 +26,10 @@ import { cantorPairing } from '../../mol-data/util';
function getSpacegroupNameOrNumber(space_group: CifCore_Database['space_group']) {
const groupNumber = space_group.it_number.value(0);
const groupName = space_group['name_h-m_full'].value(0).replace('-', ' ');
const space_group_name = space_group['name_h-m_full'].isDefined ? space_group['name_h-m_full'] : space_group['name_h-m_alt'];
const groupName = space_group_name.value(0).replace('_', ' ');
if (!space_group.it_number.isDefined) return groupName;
if (!space_group['name_h-m_full'].isDefined) return groupNumber;
if (!space_group_name.isDefined) return groupNumber;
return groupNumber;
}