##
# File: NmrUtilConstant.py
# Date: 07-Jan-2026
#
# Updates:
##
""" Constants for NMR data processing.
    @author: Masashi Yokochi
"""
__docformat__ = "restructuredtext en"
__author__ = "Masashi Yokochi"
__email__ = "yokochi@protein.osaka-u.ac.jp"
__license__ = "Apache License 2.0"
__version__ = "5.0.0"

import copy
import re

from rmsd.calculate_rmsd import NAMES_ELEMENT  # noqa: F401 pylint: disable=no-name-in-module,import-error

# supported parameter keys as input/output file path(s) for NmrDpUtility class
MODEL_FILE_PATH_KEY = 'coordinate_file_path'
ALT_MODEL_FILE_PATH_KEY = 'proc_coord_file_path'
CS_FILE_PATH_LIST_KEY = 'chem_shift_file_path_list'
MR_FILE_PATH_LIST_KEY = 'restraint_file_path_list'
AR_FILE_PATH_LIST_KEY = 'atypical_restraint_file_path_list'
AC_FILE_PATH_LIST_KEY = 'atypical_chem_shift_file_path_list'
REPORT_FILE_PATH_KEY = 'report_file_path'
NMR_CIF_FILE_PATH_KEY = 'nmr_cif_file_path'
NMRIF_FILE_PATH_KEY = 'nmrif_file_path'
NEXT_NEF_FILE_PATH_KEY = 'nef_file_path'
NEXT_STAR_FILE_PATH_KEY = 'nmr-star_file_path'
AVS_LETTER_FILE_PATH_KEY = 'avs_letter_path'  # used only for BMRB internal annotation
RETURN_LETTER_PATH_KEY = 'return_letter_path'  # used only for BMRB internal annotation

# supported input param names for NmrDpUtility class
DP_INPUT_PARAM_KEYS = ('remediation', 'internal', 'bmrb_only', 'bmrb_id', 'merge_any_pk_as_is', 'enforce_peak_row_format',
                       'nonblk_anomalous_cs', 'nonblk_bad_nterm', 'update_poly_seq', 'resolve_conflict',
                       'check_mandatory_tag', 'check_auth_seq', 'validation_server', 'conversion_server',
                       'transl_pseudo_name', 'tolerant_seq_align', 'fix_format_issue', 'excl_missing_data',
                       'cmpl_missing_data', 'trust_pdbx_nmr_ens', 'rmsd_not_superimposed', 'rmsd_overlaid_exactly',
                       'dep_sys_name', 'elec_dep_hash_code', 'update_related_entries')  # used only for BMRB internal annotation

# supported input file names for NmrDpUtility class
DP_INPUT_FILE_KEYS = (MODEL_FILE_PATH_KEY,
                      ALT_MODEL_FILE_PATH_KEY,
                      REPORT_FILE_PATH_KEY,
                      NMR_CIF_FILE_PATH_KEY,
                      NMRIF_FILE_PATH_KEY,
                      AVS_LETTER_FILE_PATH_KEY)  # used only for BMRB internal annotation

# supported input file_list names for NmrDpUtility class
DP_INPUT_FILE_LIST_KEYS = (CS_FILE_PATH_LIST_KEY,
                           MR_FILE_PATH_LIST_KEY)

# supported input file_dict_list names for NmrDpUtility class
DP_INPUT_FILE_DICT_KEYS = (CS_FILE_PATH_LIST_KEY,
                           MR_FILE_PATH_LIST_KEY,
                           AR_FILE_PATH_LIST_KEY,
                           AC_FILE_PATH_LIST_KEY)

# supported output param names for NmrDpUtility class
DP_OUTPUT_PARAM_KEYS = ('entry_id', 'retain_original', 'leave_intl_note', 'reduced_atom_notation',
                        'insert_entry_id_to_loops')  # add 'insert_entry_id_to_loops' for backward compatibility

# supported output file names for NmrDpUtility class
DP_OUTPUT_FILE_KEYS = (REPORT_FILE_PATH_KEY,
                       NMR_CIF_FILE_PATH_KEY,
                       NMRIF_FILE_PATH_KEY,
                       NEXT_NEF_FILE_PATH_KEY,  # nmr-str2nef-release specific
                       NEXT_STAR_FILE_PATH_KEY,  # nmr-nef2str-deposit and nmr-nef2cif-deposit specific
                       CS_FILE_PATH_LIST_KEY,  # nmr-cs-str-consistency-check specific
                       MR_FILE_PATH_LIST_KEY,  # nmr-cs-str-consistency-check specific
                       RETURN_LETTER_PATH_KEY)  # used only for BMRB internal annotation

# supported output file_list names for NmrDpUtility class
DP_OUTPUT_FILE_LIST_KEYS = (CS_FILE_PATH_LIST_KEY,  # nmr-cs-str-consistency-check specific
                            MR_FILE_PATH_LIST_KEY)  # nmr-cs-str-consistency-check specific

# support workflow operations of NmrDpUtility class
DP_WORKFLOW_OPS = ('nmr-nef-consistency-check',
                   'nmr-str-consistency-check',
                   'nmr-nef2str-deposit',
                   'nmr-nef2cif-deposit',
                   'nmr-str2str-deposit',
                   'nmr-str2cif-deposit',
                   'nmr-str2nef-release',
                   'nmr-cs-nef-consistency-check',
                   'nmr-cs-str-consistency-check',
                   'nmr-cs-mr-merge',
                   'nmr-str2cif-annotate',
                   'nmr-if-merge-deposit',
                   'nmr-str-replace-cs')

# additional parameter keys for NmrVrptUtility class
NMR_STR_FILE_PATH_KEY = 'nmr_str_file_path'
RESULT_PKL_FILE_PATH_KEY = 'result_pickle_file_path'
CIF_READER_OBJ_KEY = 'coord_cif_reader_object'
NMR_CIF_READER_OBJ_KEY = 'nmr_cif_reader_object'
PYNMRSTAR_OBJ_KEY = 'pynmrstar_object'

# supported output param names for NmrVrptUtility class
VRPT_INPUT_PARAM_KEYS = (CIF_READER_OBJ_KEY,
                         NMR_CIF_READER_OBJ_KEY,
                         PYNMRSTAR_OBJ_KEY)

# supported input file names for NmrVrptUtility class
VRPT_INPUT_FILE_KEYS = (MODEL_FILE_PATH_KEY,
                        NMR_CIF_FILE_PATH_KEY,
                        NMR_STR_FILE_PATH_KEY)

# supported output file names for NmrVrptUtility class
VRPT_OUTPUT_FILE_KEYS = (RESULT_PKL_FILE_PATH_KEY,)

# support workflow operations of NmrVrptUtility class
VRPT_WORKFLOW_OPS = ('nmr-restraint-validation',)

# sub-directory name for cache files
SUB_DIR_NAME_FOR_CACHE = 'utils_nmr'

# default entry ID
DEFAULT_ENTRY_ID = 'UNNAMED'
# initial placeholder for entry ID
INITIAL_ENTRY_ID = 'EXTRACT_FROM_COORD'

# supported NEF dictionary version
NEF_VERSION = '1.1'

# supported NMR-STAR dictionary version
NMR_STAR_VERSION = '3.2.6.0'

# format name
NEF_FORMAT_NAME = 'nmr_exchange_format'

# NEF boolean values
NEF_BOOLEAN_VALUES = ('true', 'false')

# NMR-STAR boolean values
STAR_BOOLEAN_VALUES = ('yes', 'no')

# paramagnetic elements, except for Oxygen
PARAMAGNETIC_ELEMENTS = ('LI', 'NA', 'MG', 'AL', 'K', 'CA', 'SC', 'TI', 'V', 'MN', 'RB', 'SR',
                         'Y', 'ZR', 'NB', 'MO', 'TC', 'RU', 'RH', 'PD', 'SN', 'CS', 'BA', 'LA',
                         'CE', 'PR', 'ND', 'PM', 'SM', 'EU', 'GD', 'TB', 'DY', 'HO', 'ER', 'TM',
                         'YB', 'LU', 'HF', 'TA', 'W', 'RE', 'OS', 'IR', 'PT', 'FR', 'RA', 'AC')

# ferromagnetic elements
FERROMAGNETIC_ELEMENTS = ('CR', 'FE', 'CO', 'NI')

# lanthanoid elements
LANTHANOID_ELEMENTS = ('LA', 'CE', 'PR', 'ND', 'PM', 'SM', 'EU', 'GD', 'TB', 'DY', 'HO', 'ER', 'TM', 'YB', 'LU')

# non-metal elements
NON_METAL_ELEMENTS = ('H', 'C', 'N', 'O', 'F', 'P', 'S', 'SE')

# PDB compatible symbols of all elements
ELEMENT_SYMBOLS = {k.upper(): v for k, v in NAMES_ELEMENT.items()}

# limit number of spectral dimensions
MAX_DIM_NUM_OF_SPECTRA = 16

# isotope numbers of NMR observable nucleus
ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS = {'H': [1, 2, 3],
                                   'LI': [6],
                                   'B': [11, 10],
                                   'C': [13],
                                   'N': [15, 14],
                                   'O': [17],
                                   'F': [19],
                                   'NA': [23],
                                   'SI': [29],
                                   'P': [31],
                                   'S': [33],
                                   'CL': [35],
                                   'CA': [43],
                                   'CD': [113, 111],
                                   'XE': [129],
                                   'PT': [195]
                                   }

# isotope names of NMR observable nucleus
ISOTOPE_NAMES_OF_NMR_OBS_NUCS = []
for nuc_name, iso_nums in ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.items():
    for iso_num in iso_nums:
        ISOTOPE_NAMES_OF_NMR_OBS_NUCS.append(f'{iso_num}{nuc_name}')
ISOTOPE_NAMES_OF_NMR_OBS_NUCS = tuple(ISOTOPE_NAMES_OF_NMR_OBS_NUCS)

# nucleus with half spin
HALF_SPIN_NUCLEUS = ('H', 'C', 'N', 'P', 'F', 'CD')

# allowed BMRB ambiguity codes
ALLOWED_AMBIGUITY_CODES = (1, 2, 3, 4, 5, 6, 9)

ALLOWED_ISOTOPE_NUMBERS = []
for isotopeNums in ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.values():
    ALLOWED_ISOTOPE_NUMBERS.extend(isotopeNums)
ALLOWED_ISOTOPE_NUMBERS = tuple(ALLOWED_ISOTOPE_NUMBERS)

WELL_KNOWN_ISOTOPE_NUMBERS = copy.copy(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS['H'])
WELL_KNOWN_ISOTOPE_NUMBERS.extend(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS['C'])
WELL_KNOWN_ISOTOPE_NUMBERS.extend(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS['N'])
WELL_KNOWN_ISOTOPE_NUMBERS.extend(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS['P'])
WELL_KNOWN_ISOTOPE_NUMBERS = tuple(WELL_KNOWN_ISOTOPE_NUMBERS)

# maximum number of rows to perform explicit redundancy check
MAX_ROWS_TO_PERFORM_REDUNDANCY_CHECK = 20000

# maximum number of rows to perform index order check
MAX_ROWS_TO_PERFORM_INDEX_ORDER_CHECK = 10000

# maximum number of rows to be used for spectral peak list identification
MAX_ROWS_TO_CHECK_SPECTRAL_PEAK_IDENTITY = 10

# alternative dictionary of constraint type
ALT_DIST_CONSTRAINT_TYPES = {'nef': {'NOE': 'noe',
                                     'NOE build-up': 'noe_build_up',
                                     'noe build-up': 'noe_build_up',
                                     'NOE buildup': 'noe_build_up',
                                     'noe buildup': 'noe_build_up',
                                     'NOE build up': 'noe_build_up',
                                     'noe build up': 'noe_build_up',
                                     'noe not seen': 'noe_not_seen',
                                     'ROE': 'roe',
                                     'roe build-up': 'roe_build_up',
                                     'ROE buildup': 'roe_build_up',
                                     'roe buildup': 'roe_build_up',
                                     'ROE build up': 'roe_build_up',
                                     'roe build up': 'roe_build_up',
                                     'hydrogen bond': 'hbond',
                                     'Hbond': 'hbond',
                                     'HBond': 'hbond',
                                     'H-bond': 'hbond',
                                     'h-bond': 'hbond',
                                     'H-Bond': 'hbond',
                                     'Hydrogen bond': 'hbond',
                                     'disulfide bond': 'disulfide_bond',
                                     'Disulfide bond': 'disulfide_bond',
                                     'S-S bond': 'disulfide_bond',
                                     'SS bond': 'disulfide_bond',
                                     'SS-bond': 'disulfide_bond',
                                     'disulfide bridge': 'disulfide_bond',
                                     'Disulfide bridge': 'disulfide_bond',
                                     'paramagnetic relaxation': 'pre',
                                     'PRE': 'pre',
                                     'Paramagnetic relaxation': 'pre',
                                     'paramagnetic relaxation enhancement': 'pre',
                                     'Paramagnetic relaxation enhancement': 'pre',
                                     'general distance': 'undefined',
                                     'distance': 'undefined',
                                     'Mutation': 'mutation',
                                     'chemical shift perturbation': 'shift_perturbation',
                                     'shift perturbation': 'shift_perturbation',
                                     'chem shift perturbation': 'shift_perturbation',
                                     'CS perturbation': 'shift_perturbation',
                                     'csp': 'shift_perturbation',
                                     'CSP': 'shift_perturbation'
                                     },
                             'nmr-star': {'noe': 'NOE',
                                          'noe_build_up': 'NOE build-up',
                                          'noe build-up': 'NOE build-up',
                                          'NOE buildup': 'NOE build-up',
                                          'noe buildup': 'NOE build-up',
                                          'NOE build up': 'NOE build-up',
                                          'noe build up': 'NOE build-up',
                                          'noe_not_seen': 'NOE not seen',
                                          'noe not seen': 'NOE not seen',
                                          'roe': 'ROE',
                                          'roe_build_up': 'ROE build-up',
                                          'roe build-up': 'ROE build-up',
                                          'ROE buildup': 'ROE build-up',
                                          'roe buildup': 'ROE build-up',
                                          'ROE build up': 'ROE build-up',
                                          'roe build up': 'ROE build-up',
                                          'hbond': 'hydrogen bond',
                                          'Hbond': 'hydrogen bond',
                                          'HBond': 'hydrogen bond',
                                          'H-bond': 'hydrogen bond',
                                          'h-bond': 'hydrogen bond',
                                          'H-Bond': 'hydrogen bond',
                                          'Hydrogen bond': 'hydrogen bond',
                                          'disulfide_bond': 'disulfide bond',
                                          'Disulfide bond': 'disulfide bond',
                                          'S-S bond': 'disulfide bond',
                                          'SS bond': 'disulfide bond',
                                          'SS-bond': 'disulfide bond',
                                          'disulfide bridge': 'disulfide bond',
                                          'Disulfide bridge': 'disulfide bond',
                                          'PRE': 'paramagnetic relaxation',
                                          'pre': 'paramagnetic relaxation',
                                          'Paramagnetic relaxation': 'paramagnetic relaxation',
                                          'paramagnetic relaxation enhancement': 'paramagnetic relaxation',
                                          'Paramagnetic relaxation enhancement': 'paramagnetic relaxation',
                                          'Mutation': 'mutation',
                                          'unknown': 'general distance',
                                          'undefined': 'general distance',
                                          'shift_perturbation': 'chemical shift perturbation',
                                          'shift perturbation': 'chemical shift perturbation',
                                          'chem shift perturbation': 'chemical shift perturbation',
                                          'CS perturbation': 'chemical shift perturbation',
                                          'csp': 'chemical shift perturbation',
                                          'CSP': 'chemical shift perturbation'
                                          }
                             }

ALT_DIHED_CONSTRAINT_TYPES = {'nef': {'J-couplings': 'jcoupling',
                                      'j-couplings': 'jcoupling',
                                      'J couplings': 'jcoupling',
                                      'j couplings': 'jcoupling',
                                      'Jcouplings': 'jcoupling',
                                      'jcouplings': 'jcoupling',
                                      'J-coupling': 'jcoupling',
                                      'j-coupling': 'jcoupling',
                                      'J coupling': 'jcoupling',
                                      'j coupling': 'jcoupling',
                                      'Jcoupling': 'jcoupling',
                                      'chemical shift': 'chemical_shift',
                                      'Chemical shift': 'chemical_shift',
                                      'Chemical_shift': 'chemical_shift',
                                      'chemical shifts': 'chemical_shift',
                                      'Chemical shifts': 'chemical_shift',
                                      'Chemical_shifts': 'chemical_shift',
                                      'backbone chemical shifts': 'chemical_shift',
                                      'Backbone chemical shifts': 'chemical_shift',
                                      'Mainchain chemical shifts': 'chemical_shift',
                                      'mainchain chemical shifts': 'chemical_shift',
                                      'Main chain chemical shifts': 'chemical_shift',
                                      'main chain chemical shifts': 'chemical_shift',
                                      'bb chemical shifts': 'chemical_shift',
                                      'BB chemical shifts': 'chemical_shift',
                                      'backbone chemical shift': 'chemical_shift',
                                      'Backbone chemical shift': 'chemical_shift',
                                      'Mainchain chemical shift': 'chemical_shift',
                                      'mainchain chemical shift': 'chemical_shift',
                                      'Main chain chemical shift': 'chemical_shift',
                                      'main chain chemical shift': 'chemical_shift',
                                      'bb chemical shift': 'chemical_shift',
                                      'BB chemical shift': 'chemical_shift',
                                      'backbone chem shifts': 'chemical_shift',
                                      'Backbone chem shifts': 'chemical_shift',
                                      'Mainchain chem shifts': 'chemical_shift',
                                      'mainchain chem shifts': 'chemical_shift',
                                      'Main chain chem shifts': 'chemical_shift',
                                      'main chain chem shifts': 'chemical_shift',
                                      'bb chem shifts': 'chemical_shift',
                                      'BB chem shifts': 'chemical_shift',
                                      'backbone chem shift': 'chemical_shift',
                                      'Backbone chem shift': 'chemical_shift',
                                      'Mainchain chem shift': 'chemical_shift',
                                      'mainchain chem shift': 'chemical_shift',
                                      'Main chain chem shift': 'chemical_shift',
                                      'main chain chem shift': 'chemical_shift',
                                      'bb chem shift': 'chemical_shift',
                                      'BB chem shift': 'chemical_shift',
                                      'backbone cs': 'chemical_shift',
                                      'Backbone cs': 'chemical_shift',
                                      'Mainchain cs': 'chemical_shift',
                                      'mainchain cs': 'chemical_shift',
                                      'Main chain cs': 'chemical_shift',
                                      'main chain cs': 'chemical_shift',
                                      'bb cs': 'chemical_shift',
                                      'BB cs': 'chemical_shift',
                                      'backbone CS': 'chemical_shift',
                                      'Backbone CS': 'chemical_shift',
                                      'Mainchain CS': 'chemical_shift',
                                      'mainchain CS': 'chemical_shift',
                                      'Main chain CS': 'chemical_shift',
                                      'main chain CS': 'chemical_shift',
                                      'bb CS': 'chemical_shift',
                                      'BB CS': 'chemical_shift',
                                      'TALOS': 'chemical_shift',
                                      'talos': 'chemical_shift',
                                      'TALOS+': 'chemical_shift',
                                      'talos+': 'chemical_shift',
                                      'TALOS-N': 'chemical_shift',
                                      'talos-n': 'chemical_shift'
                                      },
                              'nmr-star': {'jcoupling': 'J-couplings',
                                           'Jcoupling': 'J-couplings',
                                           'jcouplings': 'J-couplings',
                                           'Jcouplings': 'J-couplings',
                                           'j-couplings': 'J-couplings',
                                           'J couplings': 'J-couplings',
                                           'j couplings': 'J-couplings',
                                           'J-coupling': 'J-couplings',
                                           'j-coupling': 'J-couplings',
                                           'J coupling': 'J-couplings',
                                           'j coupling': 'J-couplings',
                                           'chemical_shift': 'backbone chemical shifts',
                                           'Chemical_shift': 'backbone chemical shifts',
                                           'chemical_shifts': 'backbone chemical shifts',
                                           'Chemical_shifts': 'backbone chemical shifts',
                                           'chemical shift': 'backbone chemical shifts',
                                           'Chemical shift': 'backbone chemical shifts',
                                           'chemical shifts': 'backbone chemical shifts',
                                           'Chemical shifts': 'backbone chemical shifts',
                                           'Backbone chemical shifts': 'backbone chemical shifts',
                                           'Mainchain chemical shifts': 'backbone chemical shifts',
                                           'mainchain chemical shifts': 'backbone chemical shifts',
                                           'Main chain chemical shifts': 'backbone chemical shifts',
                                           'main chain chemical shifts': 'backbone chemical shifts',
                                           'bb chemical shifts': 'backbone chemical shifts',
                                           'BB chemical shifts': 'backbone chemical shifts',
                                           'backbone chemical shift': 'backbone chemical shifts',
                                           'Backbone chemical shift': 'backbone chemical shifts',
                                           'Mainchain chemical shift': 'backbone chemical shifts',
                                           'mainchain chemical shift': 'backbone chemical shifts',
                                           'Main chain chemical shift': 'backbone chemical shifts',
                                           'main chain chemical shift': 'backbone chemical shifts',
                                           'bb chemical shift': 'backbone chemical shifts',
                                           'BB chemical shift': 'backbone chemical shifts',
                                           'backbone chem shifts': 'backbone chemical shifts',
                                           'Backbone chem shifts': 'backbone chemical shifts',
                                           'Mainchain chem shifts': 'backbone chemical shifts',
                                           'mainchain chem shifts': 'backbone chemical shifts',
                                           'Main chain chem shifts': 'backbone chemical shifts',
                                           'main chain chem shifts': 'backbone chemical shifts',
                                           'bb chem shifts': 'backbone chemical shifts',
                                           'BB chem shifts': 'backbone chemical shifts',
                                           'backbone chem shift': 'backbone chemical shifts',
                                           'Backbone chem shift': 'backbone chemical shifts',
                                           'Mainchain chem shift': 'backbone chemical shifts',
                                           'mainchain chem shift': 'backbone chemical shifts',
                                           'Main chain chem shift': 'backbone chemical shifts',
                                           'main chain chem shift': 'backbone chemical shifts',
                                           'bb chem shift': 'backbone chemical shifts',
                                           'BB chem shift': 'backbone chemical shifts',
                                           'backbone cs': 'backbone chemical shifts',
                                           'Backbone cs': 'backbone chemical shifts',
                                           'Mainchain cs': 'backbone chemical shifts',
                                           'mainchain cs': 'backbone chemical shifts',
                                           'Main chain cs': 'backbone chemical shifts',
                                           'main chain cs': 'backbone chemical shifts',
                                           'bb cs': 'backbone chemical shifts',
                                           'BB cs': 'backbone chemical shifts',
                                           'backbone CS': 'backbone chemical shifts',
                                           'Backbone CS': 'backbone chemical shifts',
                                           'Mainchain CS': 'backbone chemical shifts',
                                           'mainchain CS': 'backbone chemical shifts',
                                           'Main chain CS': 'backbone chemical shifts',
                                           'main chain CS': 'backbone chemical shifts',
                                           'bb CS': 'backbone chemical shifts',
                                           'BB CS': 'backbone chemical shifts',
                                           'TALOS': 'backbone chemical shifts',
                                           'talos': 'backbone chemical shifts',
                                           'TALOS+': 'backbone chemical shifts',
                                           'talos+': 'backbone chemical shifts',
                                           'TALOS-N': 'backbone chemical shifts',
                                           'talos-n': 'backbone chemical shifts'
                                           }
                              }

ALT_RDC_CONSTRAINT_TYPES = {'nef': {'RDC': 'measured',
                                    'rdc': 'measured'
                                    },
                            'nmr-star': {'rdc': 'RDC',
                                         'measured': 'RDC'
                                         }
                            }

# ignored residues from chemical shift statistics
CS_STAT_IGNORED_LIG_CODE = ('N9K',)

# criterion for minor chemical shift statistics
CS_STAT_AA_THRESHOLD = 0.1
CS_STAT_NA_THRESHOLD = 0.25
CS_STAT_MAX_COUNT_THRESHOLD = 10

# criterion for low sequence coverage
LOW_SEQ_COVERAGE = 0.3

# criterion for minimum sequence coverage when conflict occurs (NMR conventional deposition)
MIN_SEQ_COVERAGE_W_CONFLICT = 0.95

# empty value
EMPTY_VALUE = (None, '', '.', '?', 'null', 'None')

# true value
TRUE_VALUE = ('true', 't', 'yes', 'y', '1')

# taken from wwpdb.utils.align.SequenceReferenceData.py
STD_MON_DICT = {'ALA': 'A',
                'ARG': 'R',
                'ASN': 'N',
                'ASP': 'D',
                'ASX': 'B',
                'CYS': 'C',
                'GLN': 'Q',
                'GLU': 'E',
                'GLX': 'Z',
                'GLY': 'G',
                'HIS': 'H',
                'ILE': 'I',
                'LEU': 'L',
                'LYS': 'K',
                'MET': 'M',
                'PHE': 'F',
                'PRO': 'P',
                'SER': 'S',
                'THR': 'T',
                'TRP': 'W',
                'TYR': 'Y',
                'VAL': 'V',
                'DA': 'A',
                'DC': 'C',
                'DG': 'G',
                'DT': 'T',
                'DU': 'U',
                'DI': 'I',
                'A': 'A',
                'C': 'C',
                'G': 'G',
                'I': 'I',
                'T': 'T',
                'U': 'U'
                }

PROTON_BEGIN_CODE = ('H', '1', '2', '3')
PSE_PRO_BEGIN_CODE = ('H', 'Q', 'M', '1', '2', '3')
AMINO_PROTON_CODE = ('H', 'HN', 'H1', 'H2', 'H3', 'HT1', 'HT2', 'HT3', 'H1*', 'H2*', 'H3*', 'HT', 'HT%', 'HT*', 'HT#')
CARBOXYL_CODE = ('C', 'O', 'O1', 'O2', 'OT1', 'OT2', 'OXT', 'HXT')
JCOUP_BB_PAIR_CODE = ('N', 'H', 'CA', 'C')
RDC_BB_PAIR_CODE = ('N', 'H', 'CA')
ZINC_ION_CODE = ('ZN', 'ME', 'Z1', 'Z2')
CALCIUM_ION_CODE = ('CA2', 'CA2+', 'CA+2', 'ME')
UNKNOWN_RESIDUE = ('UNK', 'DN', 'N')

RESERVED_LIG_CODE = ('LIG', 'DRG', 'INH')
DNR_PARENT_CODE = ('DC', 'CYT', 'DC5', 'DC3')
CH_PARENT_CODE = ('C', 'RCYT', 'C5', 'C3')

PDB_ID_PAT = re.compile(r'^([Pp][Dd][Bb]_)?(\d{4})?[1-9]\w{3}$')
LEGACY_PDB_ID_PAT = re.compile(r'^[1-9]\w{3}$')

BMRB_ID_PAT = re.compile(r'^(bmr)?([1-9]\d{0,4})$')

DEP_ID_PAT = re.compile(r'^D_[1-9]\d{5,9}$')

CCD_ID_PAT = re.compile(r'^(\w{1,3}|\w{5})$')

BMRB_NMR_STAR_FILE_NAME_PAT = re.compile(r'^bmr[1-9]\d{0,4}_3.str$')

WORK_MODEL_FILE_NAME_PAT = re.compile(r'^(D_[1-9]\d{5,9})_model_P1\.cif\.V\d+$')
WORK_NMR_DATA_FILE_NAME_PAT = re.compile(r'^(D_[1-9]\d{5,9})_nmr-data-str_P1\.cif\.V(\d+)$')

PDB_MR_FILE_NAME_PAT = re.compile(r'^[1-9]\w{3}.mr$')
PDB_MR_FILE_HEADER_PAT = re.compile(r'(.*)# Restraints file (\d+): (\S+)\s*')

INTNL_MODEL_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_model-(\S+)_P1\.cif\.V(\d+)$')
INTNL_CS_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_cs-(\S+)_P1\.cif\.V(\d+)')
INTNL_MR_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_mr-(\S+)_P(\d+)\.(\S+)\.V(\d+)$')
INTNL_PK_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_nmr-peaks-upload_P(\d+)\.dat\.V(\d+)$')

INTNL_EXT_MODEL_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_model-upload_P(\d+)\.dat\.V(\d+)$')
INTNL_ANY_MR_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_mr(-(upload|upload-convert|deposit|annotate|release|review))?_P\d+\.'
                                        r'(amber|aria|biosym|charmm|cns|cyana|dynamo|gromacs|isd|rosetta|schrodinger|sybyl|xplor-nih)'  # noqa: E501, pylint: disable=line-too-long
                                        r'\.V\d+$')
INTNL_ANY_FILE_NAME_PAT = re.compile(r'^D_[1-9]\d{5,9}_\S+(-(upload|upload-convert|deposit|annotate|release|review))?_P\d+'
                                     r'\.\S+\.V\d+$')

DATABLOCK_PAT = re.compile(r'\s*data_(\S+)\s*')
SF_ANONYMOUS_PAT = re.compile(r'\s*save_\S+\s*')
SAVE_PAT = re.compile(r'\s*save_\s*')
LOOP_PAT = re.compile(r'\s*loop_\s*')
STOP_PAT = re.compile(r'\s*stop_\s*')
CIF_STOP_PAT = re.compile(r'#\s*')
WS_PAT = re.compile(r'\s+')
COMMENT_PAT = re.compile(r'\s*[#!]+(.*)')

CATEGORY_PAT = re.compile(r'\s*_(\S*)\..*\s*')
TAGVALUE_PAT = re.compile(r'\s*_(\S*)\.(\S*)\s+(.*)\s*')
SF_CATEGORY_PAT = re.compile(r'\s*_\S*\.Sf_category\s*\S+\s*')
SF_FRAMECODE_PAT = re.compile(r'\s*_\S*\.Sf_framecode\s*\s+\s*')

SEQ_MISMATCH_WARNING_PAT = re.compile(r"\[Sequence mismatch warning\] \[.*\] The residue '(\d+):([0-9A-Z]+)' is not present "
                                      r"in polymer sequence of chain (\S+) of the coordinates. "
                                      r"Please update the sequence in the Macromolecules page.")
INCONSISTENT_RESTRAINT_WARNING_PAT = re.compile(r"^\[[^\]]+\] \[Check the (\d+)th row of [^,]+s ?.*, (\S+)\] .*$")
INCONSISTENT_RESTRAINT_WARNING_WO_SF_PAT = re.compile(r"^\[[^\]]+\] \[Check the (\d+)th row of ([^,]+)s.*\] .*$")

CONCAT_SEQ_ID_INS_CODE_PAT = re.compile(r'(\d+)([A-Za-z\.\?]+)')

# patterns for enum failure message
CHK_DESC_PAT = re.compile(r'^(.*) \'(.*)\' should be one of \((.*)\)\.(.*)$')
CHK_DESC_ONE_PAT = re.compile(r'^(.*) \'(.*)\' should be one of (.*)\.(.*)$')
CHK_DESC_MAND_PAT = re.compile(r'^The mandatory type _.*\.(.*) \'(.*)\' is missing and the type must be one of \((.*)\)\.(.*)$')
CHK_DESC_MAND_ONE_PAT = re.compile(r'^The mandatory type _.*\.(.*) \'(.*)\' is missing and the type must be one of (.*)\.(.*)$')

MISMATCHED_INPUT_ERR_MSG = "mismatched input"  # NOTICE: depends on ANTLR v4
EXTRANEOUS_INPUT_ERR_MSG = "extraneous input"  # NOTICE: depends on ANTLR v4
NO_VIABLE_ALT_ERR_MSG = "no viable alternative at input"  # NOTICE: depends on ANTLR v4
EXPECTING_L_PAREN = "expecting L_paren"  # NOTICE: depends on ANTLR v4 and (Xplor|Cns)MRLexer.g4

LINEAR_MR_FILE_TYPES = ('nm-res-bio', 'nm-res-cya', 'nm-res-ros', 'nm-res-syb')

RETRIAL_MR_FILE_TYPES = ('nm-res-ari', 'nm-res-arx', 'nm-res-bio', 'nm-res-cns',
                         'nm-res-cha', 'nm-res-cya', 'nm-res-dyn', 'nm-res-isd',
                         'nm-res-noa', 'nm-res-ros', 'nm-res-sch', 'nm-res-syb',
                         'nm-res-xpl')

PARSABLE_MR_FILE_TYPES = ('nm-aux-amb', 'nm-aux-cha', 'nm-aux-gro', 'nm-aux-pdb',
                          'nm-res-amb', 'nm-res-ari', 'nm-res-arx', 'nm-res-bar',
                          'nm-res-bio', 'nm-res-cha', 'nm-res-cns', 'nm-res-cya',
                          'nm-res-dyn', 'nm-res-gro', 'nm-res-isd', 'nm-res-noa',
                          'nm-res-sch', 'nm-res-syb', 'nm-res-ros', 'nm-res-xpl')

ARCHIVAL_MR_FILE_TYPES = ('nmr-star',
                          'nm-aux-amb', 'nm-aux-cha', 'nm-aux-gro', 'nm-aux-pdb',
                          'nm-res-amb', 'nm-res-ari', 'nm-res-arx', 'nm-res-bar',
                          'nm-res-bio', 'nm-res-cha', 'nm-res-cns', 'nm-res-cya',
                          'nm-res-dyn', 'nm-res-gro', 'nm-res-isd', 'nm-res-noa',
                          'nm-res-oth', 'nm-res-sax', 'nm-res-sch', 'nm-res-syb',
                          'nm-res-ros', 'nm-res-xpl')

PARSABLE_PK_FILE_TYPES = ('nm-aux-xea',
                          'nm-pea-ari', 'nm-pea-bar', 'nm-pea-ccp', 'nm-pea-oli',
                          'nm-pea-pip', 'nm-pea-pon', 'nm-pea-spa', 'nm-pea-sps',
                          'nm-pea-top', 'nm-pea-vie', 'nm-pea-vnm', 'nm-pea-xea',
                          'nm-pea-xwi')

LARGE_ASYM_ID = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
                 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
                 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
                 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
LEN_LARGE_ASYM_ID = len(LARGE_ASYM_ID)
LEN_MAJOR_ASYM_ID = 26

# maximum number of magnetically identifiable chain IDs
MAX_MAG_IDENT_ASYM_ID = 2

MAX_ERROR_REPORT = 1
MAX_ERR_LINE_NUM = 20

REPRESENTATIVE_MODEL_ID = 1
REPRESENTATIVE_ASYM_ID = 'A'
REPRESENTATIVE_ALT_ID = 'A'

MAX_PREF_LABEL_SCHEME_COUNT = 100

GLOBAL_OFFSET_ATTEMPT = 1000
LOCAL_OFFSET_ATTEMPT = 100
PERIPH_OFFSET_ATTEMPT = 10

MAX_ALLOWED_EXT_SEQ = 2

MIN_EXT_SEQ_FOR_ATOM_SEL_ERR = 12

UNREAL_AUTH_SEQ_NUM = -10000

MAX_CONFLICT_ATTEMPT = 5

DIST_RESTRAINT_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 101.0}
DIST_RESTRAINT_ERROR = {'min_exclusive': 0.0, 'max_exclusive': 150.0}

ANGLE_RESTRAINT_RANGE = {'min_inclusive': -420.0, 'max_inclusive': 420.0}  # 2n96, 5o4d, (400) 6gbm (420)
ANGLE_RESTRAINT_ERROR = {'min_exclusive': -450.0, 'max_exclusive': 450.0}

RDC_RESTRAINT_RANGE = {'min_inclusive': -150.0, 'max_inclusive': 150.0}
RDC_RESTRAINT_ERROR = {'min_exclusive': -200.0, 'max_exclusive': 200.0}

CS_RESTRAINT_RANGE = {'min_inclusive': -300.0, 'max_inclusive': 300.0}
CS_RESTRAINT_ERROR = {'min_exclusive': -999.0, 'max_exclusive': 999.0}

CSA_RESTRAINT_RANGE = {'min_inclusive': -300.0, 'max_inclusive': 300.0}
CSA_RESTRAINT_ERROR = {'min_exclusive': -999.0, 'max_exclusive': 999.0}

PCS_RESTRAINT_RANGE = {'min_inclusive': -20.0, 'max_inclusive': 20.0}
PCS_RESTRAINT_ERROR = {'min_exclusive': -40.0, 'max_exclusive': 40.0}

CCR_RESTRAINT_RANGE = {'min_inclusive': -10.0, 'max_inclusive': 10.0}
CCR_RESTRAINT_ERROR = {'min_exclusive': -20.0, 'max_exclusive': 20.0}

PRE_RESTRAINT_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 5000.0}  # 2mp0 (5000)
PRE_RESTRAINT_ERROR = {'min_exclusive': -5.0, 'max_exclusive': 10000.0}

T1T2_RESTRAINT_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 20.0}
T1T2_RESTRAINT_ERROR = {'min_exclusive': -0.05, 'max_exclusive': 100.0}

CS_UNCERTAINTY_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 3.0}

DIST_UNCERTAINTY_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 5.0}

ANGLE_UNCERTAINTY_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 90.0}

RDC_UNCERTAINTY_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 5.0}

WEIGHT_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 100.0}

SCALE_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 100.0}

PROBABILITY_RANGE = {'min_inclusive': 0.0, 'max_inclusive': 1.0}

DIST_RANGE_MIN = DIST_RESTRAINT_RANGE['min_inclusive']
DIST_RANGE_MAX = DIST_RESTRAINT_RANGE['max_inclusive']

DIST_ERROR_MIN = DIST_RESTRAINT_ERROR['min_exclusive']
DIST_ERROR_MAX = DIST_RESTRAINT_ERROR['max_exclusive']

ANGLE_RANGE_MIN = ANGLE_RESTRAINT_RANGE['min_inclusive']
ANGLE_RANGE_MAX = ANGLE_RESTRAINT_RANGE['max_inclusive']

ANGLE_ERROR_MIN = ANGLE_RESTRAINT_ERROR['min_exclusive']
ANGLE_ERROR_MAX = ANGLE_RESTRAINT_ERROR['max_exclusive']

RDC_RANGE_MIN = RDC_RESTRAINT_RANGE['min_inclusive']
RDC_RANGE_MAX = RDC_RESTRAINT_RANGE['max_inclusive']

RDC_ERROR_MIN = RDC_RESTRAINT_ERROR['min_exclusive']
RDC_ERROR_MAX = RDC_RESTRAINT_ERROR['max_exclusive']

CS_RANGE_MIN = CS_RESTRAINT_RANGE['min_inclusive']
CS_RANGE_MAX = CS_RESTRAINT_RANGE['max_inclusive']

CS_ERROR_MIN = CS_RESTRAINT_ERROR['min_exclusive']
CS_ERROR_MAX = CS_RESTRAINT_ERROR['max_exclusive']

CSA_RANGE_MIN = CSA_RESTRAINT_RANGE['min_inclusive']
CSA_RANGE_MAX = CSA_RESTRAINT_RANGE['max_inclusive']

CSA_ERROR_MIN = CSA_RESTRAINT_ERROR['min_exclusive']
CSA_ERROR_MAX = CSA_RESTRAINT_ERROR['max_exclusive']

PCS_RANGE_MIN = PCS_RESTRAINT_RANGE['min_inclusive']
PCS_RANGE_MAX = PCS_RESTRAINT_RANGE['max_inclusive']

PCS_ERROR_MIN = PCS_RESTRAINT_ERROR['min_exclusive']
PCS_ERROR_MAX = PCS_RESTRAINT_ERROR['max_exclusive']

CCR_RANGE_MIN = CCR_RESTRAINT_RANGE['min_inclusive']
CCR_RANGE_MAX = CCR_RESTRAINT_RANGE['max_inclusive']

CCR_ERROR_MIN = CCR_RESTRAINT_ERROR['min_exclusive']
CCR_ERROR_MAX = CCR_RESTRAINT_ERROR['max_exclusive']

PRE_RANGE_MIN = PRE_RESTRAINT_RANGE['min_inclusive']
PRE_RANGE_MAX = PRE_RESTRAINT_RANGE['max_inclusive']

PRE_ERROR_MIN = PRE_RESTRAINT_ERROR['min_exclusive']
PRE_ERROR_MAX = PRE_RESTRAINT_ERROR['max_exclusive']

T1T2_RANGE_MIN = T1T2_RESTRAINT_RANGE['min_inclusive']
T1T2_RANGE_MAX = T1T2_RESTRAINT_RANGE['max_inclusive']

T1T2_ERROR_MIN = T1T2_RESTRAINT_ERROR['min_exclusive']
T1T2_ERROR_MAX = T1T2_RESTRAINT_ERROR['max_exclusive']

WEIGHT_RANGE_MIN = WEIGHT_RANGE['min_inclusive']
WEIGHT_RANGE_MAX = WEIGHT_RANGE['max_inclusive']

DIST_AMBIG_LOW = 1.0
DIST_AMBIG_BND = 4.0
DIST_AMBIG_MED = 6.0
DIST_AMBIG_UP = 12.0
DIST_AMBIG_UNCERT = 0.05

CS_UNCERT_MAX = CS_UNCERTAINTY_RANGE['max_inclusive']

DIST_UNCERT_MAX = DIST_UNCERTAINTY_RANGE['max_inclusive']

ANGLE_UNCERT_MAX = ANGLE_UNCERTAINTY_RANGE['max_inclusive']

RDC_UNCERT_MAX = RDC_UNCERTAINTY_RANGE['max_inclusive']

THRESHOLD_FOR_CIRCULAR_SHIFT = 355.0

PLANE_LIKE_LOWER_LIMIT = -10.0
PLANE_LIKE_UPPER_LIMIT = 10.0

# @see: https://x3dna.org/highlights/torsion-angles-of-nucleic-acid-structures for nucleic acids
KNOWN_ANGLE_ATOM_NAMES = {'PHI': ['C', 'N', 'CA', 'C'],  # i-1, i, i, i
                          'PSI': ['N', 'CA', 'C', 'N'],  # i, i, i, i+1
                          # i, i, i+1, i+1; modified CYANA definition [O C N (H or CD for Proline residue)]
                          'OMEGA': ['CA', 'C', 'N', 'CA'],
                          'CHI1': ['N', 'CA', re.compile(r'CB1?'), re.compile(r'^[COS]G1?$')],  # DIV: [N, CA, CB1, CG1]
                          'CHI2': ['CA', 'CB', re.compile(r'^CG1?$'), re.compile(r'^[CNOS]D1?$')],
                          'CHI3': ['CB', 'CG', re.compile(r'^[CS]D$'), re.compile(r'^[CNO]E1?|N$')],
                          'CHI4': ['CG', 'CD', re.compile(r'^[CN]E$'), re.compile(r'^[CN]Z$')],
                          'CHI5': ['CD', 'NE', 'CZ', 'NH1'],
                          # ILE: (CG1, CD1), THR: (OG1, HG1), VAL: (CD1, HG11)
                          'CHI21': ['CA', 'CB', re.compile(r'^[CO]G1$'), re.compile(r'^CD1|HG11?$')],
                          'CHI22': ['CA', 'CB', 'CG2', 'HG21'],  # ILE or THR or VAL
                          'CHI31': ['CB', re.compile(r'^CG1?$'), 'CD1', 'HD11'],  # ILE: CG1, LEU: CG
                          # ASP: (OD2, HD2), LEU: (CD2, HD21)
                          'CHI32': ['CB', 'CG', re.compile(r'^[CO]D2$'), re.compile(r'^HD21?$')],
                          'CHI42': ['CG', 'CD', 'OE2', 'HE2'],  # GLU
                          'ALPHA': ["O3'", 'P', "O5'", "C5'"],  # i-1, i, i, i
                          'BETA': ['P', "O5'", "C5'", "C4'"],
                          'GAMMA': ["O5'", "C5'", "C4'", "C3'"],
                          'DELTA': ["C5'", "C4'", "C3'", "O3'"],
                          'EPSILON': ["C4'", "C3'", "O3'", 'P'],  # i, i, i, i+1
                          'ZETA': ["C3'", "O3'", 'P', "O5'"],  # i, i, i+1, i+1
                          # aka. CHIN (nucleic CHI angle)
                          'CHI': {'Y': ["O4'", "C1'", 'N1', 'C2'],  # for pyrimidines (i.e. C, T, U) N1/3
                                  'R': ["O4'", "C1'", 'N9', 'C4']  # for purines (i.e. G, A) N1/3/7/9
                                  },
                          'ETA': ["C4'", 'P', "C4'", 'P'],  # i-1, i, i, i+1
                          'THETA': ['P', "C4'", 'P', "C4'"],  # i, i, i+1, i+1
                          "ETA'": ["C1'", 'P', "C1'", 'P'],  # i-1, i, i, i+1
                          "THETA'": ['P', "C1'", 'P', "C1'"],  # i, i, i+1, i+1
                          'NU0': ["C4'", "O4'", "C1'", "C2'"],
                          'NU1': ["O4'", "C1'", "C2'", "C3'"],
                          'NU2': ["C1'", "C2'", "C3'", "C4'"],
                          'NU3': ["C2'", "C3'", "C4'", "O4'"],
                          'NU4': ["C3'", "C4'", "O4'", "C1'"],
                          'TAU0': ["C4'", "O4'", "C1'", "C2'"],  # identical to NU0
                          'TAU1': ["O4'", "C1'", "C2'", "C3'"],  # identical to NU1
                          'TAU2': ["C1'", "C2'", "C3'", "C4'"],  # identical to NU2
                          'TAU3': ["C2'", "C3'", "C4'", "O4'"],  # identical to NU3
                          'TAU4': ["C3'", "C4'", "O4'", "C1'"],  # identical to NU4
                          # phase angle of pseudorotation made up from five NU[0-4] dihedral angles
                          'PPA': ["C1'", "C2'", "C3'", "C4'", "O4'"]
                          }

# @see: http://dx.doi.org/10.1107/S0907444909001905
KNOWN_ANGLE_CARBO_ATOM_NAMES = {'PHI': [re.compile(r'^H1|O5$'), 'C1', re.compile(r'^O[14]$'), re.compile(r'^C[46]$')],
                                'PSI': ['C1', re.compile(r'^O[14]$'), re.compile(r'^C[46]$'), re.compile(r'^H4|C[35]$')],
                                'OMEGA': [re.compile(r'^O[14]$'), 'C6', 'C5', re.compile('^H5|C4|O5$')]}

KNOWN_ANGLE_NAMES = KNOWN_ANGLE_ATOM_NAMES.keys()

KNOWN_ANGLE_SEQ_OFFSET = {'PHI': [-1, 0, 0, 0],  # i-1, i, i, i
                          'PSI': [0, 0, 0, 1],  # i, i, i, i+1
                          'OMEGA': [0, 0, 1, 1],  # i, i, i+1, i+1; modified CYANA definition [O C N (H or CD for Proline residue)]
                          'CHI1': [0] * 4,
                          'CHI2': [0] * 4,
                          'CHI3': [0] * 4,
                          'CHI4': [0] * 4,
                          'CHI5': [0] * 4,
                          'CHI21': [0] * 4,  # ILE: (CG1, CD1), THR: (OG1, HG1), VAL: (CD1, HG11)
                          'CHI22': [0] * 4,  # ILE or THR or VAL
                          'CHI31': [0] * 4,  # ILE: CG1, LEU: CG
                          'CHI32': [0] * 4,  # ASP: (OD2, HD2), LEU: (CD2, HD21)
                          'CHI42': [0] * 4,  # GLU
                          'ALPHA': [-1, 0, 0, 0],  # i-1, i, i, i
                          'BETA': [0] * 4,
                          'GAMMA': [0] * 4,
                          'DELTA': [0] * 4,
                          'EPSILON': [0, 0, 0, 1],  # i, i, i, i+1
                          'ZETA': [0, 0, 1, 1],  # i, i, i+1, i+1
                          # aka. CHIN (nucleic CHI angle)
                          'CHI': {'Y': [0] * 4,  # for pyrimidines (i.e. C, T, U) N1/3
                                  'R': [0] * 4  # for purines (i.e. G, A) N1/3/7/9
                                  },
                          'ETA': [-1, 0, 0, 1],  # i-1, i, i, i+1
                          'THETA': [0, 0, 1, 1],  # i, i, i+1, i+1
                          "ETA'": [-1, 0, 0, 1],  # i-1, i, i, i+1
                          "THETA'": [0, 0, 1, 1],  # i, i, i+1, i+1
                          'NU0': [0] * 4,
                          'NU1': [0] * 4,
                          'NU2': [0] * 4,
                          'NU3': [0] * 4,
                          'NU4': [0] * 4,
                          'TAU0': [0] * 4,  # identical to NU0
                          'TAU1': [0] * 4,  # identical to NU1
                          'TAU2': [0] * 4,  # identical to NU2
                          'TAU3': [0] * 4,  # identical to NU3
                          'TAU4': [0] * 4,  # identical to NU4
                          'PPA': [0] * 5  # phase angle of pseudorotation made up from five NU[0-4] dihedral angles
                          }

KNOWN_ANGLE_CARBO_SEQ_OFFSET = {'PHI': [0, 0, 0, -1],  # i, i, i, i-n; for n > 0
                                'PSI': [0, 0, -1, -1],  # i, i, i-n, i-n; for n > 0
                                'OMEGA': [0, -1, -1, -1]  # i, i-n, i-n, i-n; for n > 0
                                }

XPLOR_RDC_PRINCIPAL_AXIS_NAMES = ('OO', 'X', 'Y', 'Z')

XPLOR_ORIGIN_AXIS_COLS = (0, 1, 2, 3)

XPLOR_NITROXIDE_NAMES = ('NO', 'NX', 'NR', 'NAI', 'NAQ', 'NS1', 'ON', 'OS', 'OS1', 'OAH', 'SLC', 'GD')

NITROOXIDE_ANCHOR_RES_NAMES = ('CYS', 'SER', 'GLU', 'ASP', 'GLN', 'ASN', 'LYS', 'THR', 'HIS',
                               'ILE', 'LEU', 'MET', 'R1A', '3X9')

HEME_LIKE_RES_NAMES = ('HEM', 'HEB', 'HEC', 'MH0')

LEGACY_PDB_RECORDS = ('HEADER', 'OBSLTE', 'TITLE ', 'SPLIT ', 'CAVEAT', 'COMPND', 'SOURCE', 'KEYWDS', 'EXPDTA',
                      'NUMMDL', 'MDLTYP', 'AUTHOR', 'REVDAT', 'SPRSDE', 'JRNL', 'REMARK',
                      'DBREF', 'DBREF1', 'DBREF2', 'SEQADV', 'SEQRES', 'MODRES',
                      'HET ', 'HETNAM', 'HETSYN', 'FORMUL',
                      'HELIX ', 'SHEET ', 'TURN',
                      'SSBOND', 'LINK ', 'CISPEP',
                      'SITE ',
                      'CRYST1', 'ORIGX1', 'ORIGX2', 'ORIGX3', 'SCALE1', 'SCALE2', 'SCALE3',
                      'MTRIX1', 'MTRIX2', 'MTRIX3',
                      'MODEL ', 'ATOM ', 'ANISOU', 'TER ', 'HETATM', 'ENDMDL',
                      'CONECT',
                      'MASTER')

LEGACY_PDB_RECORDS_WO_REMARK = [record for record in LEGACY_PDB_RECORDS if record != 'REMARK']
LEGACY_PDB_RECORDS_WO_REMARK = tuple(LEGACY_PDB_RECORDS_WO_REMARK)

CYANA_MR_FILE_EXTS = (None, 'upl', 'lol', 'aco', 'rdc', 'pcs', 'upv', 'lov', 'cco')

# NMR content types
NMR_CONTENT_SUBTYPES = ('entry_info',
                        'poly_seq',
                        'entity',
                        'chem_shift',
                        'chem_shift_ref',
                        'dist_restraint',
                        'dihed_restraint',
                        'rdc_restraint',
                        'spectral_peak',
                        'spectral_peak_alt',
                        'noepk_restraint',
                        'jcoup_restraint',
                        'rdc_raw_data',
                        'csa_restraint',
                        'ddc_restraint',
                        'hvycs_restraint',
                        'procs_restraint',
                        'csp_restraint',
                        'auto_relax_restraint',
                        'heteronucl_noe_data',
                        'heteronucl_t1_data',
                        'heteronucl_t2_data',
                        'heteronucl_t1r_data',
                        'order_param_data',
                        'ph_titr_data',
                        'ph_param_data',
                        'coupling_const_data',
                        'ccr_d_csa_restraint',
                        'ccr_dd_restraint',
                        'fchiral_restraint',
                        'saxs_restraint',
                        'other_restraint')

MR_CONTENT_SUBTYPES = ['dist_restraint',
                       'dihed_restraint',
                       'rdc_restraint',
                       'noepk_restraint',
                       'jcoup_restraint',
                       'rdc_raw_data',
                       'csa_restraint',
                       'ddc_restraint',
                       'hvycs_restraint',
                       'procs_restraint',
                       'csp_restraint',
                       'auto_relax_restraint',
                       'heteronucl_noe_data',
                       'heteronucl_t1_data',
                       'heteronucl_t2_data',
                       'heteronucl_t1r_data',
                       'order_param_data',
                       'ph_titr_data',
                       'ph_param_data',
                       'coupling_const_data',
                       'ccr_d_csa_restraint',
                       'ccr_dd_restraint',
                       'fchiral_restraint',
                       'saxs_restraint',
                       'other_restraint'
                       ]

PK_CONTENT_SUBTYPES = ('spectral_peak',
                       'spectral_peak_alt')

CIF_CONTENT_SUBTYPES = ('poly_seq',
                        'non_poly',
                        'branched',
                        'coordinate')

# readable file type
READABLE_FILE_TYPE = {'nef': 'NEF (NMR Exchange Format)',
                      'nmr-star': 'NMR-STAR',
                      'pdbx': 'PDBx/mmCIF',
                      'unknown': 'unknown'
                      }

LP_ITEM_TYPES = ('str', 'bool', 'int', 'index-int', 'positive-int', 'positive-int-as-str', 'pointer-index',
                 'float', 'positive-float', 'range-float', 'enum', 'enum-int')

SF_TAG_ITEM_TYPES = ('str', 'bool', 'int', 'positive-int', 'positive-int-as-str',
                     'float', 'positive-float', 'range-float', 'enum', 'enum-int')

# readable item type
READABLE_ITEM_TYPE = {'str': 'a string',
                      'bool': 'a boolean value',
                      'int': 'an integer',
                      'index-int': 'an unique positive integer',
                      'positive-int': 'a positive integer',
                      'positive-int-as-str': 'a positive integer',
                      'pointer-index': 'an integer acting as a pointer to the parent item',
                      'float': 'a floating point number',
                      'positive-float': 'a positive floating point number',
                      'range-float': 'a floating point number in a specific range',
                      'enum': 'an enumeration value',
                      'enum-int': 'an enumeration value restricted to integers'
                      }

# content type
CONTENT_TYPE = {'nef': 'nmr-data-nef',
                'nmr-star': 'nmr-data-str',
                'pdbx': 'model'
                }

# saveframe categories
SF_CATEGORIES = {'nef': {'entry_info': 'nef_nmr_meta_data',
                         'poly_seq': 'nef_molecular_system',
                         'entity': None,
                         'chem_shift': 'nef_chemical_shift_list',
                         'chem_shift_ref': None,
                         'dist_restraint': 'nef_distance_restraint_list',
                         'dihed_restraint': 'nef_dihedral_restraint_list',
                         'rdc_restraint': 'nef_rdc_restraint_list',
                         'spectral_peak': 'nef_nmr_spectrum',
                         'spectral_peak_alt': None,
                         'noepk_restraint': None,
                         'jcoup_restraint': None,
                         'rdc_raw_data': None,
                         'csa_restraint': None,
                         'ddc_restraint': None,
                         'hvycs_restraint': None,
                         'procs_restraint': None,
                         'csp_restraint': None,
                         'auto_relax_restraint': None,
                         'heteronucl_noe_data': None,
                         'heteronucl_t1_data': None,
                         'heteronucl_t2_data': None,
                         'heteronucl_t1r_data': None,
                         'order_param_data': None,
                         'ph_titr_data': None,
                         'ph_param_data': None,
                         'coupling_const_data': None,
                         'ccr_d_csa_restraint': None,
                         'ccr_dd_restraint': None,
                         'fchiral_restraint': None,
                         'saxs_restraint': None,
                         'other_restraint': None
                         },
                 'nmr-star': {'entry_info': 'entry_information',
                              'poly_seq': 'assembly',
                              'entity': 'entity',
                              'chem_shift': 'assigned_chemical_shifts',
                              'chem_shift_ref': 'chem_shift_reference',
                              'dist_restraint': 'general_distance_constraints',
                              'dihed_restraint': 'torsion_angle_constraints',
                              'rdc_restraint': 'RDC_constraints',
                              'spectral_peak': 'spectral_peak_list',
                              'spectral_peak_alt': 'spectral_peak_list',
                              'noepk_restraint': 'homonucl_NOEs',
                              'jcoup_restraint': 'J_three_bond_constraints',
                              'rdc_raw_data': 'RDCs',
                              'csa_restraint': 'chem_shift_anisotropy',
                              'ddc_restraint': 'dipolar_couplings',
                              'hvycs_restraint': 'CA_CB_chem_shift_constraints',
                              'procs_restraint': 'H_chem_shift_constraints',
                              'csp_restraint': 'chem_shift_perturbation',
                              'auto_relax_restraint': 'auto_relaxation',
                              'heteronucl_noe_data': 'heteronucl_NOEs',
                              'heteronucl_t1_data': 'heteronucl_T1_relaxation',
                              'heteronucl_t2_data': 'heteronucl_T2_relaxation',
                              'heteronucl_t1r_data': 'heteronucl_T1rho_relaxation',
                              'order_param_data': 'order_parameters',
                              'ph_titr_data': 'pH_titration',
                              'ph_param_data': 'pH_param_list',
                              'coupling_const_data': 'coupling_constants',
                              'ccr_d_csa_restraint': 'dipole_CSA_cross_correlations',
                              'ccr_dd_restraint': 'dipole_dipole_cross_correlations',
                              'fchiral_restraint': 'floating_chiral_stereo_assign',
                              'saxs_restraint': 'saxs_constraints',
                              'other_restraint': 'other_data_types'
                              }
                 }

# loop categories
LP_CATEGORIES = {'nef': {'entry_info': '_nef_program_script',
                         'poly_seq': '_nef_sequence',
                         'entity': None,
                         'chem_shift': '_nef_chemical_shift',
                         'chem_shift_ref': None,
                         'dist_restraint': '_nef_distance_restraint',
                         'dihed_restraint': '_nef_dihedral_restraint',
                         'rdc_restraint': '_nef_rdc_restraint',
                         'spectral_peak': '_nef_peak',
                         'spectral_peak_alt': None,
                         'noepk_restraint': None,
                         'jcoup_restraint': None,
                         'rdc_raw_data': None,
                         'csa_restraint': None,
                         'ddc_restraint': None,
                         'hvycs_restraint': None,
                         'procs_restraint': None,
                         'csp_restraint': None,
                         'auto_relax_restraint': None,
                         'heteronucl_noe_data': None,
                         'heteronucl_t1_data': None,
                         'heteronucl_t2_data': None,
                         'heteronucl_t1r_data': None,
                         'order_param_data': None,
                         'ph_titr_data': None,
                         'ph_param_data': None,
                         'coupling_const_data': None,
                         'ccr_d_csa_restraint': None,
                         'ccr_dd_restraint': None,
                         'fchiral_restraint': None,
                         'saxs_restraint': None,
                         'other_restraint': None
                         },
                 'nmr-star': {'entry_info': '_Software_applied_methods',
                              'poly_seq': '_Chem_comp_assembly',
                              'entity': '_Entity_comp_index',
                              'chem_shift': '_Atom_chem_shift',
                              'chem_shift_ref': '_Chem_shift_ref',
                              'dist_restraint': '_Gen_dist_constraint',
                              'dihed_restraint': '_Torsion_angle_constraint',
                              'rdc_restraint': '_RDC_constraint',
                              'spectral_peak': '_Peak_row_format',
                              'spectral_peak_alt': '_Peak',
                              'noepk_restraint': '_Homonucl_NOE',
                              'jcoup_restraint': '_J_three_bond_constraint',
                              'rdc_raw_data': '_RDC',
                              'csa_restraint': '_CS_anisotropy',
                              'ddc_restraint': '_Dipolar_coupling',
                              'hvycs_restraint': '_CA_CB_constraint',
                              'procs_restraint': '_H_chem_shift_constraint',
                              'csp_restraint': '_Chem_shift_perturbation',
                              'auto_relax_restraint': '_Auto_relaxation',
                              'heteronucl_noe_data': '_Heteronucl_NOE',
                              'heteronucl_t1_data': '_T1',
                              'heteronucl_t2_data': '_T2',
                              'heteronucl_t1r_data': '_T1rho',
                              'order_param_data': '_Order_param',
                              'ph_titr_data': '_PH_titr_result',
                              'ph_param_data': '_PH_param',
                              'coupling_const_data': '_Coupling_constant',
                              'ccr_d_csa_restraint': '_Cross_correlation_D_CSA',
                              'ccr_dd_restraint': '_Cross_correlation_DD',
                              'fchiral_restraint': '_Floating_chirality',
                              'saxs_restraint': '_SAXS_constraint',
                              'other_restraint': '_Other_data'
                              },
                 'pdbx': {'poly_seq': 'pdbx_poly_seq_scheme',
                          'non_poly': 'pdbx_nonpoly_scheme',
                          'branched': 'pdbx_branch_scheme',
                          'coordinate': 'atom_site',
                          'poly_seq_alias': 'ndb_poly_seq_scheme',
                          'non_poly_alias': 'ndb_nonpoly_scheme'
                          }
                 }

# cutoff value for detection of aromatic atoms
CUTOFF_AROMATIC = 5.0
# cutoff value for detection of paramagnetic/ferromagnetic atoms
CUTOFF_PARAMAGNETIC = 10.0

# criterion for aromatic ring in the vicinity
VICINITY_AROMATIC = 4.0
# criterion for paramagnetic/ferromagnetic atom in the vicinity
VICINITY_PARAMAGNETIC = 8.0

# criterion for detection of not superimposed models
RMSD_NOT_SUPERIMPOSED = 2.0
# criterion for detection of exactly overlaid models
RMSD_OVERLAID_EXACTLY = 0.01
# criterion for detection for domain recognition in RMSD value
RMSD_CUTOFF_FOR_DOMAIN = 3.5

# criterion for covalent bond length
CUTOFF_BOND_LENGTH = 3.5

# magic angle in degrees
MAGIC_ANGLE = 54.7356

# criterion for inconsistent restraint condition scaled by the conflicted restraint condition
INCONSIST_OVER_CONFLICTED = 0.75
# criterion on R factor for conflicted distance restraint
R_CONFLICTED_DIST_RESTRAINT = 0.4
# criterion on R factor for inconsistent distance restraint
R_INCONSISTENT_DIST_RESTRAINT = R_CONFLICTED_DIST_RESTRAINT * INCONSIST_OVER_CONFLICTED

# criterion on chemical shift for anomalous value scaled by its sigma
CS_ANOMALOUS_ERROR_SCALED_BY_SIGMA = 8.0
# criterion on chemical shift for unusual value scaled by its sigma
CS_UNUSUAL_ERROR_SCALED_BY_SIGMA = 5.0
# criterion on chemical shift difference error scaled by its sigma
CS_DIFF_ERROR_SCALED_BY_SIGMA = 10.0

# hardware limit of NMR prove design in Hz (DAOTHER-7389, issue #1)
HARD_PROBE_LIMIT = 250000

# maximum number of lines as spacer for recognition of MR files
MR_MAX_SPACER_LINES = 20

# loop index tags
INDEX_TAGS = {'nef': {'entry_info': None,
                      'poly_seq': 'index',
                      'entity': None,
                      'chem_shift': None,
                      'chem_shift_ref': None,
                      'dist_restraint': 'index',
                      'dihed_restraint': 'index',
                      'rdc_restraint': 'index',
                      'spectral_peak': 'index',
                      'spectral_peak_alt': None,
                      'noepk_restraint': None,
                      'jcoup_restraint': None,
                      'rdc_raw_data': None,
                      'csa_restraint': None,
                      'ddc_restraint': None,
                      'hvycs_restraint': None,
                      'procs_restraint': None,
                      'csp_restraint': None,
                      'auto_relax_restraint': None,
                      'heteronucl_noe_data': None,
                      'heteronucl_t1_data': None,
                      'heteronucl_t2_data': None,
                      'heteronucl_t1r_data': None,
                      'order_param_data': None,
                      'ph_titr_data': None,
                      'ph_param_data': None,
                      'coupling_const_data': None,
                      'ccr_d_csa_restraint': None,
                      'ccr_dd_restraint': None,
                      'fchiral_restraint': None,
                      'saxs_restraint': None,
                      'other_restraint': None
                      },
              'nmr-star': {'entry_info': None,
                           'poly_seq': None,
                           'entity': None,
                           'chem_shift': None,
                           'chem_shift_ref': None,
                           'dist_restraint': 'Index_ID',
                           'dihed_restraint': 'Index_ID',
                           'rdc_restraint': 'Index_ID',
                           'spectral_peak': 'Index_ID',
                           'spectral_peak_alt': None,
                           'noepk_restraint': None,
                           'jcoup_restraint': None,
                           'rdc_raw_data': None,
                           'csa_restraint': None,
                           'ddc_restraint': None,
                           'hvycs_restraint': None,
                           'procs_restraint': None,
                           'csp_restraint': None,
                           'auto_relax_restraint': None,
                           'heteronucl_noe_data': None,
                           'heteronucl_t1_data': None,
                           'heteronucl_t2_data': None,
                           'heteronucl_t1r_data': None,
                           'order_param_data': None,
                           'ph_titr_data': None,
                           'ph_param_data': None,
                           'coupling_const_data': None,
                           'ccr_d_csa_restraint': None,
                           'ccr_dd_restraint': None,
                           'fchiral_restraint': None,
                           'saxs_restraint': None,
                           'other_restraint': None
                           },
              'pdbx': {'poly_seq': None,
                       'non_poly': None,
                       'branched': None,
                       'coordinate': 'id'
                       }
              }

# weight tags
WEIGHT_TAGS = {'nef': {'entry_info': None,
                       'poly_seq': None,
                       'entity': None,
                       'chem_shift': None,
                       'chem_shift_ref': None,
                       'dist_restraint': 'weight',
                       'dihed_restraint': 'weight',
                       'rdc_restraint': 'weight',
                       'spectral_peak': None,
                       'spectral_peak_alt': None,
                       'noepk_restraint': None,
                       'jcoup_restraint': None,
                       'rdc_raw_data': None,
                       'csa_restraint': None,
                       'ddc_restraint': None,
                       'hvycs_restraint': None,
                       'procs_restraint': None,
                       'csp_restraint': None,
                       'auto_relax_restraint': None,
                       'heteronucl_noe_data': None,
                       'heteronucl_t1_data': None,
                       'heteronucl_t2_data': None,
                       'heteronucl_t1r_data': None,
                       'order_param_data': None,
                       'ph_titr_data': None,
                       'ph_param_data': None,
                       'coupling_const_data': None,
                       'ccr_d_csa_restraint': None,
                       'ccr_dd_restraint': None,
                       'fchiral_restraint': None,
                       'saxs_restraint': None,
                       'other_restraint': None
                       },
               'nmr-star': {'entry_info': None,
                            'poly_seq': None,
                            'entity': None,
                            'chem_shift': None,
                            'chem_shift_ref': None,
                            'dist_restraint': 'Weight',
                            'dihed_restraint': 'Weight',
                            'rdc_restraint': 'Weight',
                            'spectral_peak': None,
                            'spectral_peak_alt': None,
                            'noepk_restraint': None,
                            'jcoup_restraint': None,
                            'rdc_raw_data': None,
                            'csa_restraint': None,
                            'ddc_restraint': None,
                            'hvycs_restraint': None,
                            'procs_restraint': None,
                            'csp_restraint': None,
                            'auto_relax_restraint': None,
                            'heteronucl_noe_data': None,
                            'heteronucl_t1_data': None,
                            'heteronucl_t2_data': None,
                            'heteronucl_t1r_data': None,
                            'order_param_data': None,
                            'ph_titr_data': None,
                            'ph_param_data': None,
                            'coupling_const_data': None,
                            'ccr_d_csa_restraint': None,
                            'ccr_dd_restraint': None,
                            'fchiral_restraint': None,
                            'saxs_restraint': 'Weight_val',
                            'other_restraint': None
                            },
               'pdbx': {'poly_seq': None,
                        'non_poly': None,
                        'branched': None,
                        'coordinate': None
                        }
               }

# dihedral angle type tag
ANGLE_TYPE_TAGS = {'nef': 'name',
                   'nmr-star': 'Torsion_angle_name'
                   }

# loop id tag to check consistency
CONSIST_ID_TAGS = {'nef': {'dist_restraint': 'restraint_id',
                           'dihed_restraint': 'restraint_id',
                           'rdc_restraint': 'restraint_id',
                           'spectral_peak': 'peak_id',
                           'spectral_peak_alt': None,
                           'noepk_restraint': None,
                           'jcoup_restraint': None,
                           'rdc_raw_data': None,
                           'csa_restraint': None,
                           'ddc_restraint': None,
                           'hvycs_restraint': None,
                           'procs_restraint': None,
                           'csp_restraint': None,
                           'auto_relax_restraint': None,
                           'heteronucl_noe_data': None,
                           'heteronucl_t1_data': None,
                           'heteronucl_t2_data': None,
                           'heteronucl_t1r_data': None,
                           'order_param_data': None,
                           'ph_titr_data': None,
                           'ph_param_data': None,
                           'coupling_const_data': None,
                           'ccr_d_csa_restraint': None,
                           'ccr_dd_restraint': None,
                           'fchiral_restraint': None,
                           'saxs_restraint': None,
                           'other_restraint': None
                           },
                   'nmr-star': {'chem_shift': 'ID',
                                'dist_restraint': 'ID',
                                'dihed_restraint': 'ID',
                                'rdc_restraint': 'ID',
                                'spectral_peak': 'ID',
                                'spectral_peak_alt': 'ID',
                                'noepk_restraint': 'ID',
                                'jcoup_restraint': 'ID',
                                'rdc_raw_data': 'ID',
                                'csa_restraint': 'ID',
                                'ddc_restraint': 'ID',
                                'hvycs_restraint': 'ID',
                                'procs_restraint': 'ID',
                                'csp_restraint': 'ID',
                                'auto_relax_restraint': 'ID',
                                'heteronucl_noe_data': 'ID',
                                'heteronucl_t1_data': 'ID',
                                'heteronucl_t2_data': 'ID',
                                'heteronucl_t1r_data': 'ID',
                                'order_param_data': 'ID',
                                'ph_titr_data': 'ID',
                                'ph_param_data': 'ID',
                                'coupling_const_data': 'ID',
                                'ccr_d_csa_restraint': 'ID',
                                'ccr_dd_restraint': 'ID',
                                'fchiral_restraint': 'ID',
                                'saxs_restraint': 'ID',
                                'other_restraint': 'ID'
                                }
                   }

# key items of loop
KEY_ITEMS = {'nef': {'poly_seq': [{'name': 'chain_code', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                  {'name': 'sequence_code', 'type': 'int',
                                   'remove-bad-pattern': True},
                                  {'name': 'residue_name', 'type': 'str', 'uppercase': True,
                                   'remove-bad-pattern': True}
                                  ],
                     'entity': None,
                     'chem_shift': [{'name': 'chain_code', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                    {'name': 'sequence_code', 'type': 'int',
                                     'remove-bad-pattern': True},
                                    {'name': 'residue_name', 'type': 'str',
                                     'uppercase': True,
                                     'remove-bad-pattern': True},
                                    {'name': 'atom_name', 'type': 'str',
                                     'remove-bad-pattern': True}
                                    ],
                     'chem_shift_ref': None,
                     'dist_restraint': [{'name': 'restraint_id', 'type': 'positive-int'},
                                        {'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                        {'name': 'sequence_code_1', 'type': 'int',
                                         'remove-bad-pattern': True},
                                        {'name': 'residue_name_1', 'type': 'str', 'uppercase': True,
                                         'remove-bad-pattern': True},
                                        {'name': 'atom_name_1', 'type': 'str',
                                         'remove-bad-pattern': True},
                                        {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                        {'name': 'sequence_code_2', 'type': 'int',
                                         'remove-bad-pattern': True},
                                        {'name': 'residue_name_2', 'type': 'str', 'uppercase': True,
                                         'remove-bad-pattern': True},
                                        {'name': 'atom_name_2', 'type': 'str',
                                         'remove-bad-pattern': True}
                                        ],
                     'dihed_restraint': [{'name': 'restraint_id', 'type': 'positive-int'},
                                         {'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'sequence_code_1', 'type': 'int',
                                          'remove-bad-pattern': True},
                                         {'name': 'residue_name_1', 'type': 'str', 'uppercase': True,
                                          'remove-bad-pattern': True},
                                         {'name': 'atom_name_1', 'type': 'str',
                                          'remove-bad-pattern': True},
                                         {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'sequence_code_2', 'type': 'int',
                                          'remove-bad-pattern': True},
                                         {'name': 'residue_name_2', 'type': 'str', 'uppercase': True,
                                          'remove-bad-pattern': True},
                                         {'name': 'atom_name_2', 'type': 'str',
                                          'remove-bad-pattern': True},
                                         {'name': 'chain_code_3', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'sequence_code_3', 'type': 'int',
                                          'remove-bad-pattern': True},
                                         {'name': 'residue_name_3', 'type': 'str', 'uppercase': True,
                                          'remove-bad-pattern': True},
                                         {'name': 'atom_name_3', 'type': 'str',
                                          'remove-bad-pattern': True},
                                         {'name': 'chain_code_4', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'sequence_code_4', 'type': 'int',
                                          'remove-bad-pattern': True},
                                         {'name': 'residue_name_4', 'type': 'str', 'uppercase': True,
                                          'remove-bad-pattern': True},
                                         {'name': 'atom_name_4', 'type': 'str',
                                          'remove-bad-pattern': True}
                                         ],
                     'rdc_restraint': [{'name': 'restraint_id', 'type': 'positive-int'},
                                       {'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                       {'name': 'sequence_code_1', 'type': 'int',
                                        'remove-bad-pattern': True},
                                       {'name': 'residue_name_1', 'type': 'str', 'uppercase': True,
                                        'remove-bad-pattern': True},
                                       {'name': 'atom_name_1', 'type': 'str',
                                        'remove-bad-pattern': True},
                                       {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                       {'name': 'sequence_code_2', 'type': 'int',
                                        'remove-bad-pattern': True},
                                       {'name': 'residue_name_2', 'type': 'str', 'uppercase': True,
                                        'remove-bad-pattern': True},
                                       {'name': 'atom_name_2', 'type': 'str',
                                        'remove-bad-pattern': True}
                                       ],
                     'spectral_peak': None,
                     'spectral_peak_alt': None,
                     'noepk_restraint': None,
                     'jcoup_restraint': None,
                     'rdc_raw_data': None,
                     'csa_restraint': None,
                     'ddc_restraint': None,
                     'hvycs_restraint': None,
                     'procs_restraint': None,
                     'csp_restraint': None,
                     'auto_relax_restraint': None,
                     'heteronucl_noe_data': None,
                     'heteronucl_t1_data': None,
                     'heteronucl_t2_data': None,
                     'heteronucl_t1r_data': None,
                     'order_param_data': None,
                     'ph_titr_data': None,
                     'ph_param_data': None,
                     'coupling_const_data': None,
                     'ccr_d_csa_restraint': None,
                     'ccr_dd_restraint': None,
                     'fchiral_restraint': None,
                     'saxs_restraint': None,
                     'other_restraint': None
                     },
             'nmr-star': {'poly_seq': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                        'default': '1', 'default-from': 'Auth_asym_ID'},
                                       {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                       {'name': 'Comp_ID', 'type': 'str', 'uppercase': True}
                                       ],
                          'entity': None,
                          'chem_shift': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                          'default': '1', 'default-from': 'Auth_asym_ID'},
                                         {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID',
                                          'remove-bad-pattern': True},
                                         {'name': 'Comp_ID', 'type': 'str',
                                          'uppercase': True,
                                          'remove-bad-pattern': True},
                                         {'name': 'Atom_ID', 'type': 'str',
                                          'remove-bad-pattern': True},
                                         {'name': 'Occupancy', 'type': 'positive-float', 'default': '.'}
                                         ],
                          'chem_shift_ref': [{'name': 'Atom_type', 'type': 'enum',
                                              'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                              'enforce-enum': True},
                                             {'name': 'Atom_isotope_number', 'type': 'enum-int',
                                              'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                              'enforce-enum': True},
                                             {'name': 'Mol_common_name', 'type': 'str'}],
                          'dist_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                             {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                             {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_1', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                             {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                             {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_2', 'type': 'str'}
                                             ],
                          'dihed_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                              {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                              {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_1', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                              {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                              {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_2', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                              {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                              {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_3', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                              {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                              {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_4', 'type': 'str'}
                                              ],
                          'rdc_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                            {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                             'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                            {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                            {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_1', 'type': 'str'},
                                            {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                             'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                            {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                            {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_2', 'type': 'str'}
                                            ],
                          'spectral_peak': None,
                          'spectral_peak_alt': [{'name': 'ID', 'type': 'int', 'auto-increment': True},
                                                # allows to have software-native id starting from zero
                                                {'name': 'Spectral_peak_list_ID', 'type': 'positive-int',
                                                 'default': '1', 'default-from': 'self'}
                                                ],
                          'noepk_restraint': [{'name': 'ID', 'type': 'int', 'auto-increment': True},
                                              # allows to have software-native id starting from zero
                                              {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                              {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                              {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_1', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                              {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                              {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_2', 'type': 'str'}
                                              ],
                          'jcoup_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                              {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                              {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_1', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                              {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                              {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_2', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                              {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                              {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_3', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                              {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                              {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_4', 'type': 'str'}
                                              ],
                          'rdc_raw_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                           {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                           {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID_1', 'type': 'str'},
                                           {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                           {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID_2', 'type': 'str'}
                                           ],
                          'csa_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                            {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                            {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                            {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID', 'type': 'str'}
                                            ],
                          'ddc_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                            {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                            {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                            {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_1', 'type': 'str'},
                                            {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                            {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                            {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_2', 'type': 'str'}
                                            ],
                          'hvycs_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                              {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                              {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_1', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                              {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                              {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_2', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                              {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                              {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_3', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                              {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                              {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_4', 'type': 'str'},
                                              {'name': 'Entity_assembly_ID_5', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID_5'},
                                              {'name': 'Comp_index_ID_5', 'type': 'int', 'default-from': 'Seq_ID_5'},
                                              {'name': 'Comp_ID_5', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID_5', 'type': 'str'}
                                              ],
                          'procs_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                               'default': '1', 'default-from': 'Auth_asym_ID'},
                                              {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                              {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID', 'type': 'str'}
                                              ],
                          'csp_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                            {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                            {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                            {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID', 'type': 'str'}
                                            ],
                          'auto_relax_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                   {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                   {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                   {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                   {'name': 'Atom_ID', 'type': 'str'}
                                                   ],
                          'heteronucl_noe_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                  {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                                  {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                  {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Atom_ID_1', 'type': 'str'},
                                                  {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                                  {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                  {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Atom_ID_2', 'type': 'str'},
                                                  ],
                          'heteronucl_t1_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                 {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                 {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                 {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID', 'type': 'str'}
                                                 ],
                          'heteronucl_t2_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                 {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                 {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                 {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID', 'type': 'str'}
                                                 ],
                          'heteronucl_t1r_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                  {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                  {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                  {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Atom_ID', 'type': 'str'}
                                                  ],
                          'order_param_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                               {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                               {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                               {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                               {'name': 'Atom_ID', 'type': 'str'}
                                               ],
                          'ph_titr_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                           {'name': 'Atm_obs_entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Atm_obs_comp_index_ID', 'type': 'int', 'default-from': 'Atm_obs_seq_ID'},
                                           {'name': 'Atm_obs_comp_ID', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atm_obs_atom_ID', 'type': 'str'},
                                           {'name': 'Atm_titr_entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Atm_titr_comp_index_ID', 'type': 'int', 'default-from': 'Atm_titr_seq_ID'},
                                           {'name': 'Atm_titr_comp_ID', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atm_titr_atom_ID', 'type': 'str'}
                                           ],
                          'ph_param_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True}
                                            ],
                          'coupling_const_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                  {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                                  {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                  {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Atom_ID_1', 'type': 'str'},
                                                  {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                                  {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                  {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Atom_ID_2', 'type': 'str'}
                                                  ],
                          'ccr_d_csa_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                  {'name': 'Dipole_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                   'default': '1'},
                                                  {'name': 'Dipole_comp_index_ID_1', 'type': 'int',
                                                   'default-from': 'Dipole_seq_ID_1'},
                                                  {'name': 'Dipole_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Dipole_atom_ID_1', 'type': 'str'},
                                                  {'name': 'Dipole_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                   'default': '1'},
                                                  {'name': 'Dipole_comp_index_ID_2', 'type': 'int',
                                                   'default-from': 'Dipole_seq_ID_2'},
                                                  {'name': 'Dipole_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Dipole_atom_ID_2', 'type': 'str'},
                                                  {'name': 'CSA_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                   'default': '1'},
                                                  {'name': 'CSA_comp_index_ID_1', 'type': 'int',
                                                   'default-from': 'CSA_seq_ID_1'},
                                                  {'name': 'CSA_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                  {'name': 'CSA_atom_ID_1', 'type': 'str'},
                                                  {'name': 'CSA_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                   'default': '1'},
                                                  {'name': 'CSA_comp_index_ID_2', 'type': 'int',
                                                   'default-from': 'CSA_seq_ID_2'},
                                                  {'name': 'CSA_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                  {'name': 'CSA_atom_ID_2', 'type': 'str'}
                                                  ],
                          'ccr_dd_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                               {'name': 'Dipole_1_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                'default': '1'},
                                               {'name': 'Dipole_1_comp_index_ID_1', 'type': 'int',
                                                'default-from': 'Dipole_1_seq_ID_1'},
                                               {'name': 'Dipole_1_comp_ID_1', 'type': 'str', 'uppercase': True},
                                               {'name': 'Dipole_1_atom_ID_1', 'type': 'str'},
                                               {'name': 'Dipole_1_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                'default': '1'},
                                               {'name': 'Dipole_1_comp_index_ID_2', 'type': 'int',
                                                'default-from': 'Dipole_1_seq_ID_2'},
                                               {'name': 'Dipole_1_comp_ID_2', 'type': 'str', 'uppercase': True},
                                               {'name': 'Dipole_1_atom_ID_2', 'type': 'str'},
                                               {'name': 'Dipole_2_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                'default': '1'},
                                               {'name': 'Dipole_2_comp_index_ID_1', 'type': 'int',
                                                'default-from': 'Dipole_2_seq_ID_1'},
                                               {'name': 'Dipole_2_comp_ID_1', 'type': 'str', 'uppercase': True},
                                               {'name': 'Dipole_2_atom_ID_1', 'type': 'str'},
                                               {'name': 'Dipole_2_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                'default': '1'},
                                               {'name': 'Dipole_2_comp_index_ID_2', 'type': 'int',
                                                'default-from': 'Dipole_2_seq_ID_2'},
                                               {'name': 'Dipole_2_comp_ID_2', 'type': 'str', 'uppercase': True},
                                               {'name': 'Dipole_2_atom_ID_2', 'type': 'str'}
                                               ],
                          'fchiral_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                 'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                {'name': 'Atom_ID_1', 'type': 'str'},
                                                {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                 'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                {'name': 'Atom_ID_2', 'type': 'str'}
                                                ],
                          'saxs_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Q_value', 'type': 'positive-float'}
                                             ],
                          'other_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                              {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                              {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID', 'type': 'str'}
                                              ]
                          },
             'pdbx': {'poly_seq': [{'name': 'asym_id', 'type': 'str', 'alt_name': 'chain_id',
                                    'default': REPRESENTATIVE_ASYM_ID},
                                   {'name': 'seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                                   {'name': 'mon_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                                   {'name': 'pdb_strand_id', 'type': 'str', 'alt_name': 'auth_chain_id',
                                    'default': REPRESENTATIVE_ASYM_ID},
                                   {'name': 'pdb_seq_num', 'type': 'int', 'alt_name': 'auth_seq_id'}
                                   ],
                      'poly_seq_alias': [{'name': 'id', 'type': 'str', 'alt_name': 'chain_id',
                                          'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                                         {'name': 'mon_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                                         {'name': 'pdb_id', 'type': 'str', 'alt_name': 'auth_chain_id',
                                          'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'pdb_num', 'type': 'int', 'alt_name': 'auth_seq_id'}
                                         ],
                      'non_poly': [{'name': 'asym_id', 'type': 'str', 'alt_name': 'chain_id',
                                    'default': REPRESENTATIVE_ASYM_ID},
                                   {'name': 'pdb_seq_num', 'type': 'int', 'alt_name': 'seq_id'},
                                   {'name': 'mon_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                                   {'name': 'pdb_strand_id', 'type': 'str', 'alt_name': 'auth_chain_id',
                                    'default': REPRESENTATIVE_ASYM_ID}
                                   ],
                      'non_poly_alias': [{'name': 'asym_id', 'type': 'str', 'alt_name': 'chain_id',
                                          'default': REPRESENTATIVE_ASYM_ID},
                                         {'name': 'pdb_num', 'type': 'int', 'alt_name': 'seq_id'},
                                         {'name': 'mon_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                                         {'name': 'pdb_id', 'type': 'str', 'alt_name': 'auth_chain_id',
                                          'default': REPRESENTATIVE_ASYM_ID}
                                         ],
                      'branched': [{'name': 'asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                                   {'name': 'pdb_seq_num', 'type': 'int', 'alt_name': 'seq_id'},
                                   {'name': 'mon_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                                   {'name': 'pdb_asym_id', 'type': 'str', 'alt_name': 'auth_chain_id'}
                                   ],
                      'coordinate': [{'name': 'label_asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                                     {'name': 'auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                                     {'name': 'auth_comp_id', 'type': 'str', 'alt_name': 'comp_id'},
                                     {'name': 'pdbx_PDB_model_num', 'type': 'int', 'alt_name': 'model_id'}
                                     ],
                      'coordinate_alias': [{'name': 'label_asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                                           {'name': 'auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                                           {'name': 'auth_comp_id', 'type': 'str', 'alt_name': 'comp_id'},
                                           {'name': 'ndb_model', 'type': 'int', 'alt_name': 'model_id'}
                                           ],
                      'coordinate_ins': [{'name': 'label_asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                                         {'name': 'auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                                         {'name': 'auth_comp_id', 'type': 'str', 'alt_name': 'comp_id'},
                                         {'name': 'pdbx_PDB_ins_code', 'type': 'str', 'alt_name': 'ins_code', 'default': '?'},
                                         {'name': 'label_seq_id', 'type': 'str', 'default': '.'},
                                         {'name': 'pdbx_PDB_model_num', 'type': 'int', 'alt_name': 'model_id'}
                                         ],
                      'coordinate_ins_alias': [{'name': 'label_asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                                               {'name': 'auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                                               {'name': 'auth_comp_id', 'type': 'str', 'alt_name': 'comp_id'},
                                               {'name': 'ndb_ins_code', 'type': 'str', 'alt_name': 'ins_code', 'default': '?'},
                                               {'name': 'label_seq_id', 'type': 'str', 'default': '.'},
                                               {'name': 'ndb_model', 'type': 'int', 'alt_name': 'model_id'}
                                               ]
                      }
             }

# key items of loop to check consistency
CONSIST_KEY_ITEMS = {'nef': {'dist_restraint': [{'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                {'name': 'sequence_code_1', 'type': 'int'},
                                                {'name': 'residue_name_1', 'type': 'str', 'uppercase': True},
                                                {'name': 'atom_name_1', 'type': 'str'},
                                                {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                {'name': 'sequence_code_2', 'type': 'int'},
                                                {'name': 'residue_name_2', 'type': 'str', 'uppercase': True},
                                                {'name': 'atom_name_2', 'type': 'str'}
                                                ],
                             'dihed_restraint': [{'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                 {'name': 'sequence_code_1', 'type': 'int'},
                                                 {'name': 'residue_name_1', 'type': 'str', 'uppercase': True},
                                                 {'name': 'atom_name_1', 'type': 'str'},
                                                 {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                 {'name': 'sequence_code_2', 'type': 'int'},
                                                 {'name': 'residue_name_2', 'type': 'str', 'uppercase': True},
                                                 {'name': 'atom_name_2', 'type': 'str'},
                                                 {'name': 'chain_code_3', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                 {'name': 'sequence_code_3', 'type': 'int'},
                                                 {'name': 'residue_name_3', 'type': 'str', 'uppercase': True},
                                                 {'name': 'atom_name_3', 'type': 'str'},
                                                 {'name': 'chain_code_4', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                 {'name': 'sequence_code_4', 'type': 'int'},
                                                 {'name': 'residue_name_4', 'type': 'str', 'uppercase': True},
                                                 {'name': 'atom_name_4', 'type': 'str'}
                                                 ],
                             'rdc_restraint': [{'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                               {'name': 'sequence_code_1', 'type': 'int'},
                                               {'name': 'residue_name_1', 'type': 'str', 'uppercase': True},
                                               {'name': 'atom_name_1', 'type': 'str'},
                                               {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                               {'name': 'sequence_code_2', 'type': 'int'},
                                               {'name': 'residue_name_2', 'type': 'str', 'uppercase': True},
                                               {'name': 'atom_name_2', 'type': 'str'}
                                               ],
                             'spectral_peak': None,
                             'spectral_peak_alt': None,
                             'noepk_restraint': None,
                             'jcoup_restraint': None,
                             'rdc_raw_data': None,
                             'csa_restraint': None,
                             'ddc_restraint': None,
                             'hvycs_restraint': None,
                             'procs_restraint': None,
                             'csp_restraint': None,
                             'auto_relax_restraint': None,
                             'heteronucl_noe_data': None,
                             'heteronucl_t1_data': None,
                             'heteronucl_t2_data': None,
                             'heteronucl_t1r_data': None,
                             'order_param_data': None,
                             'ph_titr_data': None,
                             'ph_param_data': None,
                             'coupling_const_data': None,
                             'ccr_d_csa_restraint': None,
                             'ccr_dd_restraint': None,
                             'fchiral_restraint': None,
                             'saxs_restraint': None,
                             'other_restraint': None
                             },
                     'nmr-star': {'dist_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                      'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                     {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                     {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                     {'name': 'Atom_ID_1', 'type': 'str'},
                                                     {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                      'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                     {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                     {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                     {'name': 'Atom_ID_2', 'type': 'str'}
                                                     ],
                                  'dihed_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                      {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                      {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_1', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                      {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                      {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_2', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                                      {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                                      {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_3', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                                      {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                                      {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_4', 'type': 'str'}
                                                      ],
                                  'rdc_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                     'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                    {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                    {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                    {'name': 'Atom_ID_1', 'type': 'str'},
                                                    {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                     'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                    {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                    {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                    {'name': 'Atom_ID_2', 'type': 'str'}
                                                    ],
                                  'spectral_peak': None,
                                  'spectral_peak_alt': None,
                                  'noepk_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                       'default': '1'},
                                                      {'name': 'Comp_index_ID_1', 'type': 'int',
                                                       'default-from': 'Seq_ID_1'},
                                                      {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_1', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                       'default': '1'},
                                                      {'name': 'Comp_index_ID_2', 'type': 'int',
                                                       'default-from': 'Seq_ID_2'},
                                                      {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_2', 'type': 'str'}
                                                      ],
                                  'jcoup_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                      {'name': 'Comp_index_ID_1', 'type': 'int',
                                                       'default-from': 'Seq_ID_1'},
                                                      {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_1', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                      {'name': 'Comp_index_ID_2', 'type': 'int',
                                                       'default-from': 'Seq_ID_2'},
                                                      {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_2', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                                      {'name': 'Comp_index_ID_3', 'type': 'int',
                                                       'default-from': 'Seq_ID_3'},
                                                      {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_3', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                                      {'name': 'Comp_index_ID_4', 'type': 'int',
                                                       'default-from': 'Seq_ID_4'},
                                                      {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_4', 'type': 'str'}
                                                      ],
                                  'rdc_raw_data': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                    'default': '1'},
                                                   {'name': 'Comp_index_ID_1', 'type': 'int',
                                                    'default-from': 'Seq_ID_1'},
                                                   {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                   {'name': 'Atom_ID_1', 'type': 'str'},
                                                   {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                    'default': '1'},
                                                   {'name': 'Comp_index_ID_2', 'type': 'int',
                                                    'default-from': 'Seq_ID_2'},
                                                   {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                   {'name': 'Atom_ID_2', 'type': 'str'}
                                                   ],
                                  'csa_restraint': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                     'default': '1'},
                                                    {'name': 'Comp_index_ID', 'type': 'int',
                                                     'default-from': 'Seq_ID'},
                                                    {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                    {'name': 'Atom_ID', 'type': 'str'}
                                                    ],
                                  'ddc_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                     'default': '1'},
                                                    {'name': 'Comp_index_ID_1', 'type': 'int',
                                                     'default-from': 'Seq_ID_1'},
                                                    {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                    {'name': 'Atom_ID_1', 'type': 'str'},
                                                    {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                     'default': '1'},
                                                    {'name': 'Comp_index_ID_2', 'type': 'int',
                                                     'default-from': 'Seq_ID_2'},
                                                    {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                    {'name': 'Atom_ID_2', 'type': 'str'}
                                                    ],
                                  'hvycs_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                      {'name': 'Comp_index_ID_1', 'type': 'int',
                                                       'default-from': 'Seq_ID_1'},
                                                      {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_1', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                      {'name': 'Comp_index_ID_2', 'type': 'int',
                                                       'default-from': 'Seq_ID_2'},
                                                      {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_2', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                                      {'name': 'Comp_index_ID_3', 'type': 'int',
                                                       'default-from': 'Seq_ID_3'},
                                                      {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_3', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                                      {'name': 'Comp_index_ID_4', 'type': 'int',
                                                       'default-from': 'Seq_ID_4'},
                                                      {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_4', 'type': 'str'},
                                                      {'name': 'Entity_assembly_ID_5', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID_5'},
                                                      {'name': 'Comp_index_ID_5', 'type': 'int',
                                                       'default-from': 'Seq_ID_5'},
                                                      {'name': 'Comp_ID_5', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID_5', 'type': 'str'}
                                                      ],
                                  'procs_restraint': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                       'default': '1', 'default-from': 'Auth_asym_ID'},
                                                      {'name': 'Comp_index_ID', 'type': 'int',
                                                       'default-from': 'Seq_ID'},
                                                      {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID', 'type': 'str'}
                                                      ],
                                  'csp_restraint': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                     'default': '1'},
                                                    {'name': 'Comp_index_ID', 'type': 'int',
                                                     'default-from': 'Seq_ID'},
                                                    {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                    {'name': 'Atom_ID', 'type': 'str'}
                                                    ],
                                  'auto_relax_restraint': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                            'default': '1'},
                                                           {'name': 'Comp_index_ID', 'type': 'int',
                                                            'default-from': 'Seq_ID'},
                                                           {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                           {'name': 'Atom_ID', 'type': 'str'}
                                                           ],
                                  'heteronucl_noe_data': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Comp_index_ID_1', 'type': 'int',
                                                           'default-from': 'Seq_ID_1'},
                                                          {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Atom_ID_1', 'type': 'str'},
                                                          {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Comp_index_ID_2', 'type': 'int',
                                                           'default-from': 'Seq_ID_2'},
                                                          {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Atom_ID_2', 'type': 'str'}
                                                          ],
                                  'heteronucl_t1_data': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                          'default': '1'},
                                                         {'name': 'Comp_index_ID', 'type': 'int',
                                                          'default-from': 'Seq_ID'},
                                                         {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                         {'name': 'Atom_ID', 'type': 'str'}
                                                         ],
                                  'heteronucl_t2_data': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                          'default': '1'},
                                                         {'name': 'Comp_index_ID', 'type': 'int',
                                                          'default-from': 'Seq_ID'},
                                                         {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                         {'name': 'Atom_ID', 'type': 'str'}
                                                         ],
                                  'heteronucl_t1r_data': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Comp_index_ID', 'type': 'int',
                                                           'default-from': 'Seq_ID'},
                                                          {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Atom_ID', 'type': 'str'}
                                                          ],
                                  'order_param_data': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                        'default': '1'},
                                                       {'name': 'Comp_index_ID', 'type': 'int',
                                                        'default-from': 'Seq_ID'},
                                                       {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                       {'name': 'Atom_ID', 'type': 'str'}
                                                       ],
                                  'ph_titr_data': [{'name': 'Atm_obs_entity_assembly_ID', 'type': 'positive-int-as-str',
                                                    'default': '1'},
                                                   {'name': 'Atm_obs_comp_index_ID', 'type': 'int',
                                                    'default-from': 'Atm_obs_seq_ID'},
                                                   {'name': 'Atm_obs_comp_ID', 'type': 'str', 'uppercase': True},
                                                   {'name': 'Atm_obs_atom_ID', 'type': 'str'},
                                                   {'name': 'Atm_titr_entity_assembly_ID', 'type': 'positive-int-as-str',
                                                    'default': '1'},
                                                   {'name': 'Atm_titr_comp_index_ID', 'type': 'int',
                                                    'default-from': 'Atm_titr_seq_ID'},
                                                   {'name': 'Atm_titr_comp_ID', 'type': 'str', 'uppercase': True},
                                                   {'name': 'Atm_titr_atom_ID', 'type': 'str'}
                                                   ],
                                  'ph_param_data': None,
                                  'coupling_const_data': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Comp_index_ID_1', 'type': 'int',
                                                           'default-from': 'Seq_ID_1'},
                                                          {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Atom_ID_1', 'type': 'str'},
                                                          {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Comp_index_ID_2', 'type': 'int',
                                                           'default-from': 'Seq_ID_2'},
                                                          {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Atom_ID_2', 'type': 'str'}
                                                          ],
                                  'ccr_d_csa_restraint': [{'name': 'Dipole_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Dipole_comp_index_ID_1', 'type': 'int',
                                                           'default-from': 'Dipole_seq_ID_1'},
                                                          {'name': 'Dipole_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Dipole_atom_ID_1', 'type': 'str'},
                                                          {'name': 'Dipole_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'Dipole_comp_index_ID_2', 'type': 'int',
                                                           'default-from': 'Dipole_seq_ID_2'},
                                                          {'name': 'Dipole_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                          {'name': 'Dipole_atom_ID_2', 'type': 'str'},
                                                          {'name': 'CSA_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'CSA_comp_index_ID_1', 'type': 'int',
                                                           'default-from': 'CSA_seq_ID_1'},
                                                          {'name': 'CSA_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                          {'name': 'CSA_atom_ID_1', 'type': 'str'},
                                                          {'name': 'CSA_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                           'default': '1'},
                                                          {'name': 'CSA_comp_index_ID_2', 'type': 'int',
                                                           'default-from': 'CSA_seq_ID_2'},
                                                          {'name': 'CSA_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                          {'name': 'CSA_atom_ID_2', 'type': 'str'}
                                                          ],
                                  'ccr_dd_restraint': [{'name': 'Dipole_1_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                        'default': '1'},
                                                       {'name': 'Dipole_1_comp_index_ID_1', 'type': 'int',
                                                        'default-from': 'Dipole_1_seq_ID_1'},
                                                       {'name': 'Dipole_1_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                       {'name': 'Dipole_1_atom_ID_1', 'type': 'str'},
                                                       {'name': 'Dipole_1_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                        'default': '1'},
                                                       {'name': 'Dipole_1_comp_index_ID_2', 'type': 'int',
                                                        'default-from': 'Dipole_1_seq_ID_2'},
                                                       {'name': 'Dipole_1_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                       {'name': 'Dipole_1_atom_ID_2', 'type': 'str'},
                                                       {'name': 'Dipole_2_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                        'default': '1'},
                                                       {'name': 'Dipole_2_comp_index_ID_1', 'type': 'int',
                                                        'default-from': 'Dipole_2_seq_ID_1'},
                                                       {'name': 'Dipole_2_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                       {'name': 'Dipole_2_atom_ID_1', 'type': 'str'},
                                                       {'name': 'Dipole_2_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                        'default': '1'},
                                                       {'name': 'Dipole_2_comp_index_ID_2', 'type': 'int',
                                                        'default-from': 'Dipole_2_seq_ID_2'},
                                                       {'name': 'Dipole_2_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                       {'name': 'Dipole_2_atom_ID_2', 'type': 'str'}
                                                       ],
                                  'fchiral_restraint': [{'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                         'default': '1'},
                                                        {'name': 'Comp_index_ID_1', 'type': 'int',
                                                         'default-from': 'Seq_ID_1'},
                                                        {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                        {'name': 'Atom_ID_1', 'type': 'str'},
                                                        {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                         'default': '1'},
                                                        {'name': 'Comp_index_ID_2', 'type': 'int',
                                                         'default-from': 'Seq_ID_2'},
                                                        {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                        {'name': 'Atom_ID_2', 'type': 'str'}
                                                        ],
                                  'saxs_restraint': [{'name': 'Q_value', 'type': 'positive-float'}],
                                  'other_restraint': [{'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                       'default': '1'},
                                                      {'name': 'Comp_index_ID', 'type': 'int',
                                                       'default-from': 'Seq_ID'},
                                                      {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                      {'name': 'Atom_ID', 'type': 'str'}
                                                      ]
                                  }
                     }

# key items for spectral peak
PK_KEY_ITEMS = {'nef': [{'name': 'position_%s', 'type': 'float'},
                        {'name': 'peak_id', 'type': 'positive-int'},
                        {'name': 'index', 'type': 'index-int'}
                        ],
                'nmr-star': [{'name': 'Position_%s', 'type': 'float'},
                             {'name': 'ID', 'type': 'int'},  # allows to have software-native id starting from zero
                             {'name': 'Index_ID', 'type': 'index-int'}
                             ]
                }

# data items of loop
DATA_ITEMS = {'nef': {'poly_seq': [{'name': 'linking', 'type': 'enum', 'mandatory': False,
                                    'enum': ('start', 'end', 'middle', 'cyclic', 'break', 'single', 'dummy'),
                                    'enforce-enum': True},
                                   {'name': 'residue_variant', 'type': 'str', 'mandatory': False},
                                   {'name': 'cis_peptide', 'type': 'bool', 'mandatory': False}
                                   ],
                      'entity': None,
                      'chem_shift': [{'name': 'value', 'type': 'range-float', 'mandatory': True,
                                      'remove-bad-pattern': True,
                                      'range': CS_RESTRAINT_RANGE},
                                     {'name': 'value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                      'void-zero': True,
                                      'clear-bad-pattern': True,
                                      'range': CS_UNCERTAINTY_RANGE},
                                     {'name': 'element', 'type': 'enum', 'mandatory': True,
                                      'default-from': 'atom_name',
                                      'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                      'enforce-enum': True},
                                     {'name': 'isotope_number', 'type': 'enum-int', 'mandatory': True,
                                      'default-from': 'atom_name',
                                      'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                      'enforce-enum': True}
                                     ],
                      'chem_shift_ref': None,
                      'dist_restraint': [{'name': 'index', 'type': 'index-int', 'mandatory': True},
                                         # {'name': 'restraint_id', 'type': 'positive-int', 'mandatory': True,
                                         # 'enforce-non-zero': True},
                                         {'name': 'restraint_combination_id', 'type': 'positive-int', 'mandatory': False,
                                          'enforce-non-zero': True},
                                         {'name': 'weight', 'type': 'range-float', 'mandatory': True,
                                          'range': WEIGHT_RANGE},
                                         # 'enforce-non-zero': True},
                                         {'name': 'target_value', 'type': 'range-float', 'mandatory': False,
                                          'group-mandatory': True, 'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': DIST_RESTRAINT_RANGE,
                                          'group': {'member-with': ['lower_linear_limit', 'lower_limit',
                                                                    'upper_limit', 'upper_linear_limit'],
                                                    'coexist-with': None,
                                                    'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                    'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                         {'name': 'target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                          'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': DIST_UNCERTAINTY_RANGE},
                                         {'name': 'lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                          'group-mandatory': True, 'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': DIST_RESTRAINT_RANGE,
                                          'group': {'member-with': ['target_value', 'lower_limit',
                                                                    'upper_limit', 'upper_linear_limit'],
                                                    'coexist-with': None,  # ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                    'smaller-than': None,
                                                    'larger-than': ['lower_limit', 'upper_limit', 'upper_linear_limit']}},
                                         {'name': 'lower_limit', 'type': 'range-float', 'mandatory': False,
                                          'group-mandatory': True, 'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': DIST_RESTRAINT_RANGE,
                                          'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                    'upper_limit', 'upper_linear_limit'],
                                                    'coexist-with': None,  # ['upper_limit'],
                                                    'smaller-than': ['lower_linear_limit'],
                                                    'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                         {'name': 'upper_limit', 'type': 'range-float', 'mandatory': False,
                                          'group-mandatory': True, 'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': DIST_RESTRAINT_RANGE,
                                          'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                    'lower_limit', 'upper_linear_limit'],
                                                    'coexist-with': None,  # ['lower_limit'],
                                                    'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                    'larger-than': ['upper_linear_limit']}},
                                         {'name': 'upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                          'group-mandatory': True, 'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': DIST_RESTRAINT_RANGE,
                                          'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                    'lower_limit', 'upper_limit'],
                                                    'coexist-with': None,  # ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                    'smaller-than': ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                    'larger-than': None}}
                                         ],
                      'dihed_restraint': [{'name': 'index', 'type': 'index-int', 'mandatory': True},
                                          # {'name': 'restraint_id', 'type': 'positive-int', 'mandatory': True,
                                          # 'enforce-non-zero': True},
                                          {'name': 'restraint_combination_id', 'type': 'positive-int', 'mandatory': False,
                                           'enforce-non-zero': True},
                                          {'name': 'weight', 'type': 'range-float', 'mandatory': True,
                                           'range': WEIGHT_RANGE},
                                          # 'enforce-non-zero': True},
                                          {'name': 'target_value', 'type': 'range-float', 'mandatory': False,
                                           'group-mandatory': True,
                                           'clear-bad-pattern': True,
                                           'range': ANGLE_RESTRAINT_RANGE,
                                           'group': {'member-with': ['lower_linear_limit', 'lower_limit',
                                                                     'upper_limit', 'upper_linear_limit'],
                                                     'coexist-with': None,
                                                     'smaller-than': None,  # (DAOTHER-8442) ['lower_linear_limit', 'lower_limit'],
                                                     'larger-than': None,  # (DAOTHER-8442) ['upper_limit', 'upper_linear_limit'],
                                                     'circular-shift': 360.0}},
                                          {'name': 'target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                           'void-zero': True,
                                           'clear-bad-pattern': True,
                                           'range': ANGLE_UNCERTAINTY_RANGE},
                                          {'name': 'lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                           'group-mandatory': True,
                                           'clear-bad-pattern': True,
                                           'range': ANGLE_RESTRAINT_RANGE,
                                           'group': {'member-with': ['target_value', 'lower_limit', 'upper_limit',
                                                                     'upper_linear_limit'],
                                                     'coexist-with': None,  # ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                     'smaller-than': None,
                                                     'larger-than': ['lower_limit'],
                                                     # (DAOTHER-8442) ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                     'circular-shift': 360.0}},
                                          {'name': 'lower_limit', 'type': 'range-float', 'mandatory': False,
                                           'group-mandatory': True,
                                           'clear-bad-pattern': True,
                                           'range': ANGLE_RESTRAINT_RANGE,
                                           'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                     'upper_limit', 'upper_linear_limit'],
                                                     'coexist-with': None,  # ['upper_limit'],
                                                     'smaller-than': ['lower_linear_limit'],
                                                     'larger-than': None,  # (DAOTHER-8442) ['upper_limit', 'upper_linear_limit'],
                                                     'circular-shift': 360.0}},
                                          {'name': 'upper_limit', 'type': 'range-float', 'mandatory': False,
                                           'group-mandatory': True,
                                           'clear-bad-pattern': True,
                                           'range': ANGLE_RESTRAINT_RANGE,
                                           'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                     'lower_limit', 'upper_linear_limit'],
                                                     'coexist-with': None,  # ['lower_limit'],
                                                     'smaller-than': None,  # (DAOTHER-8442) ['lower_linear_limit', 'lower_limit'],
                                                     'larger-than': ['upper_linear_limit'],
                                                     'circular-shift': 360.0}},
                                          {'name': 'upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                           'group-mandatory': True,
                                           'clear-bad-pattern': True,
                                           'range': ANGLE_RESTRAINT_RANGE,
                                           'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                     'lower_limit', 'upper_limit'],
                                                     'coexist-with': None,  # ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                     'smaller-than': ['upper_limit'],
                                                     # (DAOTHER-8442) ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                     'larger-than': None,
                                                     'circular-shift': 360.0}},
                                          {'name': 'name', 'type': 'str', 'mandatory': False}
                                          ],
                      'rdc_restraint': [{'name': 'index', 'type': 'index-int', 'mandatory': True},
                                        # {'name': 'restraint_id', 'type': 'positive-int', 'mandatory': True,
                                        # 'enforce-non-zero': True},
                                        {'name': 'restraint_combination_id', 'type': 'positive-int', 'mandatory': False,
                                         'enforce-non-zero': True},
                                        {'name': 'target_value', 'type': 'range-float', 'mandatory': False,
                                         'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'range': RDC_RESTRAINT_RANGE,
                                         'group': {'member-with': ['lower_linear_limit', 'lower_limit',
                                                                   'upper_limit', 'upper_linear_limit'],
                                                   'coexist-with': None,
                                                   'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                   'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                        {'name': 'target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                         'void-zero': True,
                                         'clear-bad-pattern': True,
                                         'range': RDC_UNCERTAINTY_RANGE},
                                        {'name': 'lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                         'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'range': RDC_RESTRAINT_RANGE,
                                         'group': {'member-with': ['target_value', 'lower_limit',
                                                                   'upper_limit', 'upper_linear_limit'],
                                                   'coexist-with': None,  # ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                   'smaller-than': None,
                                                   'larger-than': ['lower_limit', 'upper_limit', 'upper_linear_limit']}},
                                        {'name': 'lower_limit', 'type': 'range-float', 'mandatory': False, 'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'range': RDC_RESTRAINT_RANGE,
                                         'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                   'upper_limit', 'upper_linear_limit'],
                                                   'coexist-with': None,  # ['upper_limit'],
                                                   'smaller-than': ['lower_linear_limit'],
                                                   'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                        {'name': 'upper_limit', 'type': 'range-float', 'mandatory': False,
                                         'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'range': RDC_RESTRAINT_RANGE,
                                         'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                   'lower_limit', 'upper_linear_limit'],
                                                   'coexist-with': None,  # ['lower_limit'],
                                                   'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                   'larger-than': ['upper_linear_limit']}},
                                        {'name': 'upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                         'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'range': RDC_RESTRAINT_RANGE,
                                         'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                   'lower_limit', 'upper_limit'],
                                                   'coexist-with': None,  # ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                   'smaller-than': ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                   'larger-than': None}},
                                        {'name': 'scale', 'type': 'range-float', 'mandatory': False,
                                         'range': SCALE_RANGE,
                                         'enforce-non-zero': True},
                                        {'name': 'distance_dependent', 'type': 'bool', 'mandatory': False}
                                        ],
                      'spectral_peak': [{'name': 'peak_id', 'type': 'positive-int', 'mandatory': True},
                                        {'name': 'volume', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'group': {'member-with': ['height'],
                                                   'coexist-with': None}},
                                        {'name': 'volume_uncertainty', 'type': 'positive-float', 'mandatory': False,
                                         'void-zero': True,
                                         'clear-bad-pattern': True},
                                        {'name': 'height', 'type': 'float', 'mandatory': False,
                                         'group-mandatory': True,
                                         'clear-bad-pattern': True,
                                         'group': {'member-with': ['volume'],
                                                   'coexist-with': None}},
                                        {'name': 'height_uncertainty', 'type': 'positive-float', 'mandatory': False,
                                         'void-zero': True,
                                         'clear-bad-pattern': True}
                                        ],
                      'spectral_peak_alt': None,
                      'noepk_restraint': None,
                      'jcoup_restraint': None,
                      'rdc_raw_data': None,
                      'csa_restraint': None,
                      'ddc_restraint': None,
                      'hvycs_restraint': None,
                      'procs_restraint': None,
                      'csp_restraint': None,
                      'auto_relax_restraint': None,
                      'heteronucl_noe_data': None,
                      'heteronucl_t1_data': None,
                      'heteronucl_t2_data': None,
                      'heteronucl_t1r_data': None,
                      'order_param_data': None,
                      'ph_titr_data': None,
                      'ph_param_data': None,
                      'coupling_const_data': None,
                      'ccr_d_csa_restraint': None,
                      'ccr_dd_restraint': None,
                      'fchiral_restraint': None,
                      'saxs_restraint': None,
                      'other_restraint': None
                      },
              'nmr-star': {'poly_seq': [{'name': 'Entity_ID', 'type': 'positive-int', 'mandatory': False},
                                        {'name': 'Seq_ID', 'type': 'int', 'mandatory': False},
                                        {'name': 'Auth_asym_ID', 'type': 'str', 'mandatory': False},
                                        {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                        {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                        {'name': 'Auth_variant_ID', 'type': 'str', 'mandatory': False},
                                        {'name': 'Sequence_linking', 'type': 'enum', 'mandatory': False,
                                         'enum': ('start', 'end', 'middle', 'cyclic', 'break', 'single', 'dummy'),
                                         'enforce-enum': True},
                                        {'name': 'Cis_residue', 'type': 'bool', 'mandatory': False},
                                        {'name': 'NEF_index', 'type': 'index-int', 'mandatory': False},
                                        {'name': 'Assembly_ID', 'type': 'pointer-index', 'mandatory': False,
                                         'default': '1', 'default-from': 'parent'}
                                        ],
                           'entity': None,
                           'chem_shift': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                           'default-from': 'Atom_ID',
                                           'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                           'enforce-enum': True},
                                          {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                           'default-from': 'Atom_ID',
                                           'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                           'enforce-enum': True},
                                          {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                           'default-from': 'Chem_shift_val',
                                           'remove-bad-pattern': True,
                                           'range': CS_RESTRAINT_RANGE},
                                          {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                           'void-zero': True, 'default-from': 'Chem_shift_val_err',
                                           'clear-bad-pattern': True,
                                           'range': CS_UNCERTAINTY_RANGE},
                                          {'name': 'Ambiguity_code', 'type': 'enum-int', 'mandatory': False,
                                           'default-from': 'Chem_shift_ambiguity_code',
                                           'enum': ALLOWED_AMBIGUITY_CODES,
                                           'enforce-enum': True},
                                          {'name': 'Ambiguity_set_ID', 'type': 'positive-int', 'mandatory': False,
                                           'enforce-non-zero': True},
                                          {'name': 'Seq_ID', 'type': 'int', 'mandatory': False},
                                          {'name': 'Auth_asym_ID', 'type': 'str', 'mandatory': False},
                                          {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                          {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                          {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                          {'name': 'Assigned_chem_shift_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                           'default': '1', 'default-from': 'parent'}
                                          ],
                           'chem_shift_ref': [{'name': 'Atom_group', 'type': 'enum', 'mandatory': True,
                                               'enum': ('methyl carbon', 'methyl carbons', 'methyl protons', 'methylene protons',
                                                        'methylene carbons', 'nitrogen', 'phosphorus', 'protons')},
                                              {'name': 'Chem_shift_val', 'type': 'float', 'mandatory': True},
                                              {'name': 'Chem_shift_units', 'type': 'enum', 'mandatory': True,
                                               'enum': ('ppm', 'Hz'),
                                               'enforce-enum': True},
                                              {'name': 'Correction_val', 'type': 'float', 'mandatory': False},
                                              {'name': 'External_ref_axis', 'type': 'enum', 'mandatory': False,
                                               'enum': ('parallel', 'perpendicular')},
                                              {'name': 'External_ref_loc', 'type': 'enum', 'mandatory': False,
                                               'enum': ('insert at center of a separate sample tube',
                                                        'insert at center of experimental sample tube',
                                                        'insert at outer edge of a separate sample tube',
                                                        'insert at outer edge of experimental sample tube',
                                                        'other',
                                                        'separate tube (no insert) not similar to the experimental sample tube',
                                                        'separate tube (no insert) similar to the experimental sample tube')},
                                              {'name': 'External_ref_sample_geometry', 'type': 'enum', 'mandatory': False,
                                               'enum': ('cylindrical', 'other', 'spherical')},
                                              {'name': 'Indirect_shift_ratio', 'type': 'range-float', 'mandatory': False,
                                               'range': {'min_exclusive': 0.0, 'max_inclusive': 1.0}},
                                              {'name': 'Rank', 'type': 'str', 'mandatory': False},
                                              {'name': 'Ref_correction_type', 'type': 'str', 'mandatory': False},
                                              {'name': 'Ref_method', 'type': 'enum', 'mandatory': False,
                                               'enum': ('external', 'internal', 'na')},
                                              {'name': 'Ref_type', 'type': 'enum', 'mandatory': False,
                                               'enum': ('direct', 'indirect')},
                                              {'name': 'Solvent', 'type': 'str', 'mandatory': False},
                                              {'name': 'Chem_shift_reference_ID', 'type': 'pointer-index', 'mandatory': True,
                                               'default': '1', 'default-from': 'parent'}
                                              ],
                           'dist_restraint': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                              {'name': 'Combination_ID', 'type': 'positive-int', 'mandatory': False,
                                               'enforce-non-zero': True},
                                              {'name': 'Member_ID', 'type': 'positive-int', 'mandatory': False,
                                               'enforce-non-zero': True},
                                              {'name': 'Member_logic_code', 'type': 'enum', 'mandatory': False,
                                               'enum': ('OR', 'AND'),
                                               'enforce-enum': True},
                                              {'name': 'Target_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True, 'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': DIST_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Lower_linear_limit',
                                                                         'Upper_linear_limit',
                                                                         'Distance_lower_bound_val',
                                                                         'Distance_upper_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val'],
                                                         'larger-than': ['Distance_upper_bound_val', 'Upper_linear_limit']}},
                                              {'name': 'Target_val_uncertainty', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': DIST_UNCERTAINTY_RANGE},
                                              {'name': 'Lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True, 'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': DIST_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Target_val',
                                                                         'Upper_linear_limit',
                                                                         'Distance_lower_bound_val',
                                                                         'Distance_upper_bound_val'],
                                                         # ['Upper_linear_limit', 'Distance_lower_bound_val',
                                                         #  'Distance_upper_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': None,
                                                         'larger-than': ['Distance_lower_bound_val', 'Distance_upper_bound_val',
                                                                         'Upper_linear_limit']}},
                                              {'name': 'Distance_lower_bound_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True, 'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': DIST_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Target_val', 'Lower_linear_limit', 'Upper_linear_limit',
                                                                         'Distance_upper_bound_val'],
                                                         # ['Distance_upper_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Lower_linear_limit'],
                                                         'larger-than': ['Distance_upper_bound_val', 'Upper_linear_limit']}},
                                              {'name': 'Distance_upper_bound_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True, 'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': DIST_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Target_val', 'Lower_linear_limit', 'Upper_linear_limit',
                                                                         'Distance_lower_bound_val'],
                                                         # ['Distance_lower_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val'],
                                                         'larger-than': ['Upper_linear_limit']}},
                                              {'name': 'Upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True, 'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': DIST_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Target_val',
                                                                         'Lower_linear_limit',
                                                                         'Distance_lower_bound_val',
                                                                         'Distance_upper_bound_val'],
                                                         # ['Lower_linear_limit', 'Distance_lower_bound_val',
                                                         #  'Distance_upper_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val',
                                                                          'Distance_upper_bound_val'],
                                                         'larger-than': None}},
                                              {'name': 'Weight', 'type': 'range-float', 'mandatory': False,
                                               'range': WEIGHT_RANGE},
                                              # 'enforce-non-zero': True},
                                              {'name': 'Distance_val', 'type': 'range-float', 'mandatory': False,
                                                       'range': DIST_RESTRAINT_RANGE},
                                              {'name': 'Seq_ID_1', 'type': 'int', 'mandatory': False},
                                              {'name': 'Seq_ID_2', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Gen_dist_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                               'default': '1', 'default-from': 'parent'}
                                              ],
                           'dihed_restraint': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                               {'name': 'Combination_ID', 'type': 'positive-int', 'mandatory': False,
                                                'enforce-non-zero': True},
                                               {'name': 'Torsion_angle_name', 'type': 'str', 'mandatory': False},
                                               {'name': 'Angle_target_val', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': ANGLE_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Angle_lower_linear_limit',
                                                                          'Angle_upper_linear_limit',
                                                                          'Angle_lower_bound_val',
                                                                          'Angle_upper_bound_val'],
                                                          'coexist-with': None,
                                                          # (DAOTHER-8442) ['Angle_lower_linear_limit', 'Angle_lower_bound_val'],
                                                          'smaller-than': None,
                                                          # (DAOTHER-8442) ['Angle_upper_bound_val', 'Angle_upper_linear_limit'],
                                                          'larger-than': None,
                                                          'circular-shift': 360.0}},
                                               {'name': 'Angle_target_val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': ANGLE_UNCERTAINTY_RANGE},
                                               {'name': 'Angle_lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': ANGLE_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Angle_target_val', 'Angle_upper_linear_limit',
                                                                          'Angle_lower_bound_val', 'Angle_upper_bound_val'],
                                                          # ['Angle_upper_linear_limit', 'Angle_lower_bound_val',
                                                          #  'Angle_upper_bound_val'],
                                                          'coexist-with': None,
                                                          'smaller-than': None,
                                                          'larger-than': ['Angle_lower_bound_val'],
                                                          # (DAOTHER-8442) ['Angle_lower_bound_val', 'Angle_upper_bound',
                                                          #                 'Angle_upper_linear_limit'],
                                                          'circular-shift': 360.0}},
                                               {'name': 'Angle_lower_bound_val', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': ANGLE_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Angle_target_val', 'Angle_lower_linear_limit',
                                                                          'Angle_upper_linear_limit', 'Angle_upper_bound_val'],
                                                          # ['Angle_upper_bound_val'],
                                                          'coexist-with': None,
                                                          'smaller-than': ['Angle_lower_linear_limit'],
                                                          # (DAOTHER-8442) ['Angle_upper_bound_val',
                                                          #                 'Angle_upper_linear_limit'],
                                                          'larger-than': None,
                                                          'circular-shift': 360.0}},
                                               {'name': 'Angle_upper_bound_val', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': ANGLE_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Angle_target_val', 'Angle_lower_linear_limit',
                                                                          'Angle_upper_linear_limit', 'Angle_lower_bound_val'],
                                                          # ['Angle_lower_bound_val'],
                                                          'coexist-with': None,
                                                          # (DAOTHER-8442) ['Angle_lower_bound_val',
                                                          #                 'Angle_upper_linear_limit'],
                                                          'smaller-than': None,
                                                          'larger-than': ['Angle_upper_linear_limit'],
                                                          'circular-shift': 360.0}},
                                               {'name': 'Angle_upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': ANGLE_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Angle_target_val', 'Angle_lower_linear_limit',
                                                                          'Angle_lower_bound_val', 'Angle_upper_bound_val'],
                                                          # ['Angle_lower_linear_limit', 'Angle_lower_bound_val',
                                                          #  'Angle_upper_bound_val'],
                                                          'coexist-with': None,
                                                          'smaller-than': ['Angle_upper_bound_val'],
                                                          # (DAOTHER-8442) ['Angle_lower_linear_limit', 'Angle_lower_bound_val',
                                                          #                 'Angle_upper_bound_val'],
                                                          'larger-than': None,
                                                          'circular-shift': 360.0}},
                                               {'name': 'Weight', 'type': 'range-float', 'mandatory': False,
                                                'range': WEIGHT_RANGE},
                                               # 'enforce-non-zero': True},
                                               {'name': 'Seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Seq_ID_3', 'type': 'int', 'mandatory': False},
                                               {'name': 'Seq_ID_4', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Torsion_angle_constraint_list_ID', 'type': 'pointer-index',
                                                'mandatory': True, 'default': '1', 'default-from': 'parent'}
                                               ],
                           'rdc_restraint': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                             {'name': 'Combination_ID', 'type': 'positive-int', 'mandatory': False,
                                              'enforce-non-zero': True},
                                             {'name': 'Target_value', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_RESTRAINT_RANGE,
                                              'group': {'member-with': ['RDC_lower_linear_limit', 'RDC_upper_linear_limit',
                                                                        'RDC_lower_bound', 'RDC_upper_bound'],
                                                        'coexist-with': None,
                                                        'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound'],
                                                        'larger-than': ['RDC_upper_bound', 'RDC_upper_linear_limit']}},
                                             {'name': 'Target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_UNCERTAINTY_RANGE},
                                             {'name': 'RDC_lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_value', 'RDC_upper_linear_limit',
                                                                        'RDC_lower_bound', 'RDC_upper_bound'],
                                                        # ['RDC_upper_linear_limit', 'RDC_lower_bound', 'RDC_upper_bound'],
                                                        'coexist-with': None,
                                                        'smaller-than': None,
                                                        'larger-than': ['RDC_lower_bound', 'RDC_upper_bound',
                                                                        'RDC_upper_linear_limit']}},
                                             {'name': 'RDC_lower_bound', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_value', 'RDC_lower_linear_limit',
                                                                        'RDC_upper_linear_limit', 'RDC_upper_bound'],
                                                        # ['RDC_upper_bound'],
                                                        'coexist-with': None,
                                                        'smaller-than': ['RDC_lower_linear_limit'],
                                                        'larger-than': ['RDC_upper_bound', 'RDC_upper_linear_limit']}},
                                             {'name': 'RDC_upper_bound', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_value', 'RDC_lower_linear_limit',
                                                                        'RDC_upper_linear_limit', 'RDC_lower_bound'],
                                                        # ['RDC_lower_bound'],
                                                        'coexist-with': None,
                                                        'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound'],
                                                        'larger-than': ['RDC_upper_linear_limit']}},
                                             {'name': 'RDC_upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_value', 'RDC_upper_linear_limit',
                                                                        'RDC_lower_bound', 'RDC_upper_bound'],
                                                        # ['RDC_upper_linear_limit', 'RDC_lower_bound', 'RDC_upper_bound'],
                                                        'coexist-with': None,
                                                        'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound',
                                                                         'RDC_upper_bound'],
                                                        'larger-than': None}},
                                             {'name': 'Weight', 'type': 'range-float', 'mandatory': False,
                                              'range': WEIGHT_RANGE},
                                             # 'enforce-non-zero': True},
                                             {'name': 'RDC_val', 'type': 'range-float', 'mandatory': False,
                                              'clear-bad-pattern': True,
                                              'range': RDC_RESTRAINT_RANGE},
                                             {'name': 'RDC_val_err', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': RDC_UNCERTAINTY_RANGE},
                                             {'name': 'RDC_val_scale_factor', 'type': 'range-float', 'mandatory': False,
                                              'range': SCALE_RANGE,
                                              'enforce-non-zero': True},
                                             {'name': 'RDC_distant_dependent', 'type': 'bool', 'mandatory': False},
                                             {'name': 'Seq_ID_1', 'type': 'int', 'mandatory': False},
                                             {'name': 'Seq_ID_2', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'RDC_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'}
                                             ],
                           'spectral_peak': [{'name': 'ID', 'type': 'int', 'mandatory': True},
                                             {'name': 'Volume', 'type': 'float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'group': {'member-with': ['Height'],
                                                        'coexist-with': None}},
                                             {'name': 'Volume_uncertainty', 'type': 'positive-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True},
                                             {'name': 'Height', 'type': 'float', 'mandatory': False,
                                              'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'group': {'member-with': ['Volume'],
                                                        'coexist-with': None}},
                                             {'name': 'Height_uncertainty', 'type': 'positive-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True},
                                             {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'}
                                             ],
                           'spectral_peak_alt': [{'name': 'ID', 'type': 'int', 'mandatory': True},
                                                 {'name': 'Figure_of_merit', 'type': 'range-float',
                                                  'mandatory': False,
                                                  'range': WEIGHT_RANGE},
                                                 {'name': 'Restraint', 'type': 'enum', 'mandatory': False,
                                                  'enum': ('no', 'yes')}
                                                 ],
                           'noepk_restraint': [{'name': 'Val', 'type': 'float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'group': {'member-with': ['Val_min', 'Val_max'],
                                                          'coexist-with': None,
                                                          'smaller-than': None,
                                                          'larger-than': None}},
                                               {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': {'min_inclusive': 0.0}},
                                               {'name': 'Val_min', 'type': 'float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'group': {'member-with': ['Val', 'Val_max'],
                                                          'coexist-with': None,
                                                          'smaller-than': None,
                                                          'larger-than': ['Val_max']}},
                                               {'name': 'Val_max', 'type': 'float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'group': {'member-with': ['Val', 'Val_min'],
                                                          'coexist-with': None,
                                                          'smaller-than': ['Val_min'],
                                                          'larger-than': None}},
                                               {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Homonucl_NOE_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                'default': '1', 'default-from': 'parent'}
                                               ],
                           'jcoup_restraint': [{'name': 'Coupling_constant_val', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': RDC_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Coupling_constant_lower_bound',
                                                                          'Coupling_constant_upper_bound'],
                                                          'coexist-with': None,
                                                          'smaller-than': None,
                                                          'larger-than': None}},
                                               {'name': 'Coupling_constant_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': {'min_inclusive': 0.0}},
                                               {'name': 'Coupling_constant_lower_bound', 'type': 'range-float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': RDC_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Coupling_constant_upper_bound'],
                                                          'coexist-with': None,
                                                          'smaller-than': None,
                                                          'larger-than': ['Coupling_constant_upper_bound']}},
                                               {'name': 'Coupling_constant_upper_bound', 'type': 'float', 'mandatory': False,
                                                'group-mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': RDC_RESTRAINT_RANGE,
                                                'group': {'member-with': ['Coupling_constant_lower_bound'],
                                                          'coexist-with': None,
                                                          'smaller-than': ['Coupling_constant_lower_bound'],
                                                          'larger-than': None}},
                                               {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'J_three_bond_constraint_list_ID', 'type': 'pointer-index',
                                                'mandatory': True, 'default': '1', 'default-from': 'parent'}
                                               ],
                           'rdc_raw_data': [{'name': 'RDC_code', 'type': 'str', 'mandatory': True},
                                            {'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atom_ID_1',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atom_ID_1',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                             'enum': ALLOWED_AMBIGUITY_CODES,
                                             'enforce-enum': True},
                                            {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atom_ID_2',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atom_ID_2',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                             'enum': ALLOWED_AMBIGUITY_CODES,
                                             'enforce-enum': True},
                                            {'name': 'Val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Val_min', 'Val_max'],
                                                       'coexist-with': None,
                                                       'smaller-than': None,
                                                       'larger-than': None}},
                                            {'name': 'Val_min', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Val_max'],
                                                       'coexist-with': None,
                                                       'smaller-than': None,
                                                       'larger-than': ['Val_max']}},
                                            {'name': 'Val_max', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Val_min'],
                                                       'coexist-with': None,
                                                       'smaller-than': ['Val_min'],
                                                       'larger-than': None}},
                                            {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': {'min_inclusive': 0.0}},
                                            {'name': 'Val_bond_length', 'type': 'range-float', 'mandatory': False,
                                             'range': DIST_RESTRAINT_RANGE},
                                            {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'RDC_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                             'default': '1', 'default-from': 'parent'}
                                            ],
                           'csa_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                              'default-from': 'Atom_ID',
                                              'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                              'enforce-enum': True},
                                             {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                              'default-from': 'Atom_ID',
                                              'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                              'enforce-enum': True},
                                             {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                              'clear-bad-pattern': True,
                                              'range': CSA_RESTRAINT_RANGE},
                                             {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': {'min_inclusive': 0.0}},
                                             {'name': 'Principal_value_sigma_11_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': CSA_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_value_sigma_22_val',
                                                                        'Principal_value_sigma_33_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_value_sigma_22_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': CSA_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_value_sigma_11_val',
                                                                        'Principal_value_sigma_33_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_value_sigma_33_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': CSA_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_value_sigma_11_val',
                                                                        'Principal_value_sigma_22_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_Euler_angle_alpha_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': ANGLE_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_Euler_angle_beta_val',
                                                                        'Principal_Euler_angle_gamma_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_Euler_angle_beta_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': ANGLE_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                        'Principal_Euler_angle_gamma_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_Euler_angle_gamma_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': ANGLE_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                        'Principal_Euler_angle_beta_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Bond_length', 'type': 'range-float', 'mandatory': False,
                                              'range': DIST_RESTRAINT_RANGE},
                                             {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                             {'name': 'Chem_shift_anisotropy_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'}
                                             ],
                           'ddc_restraint': [{'name': 'Dipolar_coupling_code', 'type': 'str', 'mandatory': True},
                                             {'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                              'default-from': 'Atom_ID_1',
                                              'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                              'enforce-enum': True},
                                             {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                              'default-from': 'Atom_ID_1',
                                              'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                              'enforce-enum': True},
                                             {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                              'enum': ALLOWED_AMBIGUITY_CODES,
                                              'enforce-enum': True},
                                             {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                              'default-from': 'Atom_ID_2',
                                              'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                              'enforce-enum': True},
                                             {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                              'default-from': 'Atom_ID_2',
                                              'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                              'enforce-enum': True},
                                             {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                              'enum': ALLOWED_AMBIGUITY_CODES,
                                              'enforce-enum': True},
                                             {'name': 'Val', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'group': {'member-with': ['Val_min', 'Val_max'],
                                                        'coexist-with': None,
                                                        'smaller-than': None,
                                                        'larger-than': None}},
                                             {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': {'min_inclusive': 0.0}},
                                             {'name': 'Val_min', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'group': {'member-with': ['Val_max'],
                                                        'coexist-with': None,
                                                        'smaller-than': None,
                                                        'larger-than': ['Val_max']}},
                                             {'name': 'Val_max', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                              'clear-bad-pattern': True,
                                              'group': {'member-with': ['Val_min'],
                                                        'coexist-with': None,
                                                        'smaller-than': ['Val_min'],
                                                        'larger-than': None}},
                                             {'name': 'Principal_Euler_angle_alpha_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': ANGLE_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_Euler_angle_beta_val',
                                                                        'Principal_Euler_angle_gamma_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_Euler_angle_beta_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': ANGLE_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                        'Principal_Euler_angle_gamma_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Principal_Euler_angle_gamma_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': False,
                                              'range': ANGLE_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                        'Principal_Euler_angle_beta_val'],
                                                        'coexist-with': None}},
                                             {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Dipolar_coupling_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'}
                                             ],
                           'hvycs_restraint': [{'name': 'CA_chem_shift_val', 'type': 'range-float', 'mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': CS_RESTRAINT_RANGE},
                                               {'name': 'CA_chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': CS_UNCERTAINTY_RANGE},
                                               {'name': 'CB_chem_shift_val', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': CS_RESTRAINT_RANGE},
                                               {'name': 'CB_chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': CS_UNCERTAINTY_RANGE},
                                               {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_asym_ID_5', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID_5', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID_5', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID_5', 'type': 'str', 'mandatory': False},
                                               {'name': 'CA_CB_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                'default': '1', 'default-from': 'parent'}
                                               ],
                           'procs_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Atom_ID',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Atom_ID',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Chem_shift_val', 'type': 'range-float', 'mandatory': True,
                                                'remove-bad-pattern': True,
                                                'range': CS_RESTRAINT_RANGE},
                                               {'name': 'Chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': CS_UNCERTAINTY_RANGE},
                                               {'name': 'Auth_asym_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'H_chem_shift_constraint_list_ID', 'type': 'pointer-index',
                                                'mandatory': True, 'default': '1', 'default-from': 'parent'}
                                               ],
                           'csp_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                              'default-from': 'Atom_ID',
                                              'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                              'enforce-enum': True},
                                             {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                              'default-from': 'Atom_ID',
                                              'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                              'enforce-enum': True},
                                             {'name': 'Chem_shift_val', 'type': 'range-float', 'mandatory': False,
                                              'clear-bad-pattern': True,
                                              'range': CS_RESTRAINT_RANGE},
                                             {'name': 'Chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': CS_UNCERTAINTY_RANGE},
                                             {'name': 'Difference_chem_shift_val', 'type': 'range-float', 'mandatory': False,
                                              'clear-bad-pattern': True,
                                              'range': CS_RESTRAINT_RANGE},
                                             {'name': 'Difference_chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': CS_UNCERTAINTY_RANGE},
                                             {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                             {'name': 'Chem_shift_perturbation_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'}
                                             ],
                           'auto_relax_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                     'default-from': 'Atom_ID',
                                                     'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                     'enforce-enum': True},
                                                    {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                     'default-from': 'Atom_ID',
                                                     'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                     'enforce-enum': True},
                                                    {'name': 'Auto_relaxation_val', 'type': 'range-float', 'mandatory': True,
                                                     'remove-bad-pattern': True,
                                                     'range': PRE_RESTRAINT_RANGE},
                                                    {'name': 'Auto_relaxation_val_err', 'type': 'range-float', 'mandatory': False,
                                                     'void-zero': True,
                                                     'clear-bad-pattern': True,
                                                     'range': PRE_RESTRAINT_RANGE},
                                                    {'name': 'Rex_val', 'type': 'range-float', 'mandatory': False,
                                                     'clear-bad-pattern': True,
                                                     'range': PRE_RESTRAINT_RANGE},
                                                    {'name': 'Rex_val_err', 'type': 'range-float', 'mandatory': False,
                                                     'void-zero': True,
                                                     'clear-bad-pattern': True,
                                                     'range': PRE_RESTRAINT_RANGE},
                                                    {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                    {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                    {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                    {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                    {'name': 'Auto_relaxation_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                     'default': '1', 'default-from': 'parent'}
                                                    ],
                           'heteronucl_noe_data': [{'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Atom_ID_1',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Atom_ID_1',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Atom_ID_2',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Atom_ID_2',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                                    'remove-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Heteronucl_NOE_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                    'default': '1', 'default-from': 'parent'}
                                                   ],
                           'heteronucl_t1_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                                   'remove-bad-pattern': True,
                                                   'range': PRE_RESTRAINT_RANGE},
                                                  {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': PRE_RESTRAINT_RANGE},
                                                  {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Heteronucl_T1_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                   'default': '1', 'default-from': 'parent'}
                                                  ],
                           'heteronucl_t2_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'T2_val', 'type': 'range-float', 'mandatory': True,
                                                   'remove-bad-pattern': True,
                                                   'range': PRE_RESTRAINT_RANGE},
                                                  {'name': 'T2_val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': PRE_RESTRAINT_RANGE},
                                                  {'name': 'Rex_val', 'type': 'range-float', 'mandatory': False,
                                                   'clear-bad-pattern': True,
                                                   'range': PRE_RESTRAINT_RANGE},
                                                  {'name': 'Rex_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': PRE_RESTRAINT_RANGE},
                                                  {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Heteronucl_T2_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                   'default': '1', 'default-from': 'parent'}
                                                  ],
                           'heteronucl_t1r_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Atom_ID',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Atom_ID',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'T1rho_val', 'type': 'range-float', 'mandatory': True,
                                                    'remove-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'T1rho_val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Rex_val', 'type': 'range-float', 'mandatory': False,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Rex_val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Heteronucl_T1rho_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                    'default': '1', 'default-from': 'parent'}
                                                   ],
                           'order_param_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                 'default-from': 'Atom_ID',
                                                 'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                 'enforce-enum': True},
                                                {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                 'default-from': 'Atom_ID',
                                                 'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                 'enforce-enum': True},
                                                {'name': 'Order_param_val', 'type': 'range-float', 'mandatory': True,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'Order_param_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'Tau_e_val', 'type': 'positive-float', 'mandatory': False,
                                                 'clear-bad-pattern': True},
                                                {'name': 'Tau_e_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                                 'clear-bad-pattern': True},
                                                {'name': 'Tau_f_val', 'type': 'positive-float', 'mandatory': False,
                                                 'clear-bad-pattern': True},
                                                {'name': 'Tau_f_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                                 'clear-bad-pattern': True},
                                                {'name': 'Tau_s_val', 'type': 'positive-float', 'mandatory': False,
                                                 'clear-bad-pattern': True},
                                                {'name': 'Tau_s_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                                 'clear-bad-pattern': True},
                                                {'name': 'Rex_val', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PRE_RESTRAINT_RANGE},
                                                {'name': 'Rex_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                 'void-zero': True,
                                                 'clear-bad-pattern': True,
                                                 'range': PRE_RESTRAINT_RANGE},
                                                {'name': 'Model_free_sum_squared_errs', 'type': 'positive-float',
                                                 'mandatory': False, 'clear-bad-pattern': True},
                                                {'name': 'Model_fit', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('Rex', 'S2', 'S2, te', 'S2, Rex', 'S2, te, Rex', 'S2f, S2, ts',
                                                          'S2f, S2s, ts', 'S2f, tf, S2, ts', 'S2f, tf, S2s, ts', 'S2f, S2, ts, Rex',
                                                          'S2f, S2s, ts, Rex', 'S2f, tf, S2, ts, Rex', 'S2f, tf, S2s, ts, Rex',
                                                          'na')},
                                                {'name': 'Sf2_val', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'Sf2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'Ss2_val', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'Ss2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'SH2_val', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'SH2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'SN2_val', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'SN2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': PROBABILITY_RANGE},
                                                {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Order_parameter_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'}
                                                ],
                           'ph_titr_data': [{'name': 'Atm_obs_atom_type', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atm_obs_atom_ID',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atm_obs_atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atm_obs_atom_ID',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Atm_titr_atom_type', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atm_titr_atom_ID',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atm_titr_atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atm_titr_atom_ID',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Hill_coeff_val', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'Hill_coeff_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'High_PH_param_fit_val', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'High_PH_param_fit_val_err', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'Low_PH_param_fit_val', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'Low_PH_param_fit_val_err', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'PKa_val', 'type': 'positive-float', 'mandatory': True,
                                             'clear-bad-pattern': True},
                                            {'name': 'PKa_val_fit_err', 'type': 'positive-float', 'mandatory': True,
                                             'clear-bad-pattern': True},
                                            {'name': 'PHmid_val', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True},
                                            {'name': 'PHmid_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                             'clear-bad-pattern': True}
                                            ],
                           'ph_param_data': [{'name': 'PH_titr_result_ID', 'type': 'positive-int', 'mandatory': True},
                                             {'name': 'PH_val', 'type': 'positive-float', 'mandatory': True},
                                             {'name': 'PH_val_err', 'type': 'positive-float', 'mandatory': False},
                                             {'name': 'Observed_NMR_param_val', 'type': 'positive-float', 'mandatory': True},
                                             {'name': 'Observed_NMR_param_val_err', 'type': 'positive-float', 'mandatory': False}
                                             ],
                           'coupling_const_data': [{'name': 'Code', 'type': 'str', 'mandatory': True},
                                                   {'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Atom_ID_1',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Atom_ID_1',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                                    'enum': ALLOWED_AMBIGUITY_CODES,
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Atom_ID_2',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Atom_ID_2',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                                    'enum': ALLOWED_AMBIGUITY_CODES,
                                                    'enforce-enum': True},
                                                   {'name': 'Val', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                                    'clear-bad-pattern': True,
                                                    'range': RDC_RESTRAINT_RANGE,
                                                    'group': {'member-with': ['Val_min', 'Val_max'],
                                                              'coexist-with': None,
                                                              'smaller-than': None,
                                                              'larger-than': None}},
                                                   {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': {'min_inclusive': 0.0}},
                                                   {'name': 'Val_min', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                                    'clear-bad-pattern': True,
                                                    'range': RDC_RESTRAINT_RANGE,
                                                    'group': {'member-with': ['Val_max'],
                                                              'coexist-with': None,
                                                              'smaller-than': None,
                                                              'larger-than': ['Val_max']}},
                                                   {'name': 'Val_max', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                                    'clear-bad-pattern': True,
                                                    'range': RDC_RESTRAINT_RANGE,
                                                    'group': {'member-with': ['Val_min'],
                                                              'coexist-with': None,
                                                              'smaller-than': ['Val_min'],
                                                              'larger-than': None}},
                                                   {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Coupling_constant_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                    'default': '1', 'default-from': 'parent'}
                                                   ],
                           'ccr_d_csa_restraint': [{'name': 'Dipole_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Dipole_atom_ID_1',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Dipole_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Dipole_atom_ID_1',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Dipole_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Dipole_atom_ID_2',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Dipole_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Dipole_atom_ID_2',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'CSA_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'CSA_atom_ID_1',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'CSA_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'CSA_atom_ID_1',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'CSA_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'CSA_atom_ID_2',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'CSA_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'CSA_atom_ID_2',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                                    'remove-bad-pattern': True,
                                                    'range': CCR_RESTRAINT_RANGE},
                                                   {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': CCR_RESTRAINT_RANGE},
                                                   {'name': 'Dipole_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Dipole_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Dipole_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Dipole_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Dipole_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Dipole_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Dipole_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Dipole_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'CSA_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'CSA_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                   {'name': 'CSA_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'CSA_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                   {'name': 'CSA_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'CSA_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                   {'name': 'CSA_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'CSA_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Cross_correlation_D_CSA_list_ID', 'type': 'pointer-index',
                                                    'mandatory': True, 'default': '1', 'default-from': 'parent'}
                                                   ],
                           'ccr_dd_restraint': [{'name': 'Dipole_1_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                 'default-from': 'Dipole_1_atom_ID_1',
                                                 'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_1_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                 'default-from': 'Dipole_1_atom_ID_1',
                                                 'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_1_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                 'default-from': 'Dipole_1_atom_ID_2',
                                                 'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_1_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                 'default-from': 'Dipole_1_atom_ID_2',
                                                 'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_2_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                 'default-from': 'Dipole_2_atom_ID_1',
                                                 'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_2_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                 'default-from': 'Dipole_2_atom_ID_1',
                                                 'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_2_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                 'default-from': 'Dipole_2_atom_ID_2',
                                                 'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                 'enforce-enum': True},
                                                {'name': 'Dipole_2_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                 'default-from': 'Dipole_2_atom_ID_2',
                                                 'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                 'enforce-enum': True},
                                                {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                                 'remove-bad-pattern': True,
                                                 'range': CCR_RESTRAINT_RANGE},
                                                {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                 'void-zero': True,
                                                 'clear-bad-pattern': True,
                                                 'range': CCR_RESTRAINT_RANGE},
                                                {'name': 'Dipole_1_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_1_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Dipole_2_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Cross_correlation_DD_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'}
                                                ],
                           'fchiral_restraint': [{'name': 'Stereospecific_assignment_code', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                 {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                 {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False}
                                                 ],
                           'saxs_restraint': [{'name': 'Intensity_val', 'type': 'float', 'mandatory': True,
                                               'remove-bad-pattern': True},
                                              {'name': 'Intensity_val_err', 'type': 'float', 'mandatory': True,
                                               'clear-bad-pattern': True},
                                              {'name': 'Weight_val', 'type': 'range-float', 'mandatory': False,
                                               'range': WEIGHT_RANGE}
                                              ],
                           'other_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Atom_ID',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Atom_ID',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Val', 'type': 'float', 'mandatory': True,
                                                'remove-bad-pattern': True},
                                               {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': {'min_inclusive': 0.0}},
                                               {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Other_data_type_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                'default': '1', 'default-from': 'parent'}
                                               ],
                           }
              }

# data items of loop to check consistency
CONSIST_DATA_ITEMS = {'nef': {'dist_restraint': [{'name': 'target_value', 'type': 'range-float', 'mandatory': False,
                                                  'group-mandatory': True,
                                                  'clear-bad-pattern': True,
                                                  'range': DIST_RESTRAINT_RANGE,
                                                  'group': {'member-with': ['lower_linear_limit', 'lower_limit',
                                                                            'upper_limit', 'upper_linear_limit'],
                                                            'coexist-with': None,
                                                            'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                            'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                                 {'name': 'target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                                  'clear-bad-pattern': True,
                                                  'range': DIST_UNCERTAINTY_RANGE},
                                                 {'name': 'lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                  'group-mandatory': True,
                                                  'clear-bad-pattern': True,
                                                  'range': DIST_RESTRAINT_RANGE,
                                                  'group': {'member-with': ['target_value', 'lower_limit',
                                                                            'upper_limit', 'upper_linear_limit'],
                                                            # ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                            'coexist-with': None,
                                                            'smaller-than': None,
                                                            'larger-than': ['lower_limit', 'upper_limit', 'upper_linear_limit']}},
                                                 {'name': 'lower_limit', 'type': 'range-float', 'mandatory': False,
                                                  'group-mandatory': True,
                                                  'clear-bad-pattern': True,
                                                  'range': DIST_RESTRAINT_RANGE,
                                                  'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                            'upper_limit', 'upper_linear_limit'],
                                                            # ['upper_limit'],
                                                            'coexist-with': None,
                                                            'smaller-than': ['lower_linear_limit'],
                                                            'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                                 {'name': 'upper_limit', 'type': 'range-float', 'mandatory': False,
                                                  'group-mandatory': True,
                                                  'clear-bad-pattern': True,
                                                  'range': DIST_RESTRAINT_RANGE,
                                                  'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                            'lower_limit', 'upper_linear_limit'],
                                                            # ['lower_limit'],
                                                            'coexist-with': None,
                                                            'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                            'larger-than': ['upper_linear_limit']}},
                                                 {'name': 'upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                  'group-mandatory': True,
                                                  'clear-bad-pattern': True,
                                                  'range': DIST_RESTRAINT_RANGE,
                                                  'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                            'lower_limit', 'upper_limit'],
                                                            # ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                            'coexist-with': None,
                                                            'smaller-than': ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                            'larger-than': None}}
                                                 ],
                              'dihed_restraint': [{'name': 'target_value', 'type': 'range-float', 'mandatory': False,
                                                   'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                  'range': ANGLE_RESTRAINT_RANGE,
                                                   'group': {'member-with': ['lower_linear_limit', 'lower_limit',
                                                                             'upper_limit', 'upper_linear_limit'],
                                                             'coexist-with': None,
                                                             'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                             'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                                  {'name': 'target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                                   'clear-bad-pattern': True,
                                                   'range': ANGLE_UNCERTAINTY_RANGE},
                                                  {'name': 'lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                   'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'range': ANGLE_RESTRAINT_RANGE,
                                                   'group': {'member-with': ['target_value', 'lower_limit',
                                                                             'upper_limit', 'upper_linear_limit'],
                                                             # ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                             'coexist-with': None,
                                                             'smaller-than': None,
                                                             'larger-than': ['lower_limit', 'upper_limit', 'upper_linear_limit']}},
                                                  {'name': 'lower_limit', 'type': 'range-float', 'mandatory': False,
                                                   'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'range': ANGLE_RESTRAINT_RANGE,
                                                   'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                             'upper_limit', 'upper_linear_limit'],
                                                             # ['upper_limit'],
                                                             'coexist-with': None,
                                                             'smaller-than': ['lower_linear_limit'],
                                                             'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                                  {'name': 'upper_limit', 'type': 'range-float', 'mandatory': False,
                                                   'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'range': ANGLE_RESTRAINT_RANGE,
                                                   'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                             'lower_limit', 'upper_linear_limit'],
                                                             # ['lower_limit'],
                                                             'coexist-with': None,
                                                             'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                             'larger-than': ['upper_linear_limit']}},
                                                  {'name': 'upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                   'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'range': ANGLE_RESTRAINT_RANGE,
                                                   'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                             'lower_limit', 'upper_limit'],
                                                             # ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                             'coexist-with': None,
                                                             'smaller-than': ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                             'larger-than': None}}
                                                  ],
                              'rdc_restraint': [{'name': 'target_value', 'type': 'range-float', 'mandatory': False,
                                                 'group-mandatory': True,
                                                 'clear-bad-pattern': True,
                                                 'range': RDC_RESTRAINT_RANGE,
                                                 'group': {'member-with': ['lower_linear_limit', 'lower_limit',
                                                                           'upper_limit', 'upper_linear_limit'],
                                                           'coexist-with': None,
                                                           'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                           'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                                {'name': 'target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                                 'clear-bad-pattern': True,
                                                 'range': RDC_UNCERTAINTY_RANGE},
                                                {'name': 'lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                 'group-mandatory': True,
                                                 'clear-bad-pattern': True,
                                                 'range': RDC_RESTRAINT_RANGE,
                                                 'group': {'member-with': ['target_value', 'lower_limit',
                                                                           'upper_limit', 'upper_linear_limit'],
                                                           # ['lower_limit', 'upper_limit', 'upper_linear_limit'],
                                                           'coexist-with': None,
                                                           'smaller-than': None,
                                                           'larger-than': ['lower_limit', 'upper_limit', 'upper_linear_limit']}},
                                                {'name': 'lower_limit', 'type': 'range-float', 'mandatory': False,
                                                 'group-mandatory': True,
                                                 'clear-bad-pattern': True,
                                                 'range': RDC_RESTRAINT_RANGE,
                                                 'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                           'upper_limit', 'upper_linear_limit'],
                                                           # ['upper_limit'],
                                                           'coexist-with': None,
                                                           'smaller-than': ['lower_linear_limit'],
                                                           'larger-than': ['upper_limit', 'upper_linear_limit']}},
                                                {'name': 'upper_limit', 'type': 'range-float', 'mandatory': False,
                                                 'group-mandatory': True,
                                                 'clear-bad-pattern': True,
                                                 'range': RDC_RESTRAINT_RANGE,
                                                 'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                           'lower_limit', 'upper_linear_limit'],
                                                           # ['lower_limit'],
                                                           'coexist-with': None,
                                                           'smaller-than': ['lower_linear_limit', 'lower_limit'],
                                                           'larger-than': ['upper_linear_limit']}},
                                                {'name': 'upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                 'group-mandatory': True,
                                                 'clear-bad-pattern': True,
                                                 'range': RDC_RESTRAINT_RANGE,
                                                 'group': {'member-with': ['target_value', 'lower_linear_limit',
                                                                           'lower_limit', 'upper_limit'],
                                                           # ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                           'coexist-with': None,
                                                           'smaller-than': ['lower_linear_limit', 'lower_limit', 'upper_limit'],
                                                           'larger-than': None}}
                                                ],
                              'spectral_peak': None,
                              'spectral_peak_alt': None,
                              'noepk_restraint': None,
                              'jcoup_restraint': None,
                              'rdc_raw_data': None,
                              'csa_restraint': None,
                              'ddc_restraint': None,
                              'hvycs_restraint': None,
                              'procs_restraint': None,
                              'csp_restraint': None,
                              'auto_relax_restraint': None,
                              'heteronucl_noe_data': None,
                              'heteronucl_t1_data': None,
                              'heteronucl_t2_data': None,
                              'heteronucl_t1r_data': None,
                              'order_param_data': None,
                              'ph_titr_data': None,
                              'ph_param_data': None,
                              'coupling_const_data': None,
                              'ccr_d_csa_restraint': None,
                              'ccr_dd_restraint': None,
                              'fchiral_restraint': None,
                              'saxs_restraint': None,
                              'other_restraint': None
                              },
                      'nmr-star': {'dist_restraint': [{'name': 'Target_val', 'type': 'range-float', 'mandatory': False,
                                                       'group-mandatory': True,
                                                       'clear-bad-pattern': True,
                                                       'range': DIST_RESTRAINT_RANGE,
                                                       'group': {'member-with': ['Lower_linear_limit',
                                                                                 'Upper_linear_limit',
                                                                                 'Distance_lower_bound_val',
                                                                                 'Distance_upper_bound_val'],
                                                                 'coexist-with': None,
                                                                 'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val'],
                                                                 'larger-than': ['Distance_upper_bound_val',
                                                                                 'Upper_linear_limit']}},
                                                      {'name': 'Target_val_uncertainty', 'type': 'range-float', 'mandatory': False,
                                                       'clear-bad-pattern': True,
                                                       'range': DIST_UNCERTAINTY_RANGE},
                                                      {'name': 'Lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                       'group-mandatory': True,
                                                       'clear-bad-pattern': True,
                                                       'range': DIST_RESTRAINT_RANGE,
                                                       'group': {'member-with': ['Target_val',
                                                                                 'Upper_linear_limit',
                                                                                 'Distance_lower_bound_val',
                                                                                 'Distance_upper_bound_val'],
                                                                 'coexist-with': None,
                                                                 # ['Upper_linear_limit', 'Distance_lower_bound_val',
                                                                 #  'Distance_upper_bound_val'],
                                                                 'smaller-than': None,
                                                                 'larger-than': ['Distance_lower_bound_val',
                                                                                 'Distance_upper_bound_val',
                                                                                 'Upper_linear_limit']}},
                                                      {'name': 'Upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                       'group-mandatory': True,
                                                       'clear-bad-pattern': True,
                                                       'range': DIST_RESTRAINT_RANGE,
                                                       'group': {'member-with': ['Target_val',
                                                                                 'Lower_linear_limit',
                                                                                 'Distance_lower_bound_val',
                                                                                 'Distance_upper_bound_val'],
                                                                 'coexist-with': None,
                                                                 # ['Lower_linear_limit', 'Distance_lower_bound_val',
                                                                 #  'Distance_upper_bound_val'],
                                                                 'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val',
                                                                                  'Distance_upper_bound_val'],
                                                                 'larger-than': None}},
                                                      {'name': 'Distance_lower_bound_val', 'type': 'range-float',
                                                       'mandatory': False,
                                                       'group-mandatory': True,
                                                       'clear-bad-pattern': True,
                                                       'range': DIST_RESTRAINT_RANGE,
                                                       'group': {'member-with': ['Target_val',
                                                                                 'Lower_linear_limit',
                                                                                 'Upper_linear_limit',
                                                                                 'Distance_upper_bound_val'],
                                                                 'coexist-with': None,  # ['Distance_upper_bound_val'],
                                                                 'smaller-than': ['Lower_linear_limit'],
                                                                 'larger-than': ['Distance_upper_bound_val',
                                                                                 'Upper_linear_limit']}},
                                                      {'name': 'Distance_upper_bound_val', 'type': 'range-float',
                                                       'mandatory': False,
                                                       'group-mandatory': True,
                                                       'clear-bad-pattern': True,
                                                       'range': DIST_RESTRAINT_RANGE,
                                                       'group': {'member-with': ['Target_val',
                                                                                 'Lower_linear_limit',
                                                                                 'Upper_linear_limit',
                                                                                 'Distance_lower_bound_val'],
                                                                 'coexist-with': None,  # ['Distance_lower_bound_val'],
                                                                 'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val'],
                                                                 'larger-than': ['Upper_linear_limit']}},
                                                      {'name': 'Distance_val', 'type': 'range-float', 'mandatory': False,
                                                       'range': DIST_RESTRAINT_RANGE}
                                                      ],
                                   'dihed_restraint': [{'name': 'Angle_lower_bound_val', 'type': 'range-float', 'mandatory': False,
                                                        'group-mandatory': True,
                                                        'clear-bad-pattern': True,
                                                        'range': ANGLE_RESTRAINT_RANGE,
                                                        'group': {'member-with': ['Angle_target_val',
                                                                                  'Angle_lower_linear_limit',
                                                                                  'Angle_upper_linear_limit',
                                                                                  'Angle_upper_bound_val'],
                                                                  'coexist-with': None,  # ['Angle_upper_bound_val'],
                                                                  'smaller-than': ['Angle_lower_linear_limit'],
                                                                  'larger-than': ['Angle_upper_bound_val',
                                                                                  'Angle_upper_linear_limit']}},
                                                       {'name': 'Angle_upper_bound_val', 'type': 'range-float', 'mandatory': False,
                                                        'group-mandatory': True,
                                                        'clear-bad-pattern': True,
                                                        'range': ANGLE_RESTRAINT_RANGE,
                                                        'group': {'member-with': ['Angle_target_val',
                                                                                  'Angle_lower_linear_limit',
                                                                                  'Angle_upper_linear_limit',
                                                                                  'Angle_lower_bound_val'],
                                                                  'coexist-with': None,  # ['Angle_lower_bound_val'],
                                                                  'smaller-than': ['Angle_lower_linear_limit',
                                                                                   'Angle_lower_bound_val'],
                                                                  'larger-than': ['Angle_upper_linear_limit']}},
                                                       {'name': 'Angle_target_val', 'type': 'range-float', 'mandatory': False,
                                                        'group-mandatory': True,
                                                        'clear-bad-pattern': True,
                                                        'range': ANGLE_RESTRAINT_RANGE,
                                                        'group': {'member-with': ['Angle_lower_linear_limit',
                                                                                  'Angle_upper_linear_limit',
                                                                                  'Angle_lower_bound_val',
                                                                                  'Angle_upper_bound_val'],
                                                                  'coexist-with': None,
                                                                  'smaller-than': ['Angle_lower_linear_limit',
                                                                                   'Angle_lower_bound_val'],
                                                                  'larger-than': ['Angle_upper_bound_val',
                                                                                  'Angle_upper_linear_limit']}},
                                                       {'name': 'Angle_target_val_err', 'type': 'range-float', 'mandatory': False,
                                                        'void-zero': True,
                                                        'clear-bad-pattern': True,
                                                        'range': ANGLE_UNCERTAINTY_RANGE},
                                                       {'name': 'Angle_lower_linear_limit', 'type': 'range-float',
                                                        'mandatory': False,
                                                        'group-mandatory': True,
                                                        'clear-bad-pattern': True,
                                                        'range': ANGLE_RESTRAINT_RANGE,
                                                        'group': {'member-with': ['Angle_target_val',
                                                                                  'Angle_upper_linear_limit',
                                                                                  'Angle_lower_bound_val',
                                                                                  'Angle_upper_bound_val'],
                                                                  'coexist-with': None,
                                                                  # ['Angle_upper_linear_limit', 'Angle_lower_bound_val',
                                                                  #  'Angle_upper_bound_val'],
                                                                  'smaller-than': None,
                                                                  'larger-than': ['Angle_lower_bound_val', 'Angle_upper_bound_val',
                                                                                  'Angle_upper_linear_limit']}},
                                                       {'name': 'Angle_upper_linear_limit', 'type': 'range-float',
                                                        'mandatory': False,
                                                        'group-mandatory': True,
                                                        'clear-bad-pattern': True,
                                                        'range': ANGLE_RESTRAINT_RANGE,
                                                        'group': {'member-with': ['Angle_target_val',
                                                                                  'Angle_lower_linear_limit',
                                                                                  'Angle_lower_bound_val',
                                                                                  'Angle_upper_bound_val'],
                                                                  'coexist-with': None,
                                                                  # ['Angle_lower_linear_limit', 'Angle_lower_bound_val',
                                                                  #  'Angle_upper_bound_val'],
                                                                  'smaller-than': ['Angle_lower_linear_limit',
                                                                                   'Angle_lower_bound_val',
                                                                                   'Angle_upper_bound_val'],
                                                                  'larger-than': None}}
                                                       ],
                                   'rdc_restraint': [{'name': 'Target_value', 'type': 'range-float', 'mandatory': False,
                                                      'group-mandatory': True,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_RESTRAINT_RANGE,
                                                      'group': {'member-with': ['RDC_lower_linear_limit',
                                                                                'RDC_upper_linear_limit',
                                                                                'RDC_lower_bound',
                                                                                'RDC_upper_bound'],
                                                                'coexist-with': None,
                                                                'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound'],
                                                                'larger-than': ['RDC_upper_bound', 'RDC_upper_linear_limit']}},
                                                     {'name': 'Target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_UNCERTAINTY_RANGE},
                                                     {'name': 'RDC_lower_bound', 'type': 'range-float', 'mandatory': False,
                                                      'group-mandatory': True,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_RESTRAINT_RANGE,
                                                      'group': {'member-with': ['Target_value',
                                                                                'RDC_lower_linear_limit',
                                                                                'RDC_upper_linear_limit',
                                                                                'RDC_upper_bound'],
                                                                'coexist-with': None,  # ['RDC_upper_bound'],
                                                                'smaller-than': ['RDC_lower_linear_limit'],
                                                                'larger-than': ['RDC_upper_boud', 'RDC_upper_linear_limit']}},
                                                     {'name': 'RDC_upper_bound', 'type': 'range-float', 'mandatory': False,
                                                      'group-mandatory': True,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_RESTRAINT_RANGE,
                                                      'group': {'member-with': ['Target_value',
                                                                                'RDC_lower_linear_limit',
                                                                                'RDC_upper_linear_limit',
                                                                                'RDC_lower_bound'],
                                                                'coexist-with': None,  # ['RDC_lower_bound'],
                                                                'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound'],
                                                                'larger-than': ['RDC_upper_linear_limit']}},
                                                     {'name': 'RDC_lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                      'group-mandatory': True,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_RESTRAINT_RANGE,
                                                      'group': {'member-with': ['Target_value', 'RDC_upper_linear_limit',
                                                                                'RDC_lower_bound', 'RDC_upper_bound'],
                                                                # ['RDC_upper_linear_limit', 'RDC_lower_bound', 'RDC_upper_bound'],
                                                                'coexist-with': None,
                                                                'smaller-than': None,
                                                                'larger-than': ['RDC_lower_bound', 'RDC_upper_bound',
                                                                                'RDC_upper_linear_limit']}},
                                                     {'name': 'RDC_upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                                      'group-mandatory': True,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_RESTRAINT_RANGE,
                                                      'group': {'member-with': ['Target_value', 'RDC_upper_linear_limit',
                                                                                'RDC_lower_bound', 'RDC_upper_bound'],
                                                                # ['RDC_upper_linear_limit', 'RDC_lower_bound', 'RDC_upper_bound'],
                                                                'coexist-with': None,
                                                                'smaller-than': None,
                                                                'larger-than': ['RDC_upper_linear_limit', 'RDC_lower_bound',
                                                                                'RDC_upper_bound']}},
                                                     {'name': 'RDC_val', 'type': 'range-float', 'mandatory': False,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_RESTRAINT_RANGE},
                                                     {'name': 'RDC_val_err', 'type': 'range-float', 'mandatory': False,
                                                      'clear-bad-pattern': True,
                                                      'range': RDC_UNCERTAINTY_RANGE}
                                                     ],
                                   'spectral_peak': None,
                                   'spectral_peak_alt': None,
                                   'noepk_restraint': None,
                                   'jcoup_restraint': None,
                                   'rdc_raw_data': None,
                                   'csa_restraint': None,
                                   'ddc_restraint': None,
                                   'hvycs_restraint': None,
                                   'procs_restraint': None,
                                   'csp_restraint': None,
                                   'auto_relax_restraint': None,
                                   'heteronucl_noe_data': None,
                                   'heteronucl_t1_data': None,
                                   'heteronucl_t2_data': None,
                                   'heteronucl_t1r_data': None,
                                   'order_param_data': None,
                                   'ph_titr_data': None,
                                   'ph_param_data': None,
                                   'coupling_const_data': None,
                                   'ccr_d_csa_restraint': None,
                                   'ccr_dd_restraint': None,
                                   'fchiral_restraint': None,
                                   'saxs_restraint': None,
                                   'other_restraint': None
                                   }
                      }

# common potential descriptor items
POTENTIAL_ITEMS = {'nef': {'dist_restraint': {'target_value': 'target_value',
                                              'lower_limit': 'lower_limit',
                                              'upper_limit': 'upper_limit',
                                              'lower_linear_limit': 'lower_linear_limit',
                                              'upper_linear_limit': 'upper_linear_limit'},
                           'dihed_restraint': {'target_value': 'target_value',
                                               'lower_limit': 'lower_limit',
                                               'upper_limit': 'upper_limit',
                                               'lower_linear_limit': 'lower_linear_limit',
                                               'upper_linear_limit': 'upper_linear_limit'},
                           'rdc_restraint': {'target_value': 'target_value',
                                             'lower_limit': 'lower_limit',
                                             'upper_limit': 'upper_limit',
                                             'lower_linear_limit': 'lower_linear_limit',
                                             'upper_linear_limit': 'upper_linear_limit'}
                           },
                   'nmr-star': {'dist_restraint': {'target_value': 'Target_val',
                                                   'target_value_alt': 'Distance_val',
                                                   'lower_limit': 'Distance_lower_bound_val',
                                                   'upper_limit': 'Distance_upper_bound_val',
                                                   'lower_linear_limit': 'Lower_linear_limit',
                                                   'upper_linear_limit': 'Upper_linear_limit'},
                                'dihed_restraint': {'target_value': 'Angle_target_val',
                                                    'lower_limit': 'Angle_lower_bound_val',
                                                    'upper_limit': 'Angle_upper_bound_val',
                                                    'lower_linear_limit': 'Angle_lower_linear_limit',
                                                    'upper_linear_limit': 'Angle_upper_linear_limit'},
                                'rdc_restraint': {'target_value': 'Target_value',
                                                  'target_value_alt': 'RDC_val',
                                                  'lower_limit': 'RDC_lower_bound',
                                                  'upper_limit': 'RDC_upper_bound',
                                                  'lower_linear_limit': 'RDC_lower_linear_limit',
                                                  'upper_linear_limit': 'RDC_upper_linear_limit'}
                                }
                   }

# loop data items for spectral peak
PK_DATA_ITEMS = {'nef': [{'name': 'position_uncertainty_%s', 'type': 'range-float', 'mandatory': False,
                          'clear-bad-pattern': True,
                          'range': CS_UNCERTAINTY_RANGE},
                         {'name': 'chain_code_%s', 'type': 'str', 'mandatory': False,
                          'relax-key-if-exist': True},
                         {'name': 'sequence_code_%s', 'type': 'int', 'mandatory': False,
                          'relax-key-if-exist': True,
                          'clear-bad-pattern': True},
                         {'name': 'residue_name_%s', 'type': 'str', 'mandatory': False,
                          'relax-key-if-exist': True,
                          'uppercase': True,
                          'clear-bad-pattern': True},
                         {'name': 'atom_name_%s', 'type': 'str', 'mandatory': False,
                          'relax-key-if-exist': True,
                          'clear-bad-pattern': True}],
                 'nmr-star': [{'name': 'Position_uncertainty_%s', 'type': 'range-float', 'mandatory': False,
                               'clear-bad-pattern': True,
                               'range': CS_UNCERTAINTY_RANGE},
                              {'name': 'Entity_assembly_ID_%s', 'type': 'positive-int-as-str', 'mandatory': False,
                               'default': '1', 'default-from': 'Auth_asym_ID_%s',
                               'enforce-non-zero': True,
                               'relax-key-if-exist': True},
                              {'name': 'Comp_index_ID_%s', 'type': 'int', 'mandatory': False,
                               'default-from': 'Seq_ID_%s',
                               'relax-key-if-exist': True,
                               'clear-bad-pattern': True},
                              {'name': 'Comp_ID_%s', 'type': 'str', 'mandatory': False,
                               'relax-key-if-exist': True,
                               'uppercase': True,
                               'clear-bad-pattern': True},
                              {'name': 'Atom_ID_%s', 'type': 'str', 'mandatory': False,
                               'relax-key-if-exist': True,
                               'clear-bad-pattern': True},
                              {'name': 'Seq_ID_%s', 'type': 'int', 'mandatory': False},
                              {'name': 'Auth_asym_ID_%s', 'type': 'str', 'mandatory': False},
                              {'name': 'Auth_seq_ID_%s', 'type': 'int', 'mandatory': False},
                              {'name': 'Auth_comp_ID_%s', 'type': 'str', 'mandatory': False},
                              {'name': 'Auth_atom_ID_%s', 'type': 'str', 'mandatory': False}]
                 }

# number of dimension of spectral peak
NUM_DIM_ITEMS = {'nef': 'num_dimensions',
                 'nmr-star': 'Number_of_spectral_dimensions'
                 }

# allowed loop tags
ALLOWED_TAGS = {'nef': {'entry_info': ['program_name', 'script_name', 'script'],
                        'poly_seq': ['index', 'chain_code', 'sequence_code', 'residue_name',
                                     'linking', 'residue_variant', 'cis_peptide'],
                        'entity': None,
                        'chem_shift': ['chain_code', 'sequence_code', 'residue_name', 'atom_name', 'value', 'value_uncertainty',
                                       'element', 'isotope_number'],
                        'chem_shift_ref': None,
                        'dist_restraint': ['index', 'restraint_id', 'restraint_combination_id', 'chain_code_1',
                                           'sequence_code_1', 'residue_name_1', 'atom_name_1', 'chain_code_2',
                                           'sequence_code_2', 'residue_name_2', 'atom_name_2', 'weight', 'target_value',
                                           'target_value_uncertainty', 'lower_linear_limit', 'lower_limit',
                                           'upper_limit', 'upper_linear_limit'],
                        'dihed_restraint': ['index', 'restraint_id', 'restraint_combination_id',
                                            'chain_code_1', 'sequence_code_1', 'residue_name_1', 'atom_name_1',
                                            'chain_code_2', 'sequence_code_2', 'residue_name_2', 'atom_name_2',
                                            'chain_code_3', 'sequence_code_3', 'residue_name_3', 'atom_name_3',
                                            'chain_code_4', 'sequence_code_4', 'residue_name_4', 'atom_name_4',
                                            'weight', 'target_value', 'target_value_uncertainty',
                                            'lower_linear_limit', 'lower_limit', 'upper_limit', 'upper_linear_limit',
                                            'name'],
                        'rdc_restraint': ['index', 'restraint_id', 'restraint_combination_id',
                                          'chain_code_1', 'sequence_code_1', 'residue_name_1', 'atom_name_1',
                                          'chain_code_2', 'sequence_code_2', 'residue_name_2', 'atom_name_2',
                                          'weight', 'target_value', 'target_value_uncertainty',
                                          'lower_linear_limit', 'lower_limit', 'upper_limit', 'upper_linear_limit',
                                          'scale', 'distance_dependent'],
                        'spectral_peak': ['index', 'peak_id', 'volume', 'volume_uncertainty', 'height', 'height_uncertainty',
                                          'position_1', 'position_uncertainty_1', 'position_2', 'position_uncertainty_2',
                                          'position_3', 'position_uncertainty_3', 'position_4', 'position_uncertainty_4',
                                          'position_5', 'position_uncertainty_5', 'position_6', 'position_uncertainty_6',
                                          'position_7', 'position_uncertainty_7', 'position_8', 'position_uncertainty_8',
                                          'position_9', 'position_uncertainty_9', 'position_10', 'position_uncertainty_10',
                                          'position_11', 'position_uncertainty_11', 'position_12', 'position_uncertainty_12',
                                          'position_13', 'position_uncertainty_13', 'position_14', 'position_uncertainty_14',
                                          'position_15', 'position_uncertainty_15',
                                          'chain_code_1', 'sequence_code_1', 'residue_name_1', 'atom_name_1',
                                          'chain_code_2', 'sequence_code_2', 'residue_name_2', 'atom_name_2',
                                          'chain_code_3', 'sequence_code_3', 'residue_name_3', 'atom_name_3',
                                          'chain_code_4', 'sequence_code_4', 'residue_name_4', 'atom_name_4',
                                          'chain_code_5', 'sequence_code_5', 'residue_name_5', 'atom_name_5',
                                          'chain_code_6', 'sequence_code_6', 'residue_name_6', 'atom_name_6',
                                          'chain_code_7', 'sequence_code_7', 'residue_name_7', 'atom_name_7',
                                          'chain_code_8', 'sequence_code_8', 'residue_name_8', 'atom_name_8',
                                          'chain_code_9', 'sequence_code_9', 'residue_name_9', 'atom_name_9',
                                          'chain_code_10', 'sequence_code_10', 'residue_name_10', 'atom_name_10',
                                          'chain_code_11', 'sequence_code_11', 'residue_name_11', 'atom_name_11',
                                          'chain_code_12', 'sequence_code_12', 'residue_name_12', 'atom_name_12',
                                          'chain_code_13', 'sequence_code_13', 'residue_name_13', 'atom_name_13',
                                          'chain_code_14', 'sequence_code_14', 'residue_name_14', 'atom_name_14',
                                          'chain_code_15', 'sequence_code_15', 'residue_name_15', 'atom_name_15'],
                        'spectral_peak_alt': None,
                        'noepk_restraint': None,
                        'jcoup_restraint': None,
                        'rdc_raw_data': None,
                        'csa_restraint': None,
                        'ddc_restraint': None,
                        'hvycs_restraint': None,
                        'procs_restraint': None,
                        'csp_restraint': None,
                        'auto_relax_restraint': None,
                        'heteronucl_noe_data': None,
                        'heteronucl_t1_data': None,
                        'heteronucl_t2_data': None,
                        'heteronucl_t1r_data': None,
                        'order_param_data': None,
                        'ph_titr_data': None,
                        'ph_param_data': None,
                        'coupling_const_data': None,
                        'ccr_d_csa_restraint': None,
                        'ccr_dd_restraint': None,
                        'fchiral_restraint': None,
                        'saxs_restraint': None,
                        'other_restraint': None
                        },
                'nmr-star': {'entry_info': ['Software_ID', 'Software_label', 'Methods_ID', 'Methods_label', 'Software_name',
                                            'Script_name', 'Script', 'Software_specific_info', 'Sf_ID', 'Entry_ID',
                                            'Software_applied_list_ID'],
                             'poly_seq': ['Assembly_chem_comp_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID', 'Comp_ID',
                                          'Seq_ID', 'Auth_entity_assembly_ID', 'Auth_asym_ID', 'Auth_seq_ID', 'Auth_comp_ID',
                                          'Auth_variant_ID', 'Sequence_linking', 'Cis_residue', 'NEF_index',
                                          'Sf_ID', 'Entry_ID', 'Assembly_ID'],
                             'entity': None,
                             # DAOTHER-7545 'Entity_assembly_asym_ID' is not authorized data item according to NMR-STAR dictionary,
                             # but it is still used conventionally
                             'chem_shift': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_assembly_asym_ID', 'Entity_ID',
                                            'Comp_index_ID', 'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                            'Val', 'Val_err', 'Assign_fig_of_merit', 'Ambiguity_code', 'Ambiguity_set_ID',
                                            'Occupancy', 'Resonance_ID',
                                            'Auth_entity_assembly_ID', 'Auth_asym_ID',
                                            'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                            'PDB_record_ID', 'PDB_model_num', 'PDB_strand_ID', 'PDB_ins_code',
                                            'PDB_residue_no', 'PDB_residue_name', 'PDB_atom_name',
                                            'Original_PDB_strand_ID', 'Original_PDB_residue_no', 'Original_PDB_residue_name',
                                            'Original_PDB_atom_name', 'Details', 'Sf_ID', 'Entry_ID',
                                            'Assigned_chem_shift_list_ID'],
                             'chem_shift_ref': ['Atom_type', 'Atom_isotope_number', 'Mol_common_name', 'Atom_group',
                                                'Concentration_val', 'Concentration_units', 'Solvent', 'Rank',
                                                'Chem_shift_units', 'Chem_shift_val', 'Ref_method', 'Ref_type',
                                                'Indirect_shift_ratio', 'Indirect_shift_ratio_cit_ID',
                                                'Indirect_shift_ratio_cit_label',
                                                'External_ref_loc', 'External_ref_sample_geometry', 'External_ref_axis',
                                                'Ref_correction_type',
                                                'Correction_val', 'Correction_val_cit_ID',
                                                'Correction_val_cit_label', 'Sf_ID', 'Entry_ID', 'Chem_shift_reference_ID'],
                             'dist_restraint': ['Index_ID', 'ID', 'Combination_ID', 'Member_ID', 'Member_logic_code',
                                                'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                                'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1', 'Atom_isotope_number_1',
                                                'Resonance_ID_1',
                                                'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                                'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2', 'Atom_isotope_number_2',
                                                'Resonance_ID_2',
                                                'Intensity_val', 'Intensity_lower_val_err', 'Intensity_upper_val_err',
                                                'Distance_val', 'Target_val', 'Target_val_uncertainty',
                                                'Lower_linear_limit', 'Upper_linear_limit',
                                                'Distance_lower_bound_val', 'Distance_upper_bound_val',
                                                'Contribution_fractional_val', 'Weight',
                                                'Spectral_peak_ID', 'Spectral_peak_list_ID',
                                                'PDB_record_ID_1', 'PDB_model_num_1', 'PDB_strand_ID_1',
                                                'PDB_ins_code_1', 'PDB_residue_no_1',
                                                'PDB_residue_name_1', 'PDB_atom_name_1',
                                                'PDB_record_ID_2', 'PDB_model_num_2', 'PDB_strand_ID_2',
                                                'PDB_ins_code_2', 'PDB_residue_no_2', 'PDB_residue_name_2', 'PDB_atom_name_2',
                                                'Auth_entity_assembly_ID_1', 'Auth_asym_ID_1', 'Auth_chain_ID_1',
                                                'Auth_seq_ID_1', 'Auth_comp_ID_1',
                                                'Auth_atom_ID_1', 'Auth_alt_ID_1', 'Auth_atom_name_1',
                                                'Auth_entity_assembly_ID_2', 'Auth_asym_ID_2', 'Auth_chain_ID_2',
                                                'Auth_seq_ID_2', 'Auth_comp_ID_2',
                                                'Auth_atom_ID_2', 'Auth_alt_ID_2', 'Auth_atom_name_2',
                                                'Sf_ID', 'Entry_ID', 'Gen_dist_constraint_list_ID',
                                                # the following Original_PDB_* data items are not legitimate,
                                                # but keep them for backward compatibility
                                                'Original_PDB_strand_ID_1', 'Original_PDB_residue_no_1',
                                                'Original_PDB_residue_name_1',
                                                'Original_PDB_strand_ID_2', 'Original_PDB_residue_no_2',
                                                'Original_PDB_residue_name_2'],
                             'dihed_restraint': ['Index_ID', 'ID', 'Combination_ID', 'Set_ID', 'Torsion_angle_name',
                                                 'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                                 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1', 'Resonance_ID_1',
                                                 'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                                 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2', 'Resonance_ID_2',
                                                 'Assembly_atom_ID_3', 'Entity_assembly_ID_3', 'Entity_ID_3', 'Comp_index_ID_3',
                                                 'Seq_ID_3', 'Comp_ID_3', 'Atom_ID_3', 'Atom_type_3', 'Resonance_ID_3',
                                                 'Assembly_atom_ID_4', 'Entity_assembly_ID_4', 'Entity_ID_4', 'Comp_index_ID_4',
                                                 'Seq_ID_4', 'Comp_ID_4', 'Atom_ID_4', 'Atom_type_4', 'Resonance_ID_4',
                                                 'Angle_lower_bound_val', 'Angle_upper_bound_val', 'Angle_target_val',
                                                 'Angle_target_val_err', 'Angle_lower_linear_limit', 'Angle_upper_linear_limit',
                                                 'Weight', 'Source_experiment_ID', 'Figure_of_merit',
                                                 'PDB_record_ID_1', 'PDB_model_num_1', 'PDB_strand_ID_1', 'PDB_ins_code_1',
                                                 'PDB_residue_no_1', 'PDB_residue_name_1', 'PDB_atom_name_1',
                                                 'PDB_record_ID_2', 'PDB_model_num_2', 'PDB_strand_ID_2', 'PDB_ins_code_2',
                                                 'PDB_residue_no_2', 'PDB_residue_name_2', 'PDB_atom_name_2',
                                                 'PDB_record_ID_3', 'PDB_model_num_3', 'PDB_strand_ID_3', 'PDB_ins_code_3',
                                                 'PDB_residue_no_3', 'PDB_residue_name_3', 'PDB_atom_name_3',
                                                 'PDB_record_ID_4', 'PDB_model_num_4', 'PDB_strand_ID_4', 'PDB_ins_code_4',
                                                 'PDB_residue_no_4', 'PDB_residue_name_4', 'PDB_atom_name_4',
                                                 'Auth_entity_assembly_ID_1', 'Auth_asym_ID_1', 'Auth_chain_ID_1',
                                                 'Auth_seq_ID_1', 'Auth_comp_ID_1',
                                                 'Auth_atom_ID_1', 'Auth_alt_ID_1', 'Auth_atom_name_1',
                                                 'Auth_entity_assembly_ID_2', 'Auth_asym_ID_2', 'Auth_chain_ID_2',
                                                 'Auth_seq_ID_2', 'Auth_comp_ID_2',
                                                 'Auth_atom_ID_2', 'Auth_alt_ID_2', 'Auth_atom_name_2',
                                                 'Auth_entity_assembly_ID_3', 'Auth_asym_ID_3', 'Auth_chain_ID_3',
                                                 'Auth_seq_ID_3', 'Auth_comp_ID_3',
                                                 'Auth_atom_ID_3', 'Auth_alt_ID_3', 'Auth_atom_name_3',
                                                 'Auth_entity_assembly_ID_4', 'Auth_asym_ID_4', 'Auth_chain_ID_4',
                                                 'Auth_seq_ID_4', 'Auth_comp_ID_4',
                                                 'Auth_atom_ID_4', 'Auth_alt_ID_4', 'Auth_atom_name_4',
                                                 'Sf_ID', 'Entry_ID', 'Torsion_angle_constraint_list_ID'],
                             'rdc_restraint': ['Index_ID', 'ID', 'Combination_ID',
                                               'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                               'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1', 'Atom_isotope_number_1',
                                               'Resonance_ID_1',
                                               'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                               'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2', 'Atom_isotope_number_2',
                                               'Resonance_ID_2',
                                               'Weight', 'RDC_val', 'RDC_val_err', 'Target_value', 'Target_value_uncertainty',
                                               'RDC_lower_bound', 'RDC_upper_bound', 'RDC_lower_linear_limit',
                                               'RDC_upper_linear_limit', 'RDC_val_scale_factor', 'RDC_bond_length',
                                               'RDC_distant_dependent',
                                               'Source_experiment_ID',
                                               'PDB_record_ID_1', 'PDB_model_num_1', 'PDB_strand_ID_1', 'PDB_ins_code_1',
                                               'PDB_residue_no_1', 'PDB_residue_name_1', 'PDB_atom_name_1',
                                               'PDB_record_ID_2', 'PDB_model_num_2', 'PDB_strand_ID_2', 'PDB_ins_code_2',
                                               'PDB_residue_no_2', 'PDB_residue_name_2', 'PDB_atom_name_2',
                                               'Auth_entity_assembly_ID_1', 'Auth_asym_ID_1', 'Auth_chain_ID_1',
                                               'Auth_seq_ID_1', 'Auth_comp_ID_1',
                                               'Auth_atom_ID_1', 'Auth_alt_ID_1', 'Auth_atom_name_1',
                                               'Auth_entity_assembly_ID_2', 'Auth_asym_ID_2', 'Auth_chain_ID_2',
                                               'Auth_seq_ID_2', 'Auth_comp_ID_2',
                                               'Auth_atom_ID_2', 'Auth_alt_ID_2', 'Auth_atom_name_2',
                                               'Sf_ID', 'Entry_ID', 'RDC_constraint_list_ID'],
                             'spectral_peak': ['Index_ID', 'ID', 'Volume', 'Volume_uncertainty', 'Height', 'Height_uncertainty',
                                               'Figure_of_merit', 'Restraint',
                                               'Position_1', 'Position_uncertainty_1', 'Line_width_1', 'Line_width_uncertainty_1',
                                               'Position_2', 'Position_uncertainty_2', 'Line_width_2', 'Line_width_uncertainty_2',
                                               'Position_3', 'Position_uncertainty_3', 'Line_width_3', 'Line_width_uncertainty_3',
                                               'Position_4', 'Position_uncertainty_4', 'Line_width_4', 'Line_width_uncertainty_4',
                                               'Position_5', 'Position_uncertainty_5', 'Line_width_5', 'Line_width_uncertainty_5',
                                               'Position_6', 'Position_uncertainty_6', 'Line_width_6', 'Line_width_uncertainty_6',
                                               'Position_7', 'Position_uncertainty_7', 'Line_width_7', 'Line_width_uncertainty_7',
                                               'Position_8', 'Position_uncertainty_8', 'Line_width_8', 'Line_width_uncertainty_8',
                                               'Position_9', 'Position_uncertainty_9', 'Line_width_9', 'Line_width_uncertainty_9',
                                               'Position_10', 'Position_uncertainty_10', 'Line_width_10', 'Line_width_uncertainty_10',  # noqa: E501, pylint: disable=line-too-long
                                               'Position_11', 'Position_uncertainty_11', 'Line_width_11', 'Line_width_uncertainty_11',  # noqa: E501, pylint: disable=line-too-long
                                               'Position_12', 'Position_uncertainty_12', 'Line_width_12', 'Line_width_uncertainty_12',  # noqa: E501, pylint: disable=line-too-long
                                               'Position_13', 'Position_uncertainty_13', 'Line_width_13', 'Line_width_uncertainty_13',  # noqa: E501, pylint: disable=line-too-long
                                               'Position_14', 'Position_uncertainty_14', 'Line_width_14', 'Line_width_uncertainty_14',  # noqa: E501, pylint: disable=line-too-long
                                               'Position_15', 'Position_uncertainty_15', 'Line_width_15', 'Line_width_uncertainty_15',  # noqa: E501, pylint: disable=line-too-long
                                               'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1', 'Seq_ID_1', 'Comp_ID_1',
                                               'Atom_ID_1', 'Ambiguity_code_1', 'Ambiguity_set_ID_1',
                                               'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2', 'Seq_ID_2', 'Comp_ID_2',
                                               'Atom_ID_2', 'Ambiguity_code_2', 'Ambiguity_set_ID_2',
                                               'Entity_assembly_ID_3', 'Entity_ID_3', 'Comp_index_ID_3', 'Seq_ID_3', 'Comp_ID_3',
                                               'Atom_ID_3', 'Ambiguity_code_3', 'Ambiguity_set_ID_3',
                                               'Entity_assembly_ID_4', 'Entity_ID_4', 'Comp_index_ID_4', 'Seq_ID_4', 'Comp_ID_4',
                                               'Atom_ID_4', 'Ambiguity_code_4', 'Ambiguity_set_ID_4',
                                               'Entity_assembly_ID_5', 'Entity_ID_5', 'Comp_index_ID_5', 'Seq_ID_5', 'Comp_ID_5',
                                               'Atom_ID_5', 'Ambiguity_code_5', 'Ambiguity_set_ID_5',
                                               'Entity_assembly_ID_6', 'Entity_ID_6', 'Comp_index_ID_6', 'Seq_ID_6', 'Comp_ID_6',
                                               'Atom_ID_6', 'Ambiguity_code_6', 'Ambiguity_set_ID_6',
                                               'Entity_assembly_ID_7', 'Entity_ID_7', 'Comp_index_ID_7', 'Seq_ID_7', 'Comp_ID_7',
                                               'Atom_ID_7', 'Ambiguity_code_7', 'Ambiguity_set_ID_7',
                                               'Entity_assembly_ID_8', 'Entity_ID_8', 'Comp_index_ID_8', 'Seq_ID_8', 'Comp_ID_8',
                                               'Atom_ID_8', 'Ambiguity_code_8', 'Ambiguity_set_ID_8',
                                               'Entity_assembly_ID_9', 'Entity_ID_9', 'Comp_index_ID_9', 'Seq_ID_9', 'Comp_ID_9',
                                               'Atom_ID_9', 'Ambiguity_code_9', 'Ambiguity_set_ID_9',
                                               'Entity_assembly_ID_10', 'Entity_ID_10', 'Comp_index_ID_10', 'Seq_ID_10', 'Comp_ID_10',  # noqa: E501, pylint: disable=line-too-long
                                               'Atom_ID_10', 'Ambiguity_code_10', 'Ambiguity_set_ID_10',
                                               'Entity_assembly_ID_11', 'Entity_ID_11', 'Comp_index_ID_11', 'Seq_ID_11', 'Comp_ID_11',  # noqa: E501, pylint: disable=line-too-long
                                               'Atom_ID_11', 'Ambiguity_code_11', 'Ambiguity_set_ID_11',
                                               'Entity_assembly_ID_12', 'Entity_ID_12', 'Comp_index_ID_12', 'Seq_ID_12', 'Comp_ID_12',  # noqa: E501, pylint: disable=line-too-long
                                               'Atom_ID_12', 'Ambiguity_code_12', 'Ambiguity_set_ID_12',
                                               'Entity_assembly_ID_13', 'Entity_ID_13', 'Comp_index_ID_13', 'Seq_ID_13', 'Comp_ID_13',  # noqa: E501, pylint: disable=line-too-long
                                               'Atom_ID_13', 'Ambiguity_code_13', 'Ambiguity_set_ID_13',
                                               'Entity_assembly_ID_14', 'Entity_ID_14', 'Comp_index_ID_14', 'Seq_ID_14', 'Comp_ID_14',  # noqa: E501, pylint: disable=line-too-long
                                               'Atom_ID_14', 'Ambiguity_code_14', 'Ambiguity_set_ID_14',
                                               'Entity_assembly_ID_15', 'Entity_ID_15', 'Comp_index_ID_15', 'Seq_ID_15', 'Comp_ID_15',  # noqa: E501, pylint: disable=line-too-long
                                               'Atom_ID_15', 'Ambiguity_code_15', 'Ambiguity_set_ID_15',
                                               'Auth_entity_assembly_ID_1', 'Auth_entity_ID_1', 'Auth_asym_ID_1', 'Auth_seq_ID_1',
                                               'Auth_comp_ID_1', 'Auth_atom_ID_1', 'Auth_ambiguity_code_1', 'Auth_ambiguity_set_ID_1',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_2', 'Auth_entity_ID_2', 'Auth_asym_ID_2', 'Auth_seq_ID_2',
                                               'Auth_comp_ID_2', 'Auth_atom_ID_2', 'Auth_ambiguity_code_2', 'Auth_ambiguity_set_ID_2',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_3', 'Auth_entity_ID_3', 'Auth_asym_ID_3', 'Auth_seq_ID_3',
                                               'Auth_comp_ID_3', 'Auth_atom_ID_3', 'Auth_ambiguity_code_3', 'Auth_ambiguity_set_ID_3',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_4', 'Auth_entity_ID_4', 'Auth_asym_ID_4', 'Auth_seq_ID_4',
                                               'Auth_comp_ID_4', 'Auth_atom_ID_4', 'Auth_ambiguity_code_4', 'Auth_ambiguity_set_ID_4',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_5', 'Auth_entity_ID_5', 'Auth_asym_ID_5', 'Auth_seq_ID_5',
                                               'Auth_comp_ID_5', 'Auth_atom_ID_5', 'Auth_ambiguity_code_5', 'Auth_ambiguity_set_ID_5',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_6', 'Auth_entity_ID_6', 'Auth_asym_ID_6', 'Auth_seq_ID_6',
                                               'Auth_comp_ID_6', 'Auth_atom_ID_6', 'Auth_ambiguity_code_6', 'Auth_ambiguity_set_ID_6',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_7', 'Auth_entity_ID_7', 'Auth_asym_ID_7', 'Auth_seq_ID_7',
                                               'Auth_comp_ID_7', 'Auth_atom_ID_7', 'Auth_ambiguity_code_7', 'Auth_ambiguity_set_ID_7',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_8', 'Auth_entity_ID_8', 'Auth_asym_ID_8', 'Auth_seq_ID_8',
                                               'Auth_comp_ID_8', 'Auth_atom_ID_8', 'Auth_ambiguity_code_8', 'Auth_ambiguity_set_ID_8',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_9', 'Auth_entity_ID_9', 'Auth_asym_ID_9', 'Auth_seq_ID_9',
                                               'Auth_comp_ID_9', 'Auth_atom_ID_9', 'Auth_ambiguity_code_9', 'Auth_ambiguity_set_ID_9',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_10', 'Auth_entity_ID_10', 'Auth_asym_ID_10', 'Auth_seq_ID_10',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_comp_ID_10', 'Auth_atom_ID_10', 'Auth_ambiguity_code_10', 'Auth_ambiguity_set_ID_10',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_11', 'Auth_entity_ID_11', 'Auth_asym_ID_11', 'Auth_seq_ID_11',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_comp_ID_11', 'Auth_atom_ID_11', 'Auth_ambiguity_code_11', 'Auth_ambiguity_set_ID_11',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_12', 'Auth_entity_ID_12', 'Auth_asym_ID_12', 'Auth_seq_ID_12',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_comp_ID_12', 'Auth_atom_ID_12', 'Auth_ambiguity_code_12', 'Auth_ambiguity_set_ID_12',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_13', 'Auth_entity_ID_13', 'Auth_asym_ID_13', 'Auth_seq_ID_13',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_comp_ID_13', 'Auth_atom_ID_13', 'Auth_ambiguity_code_13', 'Auth_ambiguity_set_ID_13',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_14', 'Auth_entity_ID_14', 'Auth_asym_ID_14', 'Auth_seq_ID_14',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_comp_ID_14', 'Auth_atom_ID_14', 'Auth_ambiguity_code_14', 'Auth_ambiguity_set_ID_14',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_entity_assembly_ID_15', 'Auth_entity_ID_15', 'Auth_asym_ID_15', 'Auth_seq_ID_15',  # noqa: E501, pylint: disable=line-too-long
                                               'Auth_comp_ID_15', 'Auth_atom_ID_15', 'Auth_ambiguity_code_15', 'Auth_ambiguity_set_ID_15',  # noqa: E501, pylint: disable=line-too-long
                                               'Details', 'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                             'spectral_peak_alt': ['Index_ID', 'ID', 'Figure_of_merit', 'Restraint', 'Details',
                                                   'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                             'noepk_restraint': ['ID', 'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1',
                                                 'Comp_index_ID_1', 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1',
                                                 'Atom_type_1', 'Atom_isotope_number_1',
                                                 'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2',
                                                 'Comp_index_ID_2', 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2',
                                                 'Atom_type_2', 'Atom_isotope_number_2',
                                                 'Val', 'Val_min', 'Val_max', 'Val_err', 'Resonance_ID_1', 'Resonance_ID_2',
                                                 'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1', 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                                 'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2', 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                                 'Sf_ID', 'Entry_ID', 'Homonucl_NOE_list_ID'],
                             'jcoup_restraint': ['ID',
                                                 'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                                 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1', 'Resonance_ID_1',
                                                 'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                                 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2', 'Resonance_ID_2',
                                                 'Assembly_atom_ID_3', 'Entity_assembly_ID_3', 'Entity_ID_3', 'Comp_index_ID_3',
                                                 'Seq_ID_3', 'Comp_ID_3', 'Atom_ID_3', 'Atom_type_3', 'Resonance_ID_3',
                                                 'Assembly_atom_ID_4', 'Entity_assembly_ID_4', 'Entity_ID_4', 'Comp_index_ID_4',
                                                 'Seq_ID_4', 'Comp_ID_4', 'Atom_ID_4', 'Atom_type_4', 'Resonance_ID_4',
                                                 'Coupling_constant_val', 'Coupling_constant_lower_bound',
                                                 'Coupling_constant_upper_bound', 'Coupling_constant_err', 'Source_experiment_ID',
                                                 'Auth_asym_ID_1', 'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1',
                                                 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                                 'Auth_asym_ID_2', 'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2',
                                                 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                                 'Auth_asym_ID_3', 'Auth_entity_assembly_ID_3', 'Auth_seq_ID_3',
                                                 'Auth_comp_ID_3', 'Auth_atom_ID_3',
                                                 'Auth_asym_ID_4', 'Auth_entity_assembly_ID_4', 'Auth_seq_ID_4',
                                                 'Auth_comp_ID_4', 'Auth_atom_ID_4',
                                                 'Sf_ID', 'Entry_ID', 'J_three_bond_constraint_list_ID'],
                             'rdc_raw_data': ['ID', 'RDC_code',
                                              'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1',
                                              'Comp_index_ID_1', 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1',
                                              'Atom_isotope_number_1', 'Ambiguity_code_1',
                                              'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2',
                                              'Comp_index_ID_2', 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2',
                                              'Atom_isotope_number_2', 'Ambiguity_code_2',
                                              'Val', 'Val_min', 'Val_max', 'Val_err', 'Val_bond_length',
                                              'Resonance_ID_1', 'Resonance_ID_2',
                                              'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1', 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                              'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2', 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                              'Sf_ID', 'Entry_ID', 'RDC_list_ID'],
                             'csa_restraint': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                               'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                               'Val', 'Val_err', 'Principal_value_sigma_11_val',
                                               'Principal_value_sigma_22_val', 'Principal_value_sigma_33_val',
                                               'Principal_Euler_angle_alpha_val', 'Principal_Euler_angle_beta_val',
                                               'Principal_Euler_angle_gamma_val',
                                               'Bond_length', 'Resonance_ID', 'Auth_entity_assembly_ID',
                                               'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                               'Sf_ID', 'Entry_ID', 'Chem_shift_anisotropy_ID'],
                             'ddc_restraint': ['ID', 'Dipolar_coupling_code',
                                               'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                               'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1',
                                               'Atom_isotope_number_1', 'Ambiguity_code_1',
                                               'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                               'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2',
                                               'Atom_isotope_number_2', 'Ambiguity_code_2',
                                               'Val', 'Val_min', 'Val_max', 'Val_err',
                                               'Principal_Euler_angle_alpha_val', 'Principal_Euler_angle_beta_val',
                                               'Principal_Euler_angle_gamma_val',
                                               'Resonance_ID_1', 'Resonance_ID_2',
                                               'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1', 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                               'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2', 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                               'Sf_ID', 'Entry_ID', 'Dipolar_coupling_list_ID'],
                             'hvycs_restraint': ['ID',
                                                 'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                                 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1', 'Resonance_ID_1',
                                                 'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                                 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2', 'Resonance_ID_2',
                                                 'Assembly_atom_ID_3', 'Entity_assembly_ID_3', 'Entity_ID_3', 'Comp_index_ID_3',
                                                 'Seq_ID_3', 'Comp_ID_3', 'Atom_ID_3', 'Atom_type_3', 'Resonance_ID_3',
                                                 'Assembly_atom_ID_4', 'Entity_assembly_ID_4', 'Entity_ID_4', 'Comp_index_ID_4',
                                                 'Seq_ID_4', 'Comp_ID_4', 'Atom_ID_4', 'Atom_type_4', 'Resonance_ID_4',
                                                 'Assembly_atom_ID_5', 'Entity_assembly_ID_5', 'Entity_ID_5', 'Comp_index_ID_5',
                                                 'Seq_ID_5', 'Comp_ID_5', 'Atom_ID_5', 'Atom_type_5', 'Resonance_ID_5',
                                                 'CA_chem_shift_val', 'CA_chem_shift_val_err',
                                                 'CB_chem_shift_val', 'CB_chem_shift_val_err',
                                                 'Source_experiment_ID',
                                                 'Auth_asym_ID_1', 'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1',
                                                 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                                 'Auth_asym_ID_2', 'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2',
                                                 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                                 'Auth_asym_ID_3', 'Auth_entity_assembly_ID_3', 'Auth_seq_ID_3',
                                                 'Auth_comp_ID_3', 'Auth_atom_ID_3',
                                                 'Auth_asym_ID_4', 'Auth_entity_assembly_ID_4', 'Auth_seq_ID_4',
                                                 'Auth_comp_ID_4', 'Auth_atom_ID_4',
                                                 'Auth_asym_ID_5', 'Auth_entity_assembly_ID_5', 'Auth_seq_ID_5',
                                                 'Auth_comp_ID_5', 'Auth_atom_ID_5',
                                                 'Sf_ID', 'Entry_ID', 'CA_CB_constraint_list_ID'],
                             'procs_restraint': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                                 'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                                 'Resonance_ID', 'Chem_shift_val', 'Chem_shift_val_err', 'Source_experiment_ID',
                                                 'Auth_asym_ID', 'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID',
                                                 'Auth_atom_ID', 'Sf_ID', 'Entry_ID', 'H_chem_shift_constraint_list_ID'],
                             'csp_restraint': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                               'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                               'Chem_shift_val', 'Chem_shift_val_err',
                                               'Difference_chem_shift_val', 'Difference_chem_shift_val_err',
                                               'Resonance_ID', 'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID',
                                               'Auth_atom_ID', 'Sf_ID', 'Entry_ID', 'Chem_shift_perturbation_list_ID'],
                             'auto_relax_restraint': ['ID', 'Assembly_ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID',
                                                      'Comp_index_ID', 'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type',
                                                      'Atom_isotope_number', 'Auto_relaxation_val', 'Auto_relaxation_val_err',
                                                      'Rex_val', 'Rex_val_err', 'Resonance_ID', 'Auth_entity_assembly_ID',
                                                      'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                                      'Sf_ID', 'Entry_ID', 'Auto_relaxation_list_ID'],
                             'heteronucl_noe_data': ['ID',
                                                     'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1', 'Comp_index_ID_1',
                                                     'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1', 'Atom_isotope_number_1',
                                                     'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2', 'Comp_index_ID_2',
                                                     'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2', 'Atom_isotope_number_2',
                                                     'Val', 'Val_err', 'Resonance_ID_1', 'Resonance_ID_2',
                                                     'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1', 'Auth_comp_ID_1', 'Auth_atom_ID_1',  # noqa: E501, pylint: disable=line-too-long
                                                     'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2', 'Auth_comp_ID_2', 'Auth_atom_ID_2',  # noqa: E501, pylint: disable=line-too-long
                                                     'Sf_ID', 'Entry_ID', 'Heteronucl_NOE_list_ID'],
                             'heteronucl_t1_data': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                                    'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                                    'Val', 'Val_err', 'Resonance_ID',
                                                    'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                                    'Sf_ID', 'Entry_ID', 'Heteronucl_T1_list_ID'],
                             'heteronucl_t2_data': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                                    'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                                    'T2_val', 'T2_val_err', 'Rex_val', 'Rex_err', 'Resonance_ID',
                                                    'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                                    'Sf_ID', 'Entry_ID', 'Heteronucl_T2_list_ID'],
                             'heteronucl_t1r_data': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                                     'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                                     'T1rho_val', 'T1rho_val_err', 'Rex_val', 'Rex_val_err', 'Resonance_ID',
                                                     'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                                     'Sf_ID', 'Entry_ID', 'Heteronucl_T1rho_list_ID'],
                             'order_param_data': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                                  'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                                  'Order_param_val', 'Order_param_val_fit_err', 'Tau_e_val', 'Tau_e_val_fit_err',
                                                  'Tau_f_val', 'Tau_f_val_fit_err', 'Tau_s_val', 'Tau_s_val_fit_err',
                                                  'Rex_val', 'Rex_val_fit_err', 'Model_free_sum_squared_errs', 'Model_fit',
                                                  'Sf2_val', 'Sf2_val_fit_err', 'Ss2_val', 'Ss2_val_fit_err',
                                                  'SH2_val', 'SH2_val_fit_err', 'SN2_val', 'SN2_val_fit_err',
                                                  'Resonance_ID', 'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID',
                                                  'Auth_atom_ID', 'Sf_ID', 'Entry_ID', 'Order_parameter_list_ID'],
                             'ph_titr_data': ['ID', 'Atm_obs_assembly_atom_ID', 'Atm_obs_entity_assembly_ID', 'Atm_obs_entity_ID',
                                              'Atm_obs_comp_index_ID', 'Atm_obs_seq_ID', 'Atm_obs_comp_ID', 'Atm_obs_atom_ID',
                                              'Atm_obs_atom_type', 'Atm_obs_atom_isotope_number', 'Atm_obs_auth_entity_assembly_ID',
                                              'Atm_obs_auth_seq_ID', 'Atm_obs_auth_comp_ID',
                                              'Atm_obs_auth_atom_ID', 'Atm_titr_assembly_atom_ID',
                                              'Atm_titr_entity_assembly_ID', 'Atm_titr_entity_ID',
                                              'Atm_titr_comp_index_ID', 'Atm_titr_seq_ID',
                                              'Atm_titr_comp_ID', 'Atm_titr_atom_ID', 'Atm_titr_atom_type',
                                              'Atm_titr_atom_isotope_number', 'Atm_titr_auth_entity_assembly_ID',
                                              'Atm_titr_auth_seq_ID', 'Atm_titr_auth_comp_ID', 'Atm_titr_auth_atom_ID',
                                              'Hill_coeff_val', 'Hill_coeff_val_fit_err',
                                              'High_PH_param_fit_val', 'High_PH_param_fit_val_err',
                                              'Low_PH_param_fit_val', 'Low_PH_param_fit_val_err',
                                              'PKa_val', 'PKa_val_fit_err', 'PHmid_val', 'PHmid_val_fit_err',
                                              'Sf_ID', 'Entry_ID', 'PH_titration_list_ID'],
                             'ph_param_data': ['ID', 'PH_titr_result_ID', 'PH_val', 'PH_val_err',
                                               'Observed_NMR_param_val', 'Observed_NMR_param_val_err',
                                               'Sf_ID', 'Entry_ID', 'PH_param_list_ID'],
                             'coupling_const_data': ['ID', 'Code', 'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1',
                                                     'Comp_index_ID_1', 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1',
                                                     'Atom_type_1', 'Atom_isotope_number_1', 'Ambiguity_code_1',
                                                     'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2',
                                                     'Comp_index_ID_2', 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2',
                                                     'Atom_type_2', 'Atom_isotope_number_2', 'Ambiguity_code_2',
                                                     'Val', 'Val_min', 'Val_max', 'Val_err', 'Resonance_ID_1', 'Resonance_ID_2',
                                                     'Auth_entity_assembly_ID_1', 'Auth_asym_ID_1',
                                                     'Auth_seq_ID_1', 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                                     'Auth_entity_assembly_ID_2', 'Auth_asym_ID_2',
                                                     'Auth_seq_ID_2', 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                                     'Details', 'Sf_ID', 'Entry_ID', 'Coupling_constant_list_ID'],
                             'ccr_d_csa_restraint': ['ID', 'Dipole_assembly_atom_ID_1', 'Dipole_entity_assembly_ID_1',
                                                     'Dipole_entity_ID_1', 'Dipole_comp_index_ID_1',
                                                     'Dipole_seq_ID_1', 'Dipole_comp_ID_1', 'Dipole_atom_ID_1',
                                                     'Dipole_atom_type_1', 'Dipole_atom_isotope_number_1',
                                                     'Dipole_assembly_atom_ID_2', 'Dipole_entity_assembly_ID_2',
                                                     'Dipole_entity_ID_2', 'Dipole_comp_index_ID_2',
                                                     'Dipole_seq_ID_2', 'Dipole_comp_ID_2', 'Dipole_atom_ID_2',
                                                     'Dipole_atom_type_2', 'Dipole_atom_isotope_number_2',
                                                     'CSA_assembly_atom_ID_1', 'CSA_entity_assembly_ID_1',
                                                     'CSA_entity_ID_1', 'CSA_comp_index_ID_1',
                                                     'CSA_seq_ID_1', 'CSA_comp_ID_1', 'CSA_atom_ID_1',
                                                     'CSA_atom_type_1', 'CSA_atom_isotope_number_1',
                                                     'CSA_assembly_atom_ID_2', 'CSA_entity_assembly_ID_2',
                                                     'CSA_entity_ID_2', 'CSA_comp_index_ID_2',
                                                     'CSA_seq_ID_2', 'CSA_comp_ID_2', 'CSA_atom_ID_2',
                                                     'CSA_atom_type_2', 'CSA_atom_isotope_number_2',
                                                     'Val', 'Val_err', 'Dipole_resonance_ID_1', 'Dipole_resonance_ID_2',
                                                     'CSA_resonance_ID_1', 'CSA_resonance_ID_2',
                                                     'Dipole_auth_entity_assembly_ID_1', 'Dipole_auth_seq_ID_1',
                                                     'Dipole_auth_comp_ID_1', 'Dipole_auth_atom_ID_1',
                                                     'Dipole_auth_entity_assembly_ID_2', 'Dipole_auth_seq_ID_2',
                                                     'Dipole_auth_comp_ID_2', 'Dipole_auth_atom_ID_2',
                                                     'CSA_auth_entity_assembly_ID_1', 'CSA_auth_seq_ID_1',
                                                     'CSA_auth_comp_ID_1', 'CSA_auth_atom_ID_1',
                                                     'CSA_auth_entity_assembly_ID_2', 'CSA_auth_seq_ID_2',
                                                     'CSA_auth_comp_ID_2', 'CSA_auth_atom_ID_2',
                                                     'Sf_ID', 'Entry_ID', 'Cross_correlation_D_CSA_list_ID'],
                             'ccr_dd_restraint': ['ID', 'Dipole_1_assembly_atom_ID_1', 'Dipole_1_entity_assembly_ID_1',
                                                  'Dipole_1_entity_ID_1', 'Dipole_1_comp_index_ID_1',
                                                  'Dipole_1_seq_ID_1', 'Dipole_1_comp_ID_1', 'Dipole_1_atom_ID_1',
                                                  'Dipole_1_atom_type_1', 'Dipole_1_atom_isotope_number_1',
                                                  'Dipole_1_assembly_atom_ID_2', 'Dipole_1_entity_assembly_ID_2',
                                                  'Dipole_1_entity_ID_2', 'Dipole_1_comp_index_ID_2',
                                                  'Dipole_1_seq_ID_2', 'Dipole_1_comp_ID_2', 'Dipole_1_atom_ID_2',
                                                  'Dipole_1_atom_type_2', 'Dipole_1_atom_isotope_number_2',
                                                  'Dipole_2_assembly_atom_ID_1', 'Dipole_2_entity_assembly_ID_1',
                                                  'Dipole_2_entity_ID_1', 'Dipole_2_comp_index_ID_1',
                                                  'Dipole_2_seq_ID_1', 'Dipole_2_comp_ID_1', 'Dipole_2_atom_ID_1',
                                                  'Dipole_2_atom_type_1', 'Dipole_2_atom_isotope_number_1',
                                                  'Dipole_2_assembly_atom_ID_2', 'Dipole_2_entity_assembly_ID_2',
                                                  'Dipole_2_entity_ID_2', 'Dipole_2_chem_comp_index_ID_2',
                                                  # NOTICE: 'Dipole_2_comp_index_ID_2' is inferred from NMR-STAR Dictionary
                                                  'Dipole_2_comp_index_ID_2',
                                                  'Dipole_2_seq_ID_2', 'Dipole_2_comp_ID_2', 'Dipole_2_atom_ID_2',
                                                  'Dipole_2_atom_type_2', 'Dipole_2_atom_isotope_number_2',
                                                  'Val', 'Val_err',
                                                  'Dipole_1_Resonance_ID_1', 'Dipole_1_Resonance_ID_2',
                                                  'Dipole_2_Resonance_ID_1', 'Dipole_2_Resonance_ID_2',
                                                  'Dipole_1_auth_entity_assembly_ID_1', 'Dipole_1_auth_seq_ID_1',
                                                  'Dipole_1_auth_comp_ID_1', 'Dipole_1_auth_atom_ID_1',
                                                  'Dipole_1_auth_entity_assembly_ID_2', 'Dipole_1_auth_seq_ID_2',
                                                  'Dipole_1_auth_comp_ID_2', 'Dipole_1_auth_atom_ID_2',
                                                  'Dipole_2_auth_entity_assembly_ID_1', 'Dipole_2_auth_seq_ID_1',
                                                  'Dipole_2_auth_comp_ID_1', 'Dipole_2_auth_atom_ID_1',
                                                  'Dipole_2_auth_entity_assembly_ID_2', 'Dipole_2_auth_seq_ID_2',
                                                  'Dipole_2_auth_comp_ID_2', 'Dipole_2_auth_atom_ID_2',
                                                  'Sf_ID', 'Entry_ID', 'Cross_correlation_DD_list_ID'],
                             'fchiral_restraint': ['ID', 'Assembly_atom_ID_1', 'Entity_assembly_ID_1', 'Entity_ID_1',
                                                   'Comp_index_ID_1', 'Seq_ID_1', 'Comp_ID_1', 'Atom_ID_1', 'Atom_type_1',
                                                   'Resonance_ID_1',
                                                   'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_ID_2',
                                                   'Comp_index_ID_2', 'Seq_ID_2', 'Comp_ID_2', 'Atom_ID_2', 'Atom_type_2',
                                                   'Resonance_ID_2',
                                                   'Stereospecific_assignment_code',
                                                   'Auth_asym_ID_1', 'Auth_entity_assembly_ID_1', 'Auth_seq_ID_1',
                                                   'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                                   'Auth_asym_ID_2', 'Auth_entity_assembly_ID_2', 'Auth_seq_ID_2',
                                                   'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                                   'Sf_ID', 'Entry_ID', 'Floating_chirality_assign_ID'],
                             'saxs_restraint': ['ID', 'Q_value', 'Intensity_val', 'Intensity_val_err', 'Weight_val',
                                                'Sf_ID', 'Entry_ID', 'SAXS_constraint_list_ID'],
                             'other_restraint': ['ID', 'Assembly_atom_ID', 'Entity_assembly_ID', 'Entity_ID', 'Comp_index_ID',
                                                 'Seq_ID', 'Comp_ID', 'Atom_ID', 'Atom_type', 'Atom_isotope_number',
                                                 'Val', 'Val_err', 'Resonance_ID',
                                                 'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                                 'Sf_ID', 'Entry_ID', 'Other_data_type_list_ID']
                             }
                }

# disallowed loop tags of spectral peak
DISALLOWED_PK_TAGS = {'nef': ['position_%s', 'position_uncertainty_%s', 'chain_code_%s', 'sequence_code_%s',
                              'residue_name_%s', 'atom_name_%s'],
                      'nmr-star': ['Position_%s', 'Position_uncertainty_%s', 'Line_width_%s',
                                   'Line_width_uncertainty_%s', 'Entity_assembly_ID_%s', 'Entity_ID_%s',
                                   'Comp_index_ID_%s', 'Seq_ID_%s', 'Comp_ID_%s', 'Atom_ID_%s',
                                   'Ambiguity_code_%s', 'Ambiguity_set_ID_%s', 'Auth_entity_assembly_ID_%s',
                                   'Auth_entity_ID_%s', 'Auth_asym_ID_%s', 'Auth_seq_ID_%s', 'Auth_comp_ID_%s',
                                   'Auth_atom_ID_%s', 'Auth_ambiguity_code_%s', 'Auth_ambiguity_set_ID_%s']
                      }

# error template for missing mandatory loop tag
ERR_TEMPLATE_FOR_MISSING_MANDATORY_LP_TAG = "The mandatory loop tag %r is missing. "\
    "Please verify the value and re-upload the %s file."

# saveframe tag prefixes (saveframe holder categories)
SF_TAG_PREFIXES = {'nef': {'entry_info': '_nef_nmr_meta_data',
                           'poly_seq': '_nef_molecular_system',
                           'entity': None,
                           'chem_shift': '_nef_chemical_shift_list',
                           'chem_shift_ref': None,
                           'dist_restraint': '_nef_distance_restraint_list',
                           'dihed_restraint': '_nef_dihedral_restraint_list',
                           'rdc_restraint': '_nef_rdc_restraint_list',
                           'spectral_peak': '_nef_nmr_spectrum',
                           'spectral_peak_alt': None,
                           'noepk_restraint': None,
                           'jcoup_restraint': None,
                           'rdc_raw_data': None,
                           'csa_restraint': None,
                           'ddc_restraint': None,
                           'hvycs_restraint': None,
                           'procs_restraint': None,
                           'csp_restraint': None,
                           'auto_relax_restraint': None,
                           'heteronucl_noe_data': None,
                           'heteronucl_t1_data': None,
                           'heteronucl_t2_data': None,
                           'heteronucl_t1r_data': None,
                           'order_param_data': None,
                           'ph_titr_data': None,
                           'ph_param_data': None,
                           'coupling_const_data': None,
                           'ccr_d_csa_restraint': None,
                           'ccr_dd_restraint': None,
                           'fchiral_restraint': None,
                           'saxs_restraint': None,
                           'other_restraint': None
                           },
                   'nmr-star': {'entry_info': '_Entry',
                                'poly_seq': '_Assembly',
                                'entity': '_Entity',
                                'chem_shift': '_Assigned_chem_shift_list',
                                'chem_shift_ref': '_Chem_shift_reference',
                                'dist_restraint': '_Gen_dist_constraint_list',
                                'dihed_restraint': '_Torsion_angle_constraint_list',
                                'rdc_restraint': '_RDC_constraint_list',
                                'spectral_peak': '_Spectral_peak_list',
                                'spectral_peak_alt': '_Spectral_peak_list',
                                'noepk_restraint': '_Homonucl_NOE_list',
                                'jcoup_restraint': '_J_three_bond_constraint_list',
                                'rdc_raw_data': '_RDC_list',
                                'csa_restraint': '_Chem_shift_anisotropy',
                                'ddc_restraint': '_Dipolar_coupling_list',
                                'hvycs_restraint': '_CA_CB_constraint_list',
                                'procs_restraint': '_H_chem_shift_constraint_list',
                                'csp_restraint': '_Chem_shift_perturbation_list',
                                'auto_relax_restraint': '_Auto_relaxation_list',
                                'heteronucl_noe_data': '_Heteronucl_NOE_list',
                                'heteronucl_t1_data': '_Heteronucl_T1_list',
                                'heteronucl_t2_data': '_Heteronucl_T2_list',
                                'heteronucl_t1r_data': '_Heteronucl_T1rho_list',
                                'order_param_data': '_Order_parameter_list',
                                'ph_titr_data': '_PH_titration_list',
                                'ph_param_data': '_PH_param_list',
                                'coupling_const_data': '_Coupling_constant_list',
                                'ccr_d_csa_restraint': '_Cross_correlation_D_CSA_list',
                                'ccr_dd_restraint': '_Cross_correlation_DD_list',
                                'fchiral_restraint': '_Floating_chirality_assign',
                                'saxs_restraint': '_SAXS_constraint_list',
                                'other_restraint': '_Other_data_type_list'
                                }
                   }

ALT_POTENTIAL_TYPE = {'?': 'undefined'}

# saveframe tag items
SF_TAG_ITEMS = {'nef': {'entry_info': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                       {'name': 'sf_framecode', 'type': 'str', 'mandatory': True},
                                       {'name': 'format_name', 'type': 'str', 'mandatory': True},
                                       {'name': 'format_version', 'type': 'str', 'mandatory': True},
                                       {'name': 'program_name', 'type': 'str', 'mandatory': True},
                                       {'name': 'program_version', 'type': 'str', 'mandatory': True},
                                       {'name': 'creation_date', 'type': 'str', 'mandatory': True},
                                       {'name': 'uuid', 'type': 'str', 'mandatory': True},
                                       {'name': 'coordinate_file_name', 'type': 'str', 'mandatory': False}
                                       ],
                        'entity': None,
                        'poly_seq': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                     {'name': 'sf_framecode', 'type': 'str', 'mandatory': True}
                                     ],
                        'chem_shift': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                       {'name': 'sf_framecode', 'type': 'str', 'mandatory': True}
                                       ],
                        'chem_shift_ref': None,
                        'dist_restraint': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'potential_type', 'type': 'enum', 'mandatory': False,
                                            'enum': ('log-harmonic', 'parabolic', 'square-well-parabolic',
                                                     'square-well-parabolic-linear', 'upper-bound-parabolic',
                                                     'lower-bound-parabolic', 'upper-bound-parabolic-linear',
                                                     'lower-bound-parabolic-linear', 'undefined', 'unknown'),
                                            'enum-alt': ALT_POTENTIAL_TYPE},
                                           {'name': 'restraint_origin', 'type': 'enum', 'mandatory': False,
                                            'enum': ('noe', 'noe_build_up', 'noe_not_seen', 'roe',
                                                     'roe_build_up', 'hbond', 'disulfide_bond', 'pre',
                                                     'symmetry', 'mutation', 'shift_perturbation',
                                                     'undefined', 'unknown'),
                                            'enum-alt': ALT_DIST_CONSTRAINT_TYPES['nef']}
                                           ],
                        'dihed_restraint': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                            {'name': 'sf_framecode', 'type': 'str', 'mandatory': True},
                                            {'name': 'potential_type', 'type': 'enum', 'mandatory': False,
                                             'enum': ('parabolic', 'square-well-parabolic', 'square-well-parabolic-linear',
                                                      'upper-bound-parabolic', 'lower-bound-parabolic',
                                                      'upper-bound-parabolic-linear', 'lower-bound-parabolic-linear',
                                                      'undefined', 'unknown'),
                                             'enum-alt': ALT_POTENTIAL_TYPE},
                                            {'name': 'restraint_origin', 'type': 'enum', 'mandatory': False,
                                             'enum': ('jcoupling', 'chemical_shift', 'undefined', 'unknown'),
                                             'enum-alt': ALT_DIHED_CONSTRAINT_TYPES['nef']}
                                            ],
                        'rdc_restraint': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                          {'name': 'sf_framecode', 'type': 'str', 'mandatory': True},
                                          {'name': 'potential_type', 'type': 'enum', 'mandatory': False,
                                           'enum': ('parabolic', 'square-well-parabolic', 'square-well-parabolic-linear',
                                                    'upper-bound-parabolic', 'lower-bound-parabolic',
                                                    'upper-bound-parabolic-linear', 'lower-bound-parabolic-linear',
                                                    'undefined', 'unknown'),
                                           'enum-alt': ALT_POTENTIAL_TYPE},
                                          {'name': 'restraint_origin', 'type': 'enum', 'mandatory': False,
                                           'enum': ('measured', 'undefined', 'unknown'),
                                           'enum-alt': ALT_RDC_CONSTRAINT_TYPES['nef']},
                                          {'name': 'tensor_magnitude', 'type': 'float', 'mandatory': False},
                                          {'name': 'tensor_rhombicity', 'type': 'positive-float', 'mandatory': False},
                                          {'name': 'tensor_chain_code', 'type': 'str', 'mandatory': False},
                                          {'name': 'tensor_sequence_code', 'type': 'str', 'mandatory': False},
                                          {'name': 'tensor_residue_name', 'type': 'str', 'mandatory': False}
                                          ],
                        'spectral_peak': [{'name': 'sf_category', 'type': 'str', 'mandatory': True},
                                          {'name': 'sf_framecode', 'type': 'str', 'mandatory': True},
                                          {'name': 'num_dimensions', 'type': 'enum-int', 'mandatory': True,
                                           'enum': set(range(1, MAX_DIM_NUM_OF_SPECTRA)),
                                           'enforce-enum': True},
                                          {'name': 'chemical_shift_list', 'type': 'str', 'mandatory': False},
                                          {'name': 'experiment_classification', 'type': 'str', 'mandatory': False},
                                          {'name': 'experiment_type', 'type': 'str', 'mandatory': False}
                                          ],
                        'spectral_peak_alt': None,
                        'noepk_restraint': None,
                        'jcoup_restraint': None,
                        'rdc_raw_data': None,
                        'csa_restraint': None,
                        'ddc_restraint': None,
                        'hvycs_restraint': None,
                        'procs_restraint': None,
                        'csp_restraint': None,
                        'auto_relax_restraint': None,
                        'heteronucl_noe_data': None,
                        'heteronucl_t1_data': None,
                        'heteronucl_t2_data': None,
                        'heteronucl_t1r_data': None,
                        'order_param_data': None,
                        'ph_titr_data': None,
                        'ph_param_data': None,
                        'coupling_const_data': None,
                        'ccr_d_csa_restraint': None,
                        'ccr_dd_restraint': None,
                        'fchiral_restraint': None,
                        'saxs_restraint': None,
                        'other_restraint': None
                        },
                'nmr-star': {'entry_info': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                            {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                            {'name': 'NMR_STAR_version', 'type': 'str', 'mandatory': True},
                                            {'name': 'Source_data_format', 'type': 'str', 'mandatory': False},
                                            {'name': 'Source_data_format_version', 'type': 'str', 'mandatory': False},
                                            {'name': 'Generated_software_name', 'type': 'str', 'mandatory': False},
                                            {'name': 'Generated_software_version', 'type': 'str', 'mandatory': False},
                                            {'name': 'Generated_date', 'type': 'str', 'mandatory': False},
                                            {'name': 'UUID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Related_coordinate_file_name', 'type': 'str', 'mandatory': False}
                                            ],
                             'entity': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                        {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                        {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                        {'name': 'Name', 'type': 'str', 'mandatory': True},
                                        {'name': 'Polymer_common_type', 'type': 'enum', 'mandatory': False,
                                         'enum': ('protein', 'DNA', 'RNA', 'DNA/RNA hybrid', 'polysaccharide')},
                                        {'name': 'Polymer_type', 'type': 'enum', 'mandatory': False,
                                         'enum': ('cyclic-pseudo-peptide', 'polypeptide(L)', 'polydeoxyribonucleotide',
                                                  'polyribonucleotide', 'polydeoxyribonucleotide/polyribonucleotide hybrid',
                                                  'polypeptide(D)', 'polysaccharide(D)', 'polysaccharide(L)', 'other')}
                                        ],
                             'poly_seq': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                          {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True}
                                          ],
                             'chem_shift': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                            {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True}
                                            ],
                             'chem_shift_ref': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                {'name': 'Proton_shifts_flag', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('no', 'yes', 'yes with IUPAC referencing')},
                                                {'name': 'Carbon_shifts_flag', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('no', 'yes', 'yes with IUPAC referencing')},
                                                {'name': 'Nitrogen_shifts_flag', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('no', 'yes', 'yes with IUPAC referencing')},
                                                {'name': 'Phosphorus_shifts_flag', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('no', 'yes', 'yes with IUPAC referencing')},
                                                {'name': 'Other_shifts_flag', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('no', 'yes', 'yes with IUPAC referencing')},
                                                ],
                             'dist_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                {'name': 'Constraint_type', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('NOE', 'NOE build-up', 'NOE not seen', 'ROE', 'ROE build-up',
                                                          'hydrogen bond', 'disulfide bond', 'paramagnetic relaxation',
                                                          'symmetry', 'general distance', 'mutation', 'chemical shift perturbation',
                                                          'undefined', 'unknown'),
                                                 'enum-alt': ALT_DIST_CONSTRAINT_TYPES['nmr-star']},
                                                {'name': 'Potential_type', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('log-harmonic', 'parabolic', 'square-well-parabolic',
                                                          'square-well-parabolic-linear', 'upper-bound-parabolic',
                                                          'lower-bound-parabolic', 'upper-bound-parabolic-linear',
                                                          'lower-bound-parabolic-linear', 'undefined', 'unknown'),
                                                 'enum-alt': ALT_POTENTIAL_TYPE}
                                                ],
                             'dihed_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Constraint_type', 'type': 'enum', 'mandatory': False,
                                                  'enum': ('J-couplings', 'backbone chemical shifts', 'undefined', 'unknown'),
                                                  'enum-alt': ALT_DIHED_CONSTRAINT_TYPES['nmr-star']},
                                                 {'name': 'Potential_type', 'type': 'enum', 'mandatory': False,
                                                  'enum': ('parabolic', 'square-well-parabolic', 'square-well-parabolic-linear',
                                                           'upper-bound-parabolic', 'lower-bound-parabolic',
                                                           'upper-bound-parabolic-linear', 'lower-bound-parabolic-linear',
                                                           'undefined', 'unknown'),
                                                  'enum-alt': ALT_POTENTIAL_TYPE}
                                                 ],
                             'rdc_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Constraint_type', 'type': 'enum', 'mandatory': False,
                                                'enum': ('RDC', 'undefined', 'unknown'),
                                                'enum-alt': ALT_RDC_CONSTRAINT_TYPES['nmr-star']},
                                               {'name': 'Potential_type', 'type': 'enum', 'mandatory': False,
                                                'enum': ('parabolic', 'square-well-parabolic', 'square-well-parabolic-linear',
                                                         'upper-bound-parabolic', 'lower-bound-parabolic',
                                                         'upper-bound-parabolic-linear', 'lower-bound-parabolic-linear',
                                                         'undefined', 'unknown'),
                                                'enum-alt': ALT_POTENTIAL_TYPE},
                                               {'name': 'Tensor_magnitude', 'type': 'float', 'mandatory': False},
                                               {'name': 'Tensor_rhombicity', 'type': 'positive-float', 'mandatory': False},
                                               {'name': 'Tensor_auth_asym_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Tensor_auth_seq_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Tensor_auth_comp_ID', 'type': 'str', 'mandatory': False}
                                               ],
                             'spectral_peak': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Number_of_spectral_dimensions', 'type': 'enum-int', 'mandatory': True,
                                                'enum': set(range(1, MAX_DIM_NUM_OF_SPECTRA)),
                                                'enforce-enum': True},
                                               {'name': 'Experiment_class', 'type': 'str', 'mandatory': False},
                                               {'name': 'Experiment_type', 'type': 'str', 'mandatory': False},
                                               # 'Chemical_shift_list' should not be mandatory because of auto-population
                                               # if possible, otherwise null
                                               {'name': 'Chemical_shift_list', 'type': 'str', 'mandatory': False}
                                               ],
                             'spectral_peak_alt': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                   {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                   {'name': 'Number_of_spectral_dimensions', 'type': 'enum-int', 'mandatory': True,
                                                    'enum': set(range(1, MAX_DIM_NUM_OF_SPECTRA)),
                                                    'enforce-enum': True},
                                                   {'name': 'Experiment_class', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Experiment_type', 'type': 'str', 'mandatory': False},
                                                   ],
                             'noepk_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Homonuclear_NOE_val_type', 'type': 'enum', 'mandatory': True,
                                                  'enum': ('peak volume', 'peak height', 'contour count', 'na')}
                                                 ],
                             'jcoup_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True}
                                                 ],
                             'rdc_raw_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                              {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                              {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                               'enforce-non-zero': True}
                                              ],
                             'csa_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                               'enforce-non-zero': True},
                                               {'name': 'Val_units', 'type': 'enum', 'mandatory': False,
                                                'enum': ('ppm', 'ppb')}
                                               ],
                             'ddc_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                               'enforce-non-zero': True},
                                               {'name': 'Scaling_factor', 'type': 'positive-float', 'mandatory': False},
                                               {'name': 'Fitting_procedure', 'type': 'str', 'mandatory': False}
                                               ],
                             'hvycs_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Units', 'type': 'str', 'mandatory': False}
                                                 ],
                             'procs_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Units', 'type': 'str', 'mandatory': False}
                                                 ],
                             'csp_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Type', 'type': 'enum', 'mandatory': False,
                                                'enum': ('macromolecular binding', 'ligand binding',
                                                         'ligand fragment binding', 'paramagnetic ligand binding')},
                                               {'name': 'Details', 'type': 'str', 'mandatory': False}
                                               ],
                             'auto_relax_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                      {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                      {'name': 'Temp_calibration_method', 'type': 'enum', 'mandatory': False,
                                                       'enum': ('methanol', 'monoethylene glycol', 'no calibration applied')},
                                                      {'name': 'Temp_control_method', 'type': 'enum', 'mandatory': False,
                                                       'enum': ('single scan interleaving', 'temperature compensation block',
                                                                'single scan interleaving and temperature compensation block',
                                                                'no temperature control applied')},
                                                      {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                       'mandatory': False, 'enforce-non-zero': True},
                                                      {'name': 'Exact_field_strength', 'type': 'positive-float',
                                                       'mandatory': False, 'enforce-non-zero': True},
                                                      {'name': 'Common_relaxation_type_name', 'type': 'enum', 'mandatory': False,
                                                       'enum': ('R1', 'R2', 'R1rho', 'ZQ relaxation', 'longitudinal spin order',
                                                                'single quantum antiphase', 'DQ relaxation')},
                                                      {'name': 'Relaxation_coherence_type', 'type': 'enum', 'mandatory': True,
                                                       'enum': ('Iz', 'Sz', '(I+)+(I-)', '(S+)+(S-)', 'I+', 'I-', 'S+', 'S-',
                                                                '(I+S-)+(I-S+)', 'I-S+', 'I+S-', 'IzSz', '((I+)+(I-))Sz',
                                                                'Iz((S+)+(S-))', 'I+Sz', 'I-Sz', 'IzS+', 'IzS-', '(I+S+)+(I-S-)',
                                                                'I+S+', 'I-S-')},
                                                      {'name': 'Relaxation_val_units', 'type': 'enum', 'mandatory': True,
                                                       'enum': ('s-1', 'ms-1', 'us-1', 'ns-1', 'ps-1')},
                                                      {'name': 'Rex_units', 'type': 'enum', 'mandatory': False,
                                                       'enum': ('s-1', 'ms-1', 'us-1')},
                                                      {'name': 'Rex_field_strength', 'type': 'positive-float', 'mandatory': False,
                                                       'enforce-non-zero': True}
                                                      ],
                             'heteronucl_noe_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                      'mandatory': False, 'enforce-non-zero': True},
                                                     {'name': 'Heteronuclear_NOE_val_type', 'type': 'enum', 'mandatory': True,
                                                      'enum': ('peak height', 'peak integral', 'contour count',
                                                               'relative intensities', 'na')}
                                                     ],
                             'heteronucl_t1_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                    {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                    {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                     'mandatory': False, 'enforce-non-zero': True},
                                                    {'name': 'T1_coherence_type', 'type': 'enum', 'mandatory': True,
                                                     'enum': ('Iz', 'Sz', 'na')},
                                                    {'name': 'T1_val_units', 'type': 'enum', 'mandatory': True,
                                                     'enum': ('s', 's-1', 'ms', 'ms-1')},
                                                    ],
                             'heteronucl_t2_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                    {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                    {'name': 'Temp_calibration_method', 'type': 'enum', 'mandatory': False,
                                                     'enum': ('methanol', 'monoethylene glycol', 'no calibration applied')},
                                                    {'name': 'Temp_control_method', 'type': 'enum', 'mandatory': False,
                                                     'enum': ('single scan interleaving', 'temperature compensation block',
                                                              'single scan interleaving and temperature compensation block',
                                                              'no temperature control applied')},
                                                    {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                     'mandatory': False, 'enforce-non-zero': True},
                                                    {'name': 'T2_coherence_type', 'type': 'enum', 'mandatory': True,
                                                     'enum': ('I(+,-)', 'S(+,-)', 'na')},
                                                    {'name': 'T2_val_units', 'type': 'enum', 'mandatory': True,
                                                     'enum': ('s', 's-1', 'ms', 'ms-1')},
                                                    {'name': 'Rex_units', 'type': 'enum', 'mandatory': False,
                                                     'enum': ('s-1', 'ms-1', 'us-1')}
                                                    ],
                             'heteronucl_t1r_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Temp_calibration_method', 'type': 'enum', 'mandatory': False,
                                                      'enum': ('methanol', 'monoethylene glycol', 'no calibration applied')},
                                                     {'name': 'Temp_control_method', 'type': 'enum', 'mandatory': False,
                                                      'enum': ('single scan interleaving', 'temperature compensation block',
                                                               'single scan interleaving and temperature compensation block',
                                                               'no temperature control applied')},
                                                     {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                      'mandatory': False, 'enforce-non-zero': True},
                                                     {'name': 'T1rho_coherence_type', 'type': 'enum', 'mandatory': True,
                                                      'enum': ('I(+,-)', 'S(+,-)', 'na')},
                                                     {'name': 'T1rho_val_units', 'type': 'enum', 'mandatory': True,
                                                      'enum': ('s', 's-1', 'ms', 'ms-1')},
                                                     {'name': 'Rex_units', 'type': 'enum', 'mandatory': False,
                                                      'enum': ('s-1', 'ms-1', 'us-1')}
                                                     ],
                             'order_param_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Tau_e_val_units', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('s', 'ms', 'us', 'ns', 'ps')},
                                                  {'name': 'Tau_f_val_units', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('s', 'ms', 'us', 'ns', 'ps')},
                                                  {'name': 'Tau_s_val_units', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('s', 'ms', 'us', 'ns', 'ps')},
                                                  {'name': 'Rex_val_units', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('s-1', 'ms-1', 'us-1')},
                                                  {'name': 'Rex_field_strength', 'type': 'positive-float', 'mandatory': False,
                                                   'enforce-non-zero': True}
                                                  ],
                             'ph_titr_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                              {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                              {'name': 'Expt_observed_param', 'type': 'enum', 'mandatory': True,
                                               'enum': ('chemical shift', 'coupling constant', 'peak height', 'peak volume')}
                                              ],
                             'ph_param_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Observed_NMR_param', 'type': 'enum', 'mandatory': True,
                                                'enum': ('chemical shift', 'coupling constant', 'peak height', 'peak volume')},
                                               {'name': 'PH_titration_list_ID', 'type': 'positive-int', 'mandatory': True,
                                                'default': '1'}
                                               ],
                             'coupling_const_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                      'mandatory': False, 'enforce-non-zero': True},
                                                     ],
                             'ccr_d_csa_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                     {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                      'mandatory': False, 'enforce-non-zero': True},
                                                     {'name': 'Val_units', 'type': 'enum', 'mandatory': True,
                                                      'enum': ('s-1', 'ms-1', 'us-1')}
                                                     ],
                             'ccr_dd_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                   'mandatory': False, 'enforce-non-zero': True},
                                                  {'name': 'Val_units', 'type': 'enum', 'mandatory': True,
                                                   'enum': ('s-1', 'ms-1', 'us-1')}
                                                  ],
                             'fchiral_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                   {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                   {'name': 'Stereo_count', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Stereo_assigned_count', 'type': 'int', 'mandatory': True}
                                                   ],
                             'saxs_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True}
                                                ],
                             'other_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Definition', 'type': 'str', 'mandatory': True}
                                                 ]
                             }
                }

# required saveframe tag items by NmrDpUtility
MANDATORY_SF_TAG_ITEMS = {'nef': {'entry_info': None,
                                  'poly_seq': None,
                                  'entity': None,
                                  'chem_shift': None,
                                  'chem_shift_ref': None,
                                  'dist_restraint': ['restraint_origin', 'potential_type'],
                                  'dihed_restraint': ['restraint_origin', 'potential_type'],
                                  'rdc_restraint': ['restraint_origin', 'potential_type'],
                                  'spectral_peak': ['experiment_type'],
                                  'spectral_peak_alt': None,
                                  'noepk_restraint': None,
                                  'jcoup_restraint': None,
                                  'rdc_raw_data': None,
                                  'csa_restraint': None,
                                  'ddc_restraint': None,
                                  'hvycs_restraint': None,
                                  'procs_restraint': None,
                                  'csp_restraint': None,
                                  'auto_relax_restraint': None,
                                  'heteronucl_noe_data': None,
                                  'heteronucl_t1_data': None,
                                  'heteronucl_t2_data': None,
                                  'heteronucl_t1r_data': None,
                                  'order_param_data': None,
                                  'ph_titr_data': None,
                                  'ph_param_data': None,
                                  'coupling_const_data': None,
                                  'ccr_d_csa_restraint': None,
                                  'ccr_dd_restraint': None,
                                  'fchiral_restraint': None,
                                  'saxs_restraint': None,
                                  'other_restraint': None
                                  },
                          'nmr-star': {'entry_info': None,
                                       'poly_seq': None,
                                       'entity': None,
                                       'chem_shift': None,
                                       'chem_shift_ref': None,
                                       'dist_restraint': ['Constraint_type', 'Potential_type'],
                                       'dihed_restraint': ['Constraint_type', 'Potential_type'],
                                       'rdc_restraint': ['Constraint_type', 'Potential_type'],
                                       'spectral_peak': ['Experiment_type'],
                                       'spectral_peak_alt': ['Experiment_type'],
                                       'noepk_restraint': None,
                                       'jcoup_restraint': None,
                                       'rdc_raw_data': None,
                                       'csa_restraint': None,
                                       'ddc_restraint': None,
                                       'hvycs_restraint': None,
                                       'procs_restraint': None,
                                       'csp_restraint': None,
                                       'auto_relax_restraint': None,
                                       'heteronucl_noe_data': None,
                                       'heteronucl_t1_data': None,
                                       'heteronucl_t2_data': None,
                                       'heteronucl_t1r_data': None,
                                       'order_param_data': None,
                                       'ph_titr_data': None,
                                       'ph_param_data': None,
                                       'coupling_const_data': None,
                                       'ccr_d_csa_restraint': None,
                                       'ccr_dd_restraint': None,
                                       'fchiral_restraint': None,
                                       'saxs_restraint': None,
                                       'other_restraint': None
                                       }
                          }

# allowed saveframe tags
SF_ALLOWED_TAGS = {'nef': {'entry_info': ['sf_category', 'sf_framecode', 'format_name', 'format_version',
                                          'program_name', 'program_version', 'creation_date', 'uuid', 'coordinate_file_name'],
                           'poly_seq': ['sf_category', 'sf_framecode'],
                           'entity': None,
                           'chem_shift': ['sf_category', 'sf_framecode'],
                           'chem_shift_ref': None,
                           'dist_restraint': ['sf_category', 'sf_framecode', 'potential_type', 'restraint_origin'],
                           'dihed_restraint': ['sf_category', 'sf_framecode', 'potential_type', 'restraint_origin'],
                           'rdc_restraint': ['sf_category', 'sf_framecode', 'potential_type', 'restraint_origin',
                                             'tensor_magnitude', 'tensor_rhombicity', 'tensor_chain_code',
                                             'tensor_sequence_code', 'tensor_residue_name'],
                           'spectral_peak': ['sf_category', 'sf_framecode', 'num_dimensions', 'chemical_shift_list',
                                             'experiment_classification', 'experiment_type'],
                           'spectral_peak_alt': None,
                           'noepk_restraint': None,
                           'jcoup_restraint': None,
                           'rdc_raw_data': None,
                           'csa_restraint': None,
                           'ddc_restraint': None,
                           'hvycs_restraint': None,
                           'procs_restraint': None,
                           'csp_restraint': None,
                           'auto_relax_restraint': None,
                           'heteronucl_noe_data': None,
                           'heteronucl_t1_data': None,
                           'heteronucl_t2_data': None,
                           'heteronucl_t1r_data': None,
                           'order_param_data': None,
                           'ph_titr_data': None,
                           'ph_param_data': None,
                           'coupling_const_data': None,
                           'ccr_d_csa_restraint': None,
                           'ccr_dd_restraint': None,
                           'fchiral_restraint': None,
                           'saxs_restraint': None,
                           'other_restraint': None
                           },
                   'nmr-star': {'entry_info': ['Sf_category', 'Sf_framecode', 'Sf_ID', 'ID', 'Title', 'Type',
                                               'Version_type', 'Submission_date', 'Accession_date', 'Last_release_date',
                                               'Original_release_date', 'Origination',
                                               'Format_name', 'NMR_STAR_version', 'Original_NMR_STAR_version',
                                               'Experimental_method', 'Experimental_method_subtype',
                                               'Source_data_format', 'Source_data_format_version',
                                               'Generated_software_name', 'Generated_software_version', 'Generated_software_ID',
                                               'Generated_software_label', 'Generated_date',
                                               'DOI', 'UUID', 'Related_coordinate_file_name', 'Dep_release_code_coordinates',
                                               'Dep_release_code_nmr_constraints', 'Dep_release_code_chemical_shifts',
                                               'Dep_release_code_nmr_exptl', 'Dep_release_code_sequence',
                                               'CASP_target', 'Details', 'Special_processing_instructions',
                                               'Update_BMRB_accession_code', 'Replace_BMRB_accession_code',
                                               'Update_PDB_accession_code', 'Replace_PDB_accession_code',
                                               'PDB_coordinate_file_version', 'BMRB_update_details',
                                               'PDB_update_details', 'Release_request',
                                               'Release_date_request', 'Release_date_justification',
                                               'Status_code', 'Recvd_deposit_form', 'Date_deposition_form',
                                               'Recvd_coordinates', 'Date_coordinates', 'Recvd_nmr_constraints',
                                               'Date_nmr_constraints', 'Recvd_chemical_shifts', 'Date_chemical_shifts',
                                               'Recvd_manuscript', 'Date_manuscript', 'Recvd_author_approval',
                                               'Date_author_approval', 'Recvd_initial_deposition_date', 'PDB_date_submitted',
                                               'Author_release_status_code', 'Date_of_PDB_release', 'Date_hold_coordinates',
                                               'Date_hold_nmr_constraints', 'Date_hold_chemical_shifts',
                                               'PDB_deposit_site', 'PDB_process_site', 'BMRB_deposit_site', 'BMRB_process_site',
                                               'BMRB_annotator', 'BMRB_internal_directory_name', 'RCSB_annotator',
                                               'Author_approval_type', 'Assigned_BMRB_ID', 'Assigned_BMRB_deposition_code',
                                               'Assigned_PDB_ID', 'Assigned_PDB_deposition_code', 'Assigned_restart_ID',
                                               'NMR_STAR_dict_location'],
                                'poly_seq': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name', 'BMRB_code',
                                             'Number_of_components', 'Organic_ligands', 'Metal_ions', 'Non_standard_bonds',
                                             'Ambiguous_conformational_states', 'Ambiguous_chem_comp_sites',
                                             'Molecules_in_chemical_exchange', 'Paramagnetic', 'Thiol_state', 'Molecular_mass',
                                             'Enzyme_commission_number', 'Details', 'DB_query_date', 'DB_query_revised_last_date'],
                                'entity': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'BMRB_code', 'Name',
                                           'Type', 'Polymer_common_type', 'Polymer_type', 'Polymer_type_details',
                                           'Polymer_strand_ID', 'Polymer_seq_one_letter_code_can', 'Polymer_seq_one_letter_code',
                                           'Target_identifier', 'Polymer_author_defined_seq', 'Polymer_author_seq_details',
                                           'Ambiguous_conformational_states', 'Ambiguous_chem_comp_sites',
                                           'Nstd_monomer', 'Nstd_chirality', 'Nstd_linkage', 'Nonpolymer_comp_ID',
                                           'Nonpolymer_comp_label', 'Number_of_monomers', 'Number_of_nonpolymer_components',
                                           'Paramagnetic', 'Thiol_state', 'Src_method', 'Parent_entity_ID', 'Fragment', 'Mutation',
                                           'EC_number', 'Calc_isoelectric_point', 'Formula_weight', 'Formula_weight_exptl',
                                           'Formula_weight_exptl_meth', 'Details', 'DB_query_date', 'DB_query_revised_last_date'],
                                'chem_shift': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name', 'Data_file_name',
                                               'Sample_condition_list_ID', 'Sample_condition_list_label', 'Chem_shift_reference_ID',
                                               'Chem_shift_reference_label',
                                               'Chem_shift_1H_err', 'Chem_shift_13C_err', 'Chem_shift_15N_err',
                                               'Chem_shift_31P_err', 'Chem_shift_2H_err', 'Chem_shift_19F_err',
                                               'Error_derivation_method', 'Details', 'Text_data_format', 'Text_data'],
                                'chem_shift_ref': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                   'Proton_shifts_flag', 'Carbon_shifts_flag', 'Nitrogen_shifts_flag',
                                                   'Phosphorus_shifts_flag', 'Other_shifts_flag', 'Details'],
                                'dist_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                   'Data_file_name', 'Constraint_type', 'Constraint_file_ID', 'Potential_type',
                                                   'Block_ID', 'Details', 'Text_data_format', 'Text_data'],
                                'dihed_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID',
                                                    'Name', 'Data_file_name', 'Constraint_file_ID',
                                                    'Potential_type', 'Constraint_type',
                                                    'Block_ID', 'Details', 'Text_data_format', 'Text_data'],
                                'rdc_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID',
                                                  'Name', 'Data_file_name', 'Constraint_file_ID', 'Block_ID', 'Potential_type',
                                                  'Constraint_type',
                                                  'Tensor_entity_assembly_ID', 'Tensor_comp_index_ID', 'Tensor_seq_ID',
                                                  'Tensor_comp_ID', 'Tensor_auth_entity_assembly_ID', 'Tensor_auth_asym_ID',
                                                  'Tensor_auth_seq_ID', 'Tensor_auth_comp_ID',
                                                  'Dipolar_constraint_calib_method', 'Tensor_magnitude', 'Tensor_rhombicity',
                                                  'Mol_align_tensor_axial_sym_mol', 'Mol_align_tensor_rhombic_mol',
                                                  'General_order_param_int_motions',
                                                  'Bond_length_usage_flag', 'Assumed_H_N_bond_length', 'Assumed_H_C_bond_length',
                                                  'Assumed_C_N_bond_length', 'Data_file_format',
                                                  'Details', 'Text_data_format', 'Text_data'],
                                'spectral_peak': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                  'Data_file_name', 'Sample_ID', 'Sample_label', 'Sample_condition_list_ID',
                                                  'Sample_condition_list_label', 'Experiment_ID', 'Experiment_name',
                                                  'Experiment_class', 'Experiment_type', 'Number_of_spectral_dimensions',
                                                  'Chemical_shift_list', 'Assigned_chem_shift_list_ID',
                                                  'Assigned_chem_shift_list_label',
                                                  'Details', 'Text_data_format', 'Text_data',
                                                  'Chem_shift_reference_ID', 'Chem_shift_reference_label'],
                                'spectral_peak_alt': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                      'Data_file_name', 'Sample_ID', 'Sample_label', 'Sample_condition_list_ID',
                                                      'Sample_condition_list_label',
                                                      'Experiment_ID', 'Experiment_name', 'Experiment_class', 'Experiment_type',
                                                      'Number_of_spectral_dimensions', 'Chemical_shift_list',
                                                      'Assigned_chem_shift_list_ID', 'Assigned_chem_shift_list_label',
                                                      'Details', 'Text_data_format', 'Text_data',
                                                      'Chem_shift_reference_ID', 'Chem_shift_reference_label'],
                                'noepk_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                    'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                    'Homonuclear_NOE_val_type', 'NOE_ref_val', 'NOE_ref_description',
                                                    'Details', 'Text_data_format', 'Text_data'],
                                'jcoup_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                    'Data_file_name', 'Data_file_format', 'Constraint_file_ID', 'Block_ID',
                                                    'Text_data_format', 'Text_data', 'Details'],
                                'rdc_raw_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                 'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                 'Spectrometer_frequency_1H', 'Bond_length_usage_flag',
                                                 'Dipolar_constraint_calib_method', 'Mol_align_tensor_axial_sym_mol',
                                                 'Mol_align_tensor_rhombic_mol', 'General_order_param_int_motions',
                                                 'Assumed_H_N_bond_length', 'Assumed_H_C_bond_length', 'Assumed_C_N_bond_length',
                                                 'Details', 'Text_data_format', 'Text_data'],
                                'csa_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                  'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                  'Spectrometer_frequency_1H', 'Val_units',
                                                  'Details', 'Text_data_format', 'Text_data'],
                                'ddc_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                  'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                  'Spectrometer_frequency_1H', 'Scaling_factor', 'Fitting_procedure',
                                                  'Details', 'Text_data_format', 'Text_data'],
                                'hvycs_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                    'Data_file_name', 'Data_file_format',
                                                    'Constraint_file_ID', 'Block_ID', 'Units',
                                                    'Details', 'Text_data_format', 'Text_data'],
                                'procs_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name', 'Units',
                                                    'Data_file_name', 'Data_file_format',
                                                    'Constraint_file_ID', 'Block_ID', 'Details', 'Text_data_format', 'Text_data'],
                                'csp_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name', 'Type',
                                                  'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                  'Chem_shift_ref_set_ID', 'Chem_shift_ref_set_label',
                                                  'Details', 'Text_data_format', 'Text_data'],
                                'auto_relax_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                         'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',  # noqa: E501, pylint: disable=line-too-long
                                                         'Temp_calibration_method', 'Temp_control_method',
                                                         'Spectrometer_frequency_1H', 'Exact_field_strength',
                                                         'Common_relaxation_type_name', 'Relaxation_coherence_type',
                                                         'Relaxation_val_units', 'Rex_units', 'Rex_field_strength',
                                                         'Details', 'Text_data_format', 'Text_data'],
                                'heteronucl_noe_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                        'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                        'Spectrometer_frequency_1H', 'Heteronuclear_NOE_val_type',
                                                        'NOE_ref_val', 'NOE_ref_description',
                                                        'Details', 'Text_data_format', 'Text_data'],
                                'heteronucl_t1_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                       'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                       'Spectrometer_frequency_1H', 'T1_coherence_type', 'T1_val_units',
                                                       'Details', 'Text_data_format', 'Text_data'],
                                'heteronucl_t2_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                       'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                       'Temp_calibration_method', 'Temp_control_method',
                                                       'Spectrometer_frequency_1H', 'T2_coherence_type', 'T2_val_units',
                                                       'Rex_units', 'Details', 'Text_data_format', 'Text_data'],
                                'heteronucl_t1r_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                        'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                        'Temp_calibration_method', 'Temp_control_method',
                                                        'Spectrometer_frequency_1H', 'T1rho_coherence_type', 'T1rho_val_units',
                                                        'Rex_units', 'Details', 'Text_data_format', 'Text_data'],
                                'order_param_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                     'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                     'Tau_e_val_units', 'Tau_f_val_units', 'Tau_s_val_units',
                                                     'Rex_field_strength', 'Rex_val_units',
                                                     'Details', 'Text_data_format', 'Text_data'],
                                'ph_titr_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name', 'Data_file_name',
                                                 'Sample_condition_list_ID', 'Sample_condition_list_label', 'Expt_observed_param',
                                                 'Details', 'Text_data_format', 'Text_data'],
                                'ph_param_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                  'PH_titration_list_ID', 'PH_titration_list_label',
                                                  'Observed_NMR_param', 'Data_file_name',
                                                  'Details', 'Text_data_format', 'Text_data'],
                                'coupling_const_data': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                        'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                        'Spectrometer_frequency_1H',
                                                        'Details', 'Text_data_format', 'Text_data'],
                                'ccr_d_csa_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                        'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                        'Spectrometer_frequency_1H', 'Val_units',
                                                        'Details', 'Text_data_format', 'Text_data'],
                                'ccr_dd_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                     'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                     'Spectrometer_frequency_1H', 'Val_units',
                                                     'Details', 'Text_data_format', 'Text_data'],
                                'fchiral_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                      'Data_file_name', 'Details', 'Stereo_count', 'Stereo_assigned_count'],
                                'saxs_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name',
                                                   'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                   'Details', 'Text_data_format', 'Text_data'],
                                'other_restraint': ['Sf_category', 'Sf_framecode', 'Entry_ID', 'Sf_ID', 'ID', 'Name', 'Definition',
                                                    'Data_file_name', 'Sample_condition_list_ID', 'Sample_condition_list_label',
                                                    'Details', 'Text_data_format', 'Text_data']
                                }
                   }

# warning template for missing mandatory saveframe tag
WARN_TEMPLATE_FOR_MISSING_MANDATORY_SF_TAG = "The mandatory saveframe tag %r is missing. "\
    "Please verify the value and re-upload the %s file."

# auxiliary loop categories
AUX_LP_CATEGORIES = {'nef': {'entry_info': None,
                             'poly_seq': ['_nef_covalent_links', '_nef_sequence'],
                             'entity': None,
                             'chem_shift': None,
                             'chem_shift_ref': None,
                             'dist_restraint': None,
                             'dihed_restraint': None,
                             'rdc_restraint': None,
                             'spectral_peak': ['_nef_spectrum_dimension', '_nef_spectrum_dimension_transfer'],
                             'spectral_peak_alt': None,
                             'noepk_restraint': None,
                             'jcoup_restraint': None,
                             'rdc_raw_data': None,
                             'csa_restraint': None,
                             'ddc_restraint': None,
                             'hvycs_restraint': None,
                             'procs_restraint': None,
                             'csp_restraint': None,
                             'auto_relax_restraint': None,
                             'heteronucl_noe_data': None,
                             'heteronucl_t1_data': None,
                             'heteronucl_t2_data': None,
                             'heteronucl_t1r_data': None,
                             'order_param_data': None,
                             'ph_titr_data': None,
                             'ph_param_data': None,
                             'coupling_const_data': None,
                             'ccr_d_csa_restraint': None,
                             'ccr_dd_restraint': None,
                             'fchiral_restraint': None,
                             'saxs_restraint': None,
                             'other_restraint': None
                             },
                     'nmr-star': {'entry_info': None,
                                  'poly_seq': ['_Bond', '_Entity_deleted_atom', '_Entity_assembly'],
                                  'entity': ['_Entity_poly_seq'],
                                  'chem_shift': ['_Ambiguous_atom_chem_shift'],
                                  'chem_shift_ref': None,
                                  'dist_restraint': None,
                                  'dihed_restraint': None,
                                  'rdc_restraint': None,
                                  'spectral_peak': ['_Spectral_dim', '_Spectral_dim_transfer'],
                                  'spectral_peak_alt': ['_Spectral_dim', '_Spectral_dim_transfer',
                                                        '_Peak', '_Peak_general_char', '_Peak_char', '_Assigned_peak_chem_shift'],
                                  'noepk_restraint': None,
                                  'jcoup_restraint': None,
                                  'rdc_raw_data': None,
                                  'csa_restraint': None,
                                  'ddc_restraint': None,
                                  'hvycs_restraint': None,
                                  'procs_restraint': None,
                                  'csp_restraint': None,
                                  'auto_relax_restraint': None,
                                  'heteronucl_noe_data': None,
                                  'heteronucl_t1_data': None,
                                  'heteronucl_t2_data': None,
                                  'heteronucl_t1r_data': None,
                                  'order_param_data': None,
                                  'ph_titr_data': None,
                                  'ph_param_data': None,
                                  'coupling_const_data': None,
                                  'ccr_d_csa_restraint': None,
                                  'ccr_dd_restraint': None,
                                  'fchiral_restraint': None,
                                  'saxs_restraint': None,
                                  'other_restraint': None
                                  }
                     }

# linked loop categories
LINKED_LP_CATEGORIES = {'nef': {'entry_info': ['_nef_related_entries', '_nef_program_script', '_nef_run_history', '_audit'],
                                'poly_seq': ['_nef_covalent_links', '_nef_sequence'],
                                'entity': [],
                                'chem_shift': ['_nef_chemical_shift'],
                                'chem_shift_ref': [],
                                'dist_restraint': ['_nef_distance_restraint'],
                                'dihed_restraint': ['_nef_dihedral_restraint'],
                                'rdc_restraint': ['_nef_rdc_restraint'],
                                'spectral_peak': ['_nef_spectrum_dimension', '_nef_spectrum_dimension_transfer', '_nef_peak'],
                                'spectral_peak_alt': [],
                                'noepk_restraint': [],
                                'jcoup_restraint': [],
                                'rdc_raw_data': [],
                                'csa_restraint': [],
                                'ddc_restraint': [],
                                'hvycs_restraint': [],
                                'procs_restraint': [],
                                'csp_restraint': [],
                                'auto_relax_restraint': [],
                                'heteronucl_noe_data': [],
                                'heteronucl_t1_data': [],
                                'heteronucl_t2_data': [],
                                'heteronucl_t1r_data': [],
                                'order_param_data': [],
                                'ph_titr_data': [],
                                'ph_param_data': [],
                                'coupling_const_data': [],
                                'ccr_d_csa_restraint': [],
                                'ccr_dd_restraint': [],
                                'fchiral_restraint': [],
                                'saxs_restraint': [],
                                'other_restraint': []
                                },
                        'nmr-star': {'entry_info': ['_Study_list', '_Entry_experimental_methods', '_Entry_author',
                                                    '_SG_project', '_Entry_src', '_Struct_keywords', '_Data_set',
                                                    '_Datum', '_Release', '_Related_entries', '_Matched_entries',
                                                    '_Auxiliary_files', '_Citation',
                                                    '_Assembly', '_Assembly_annotation_list', '_Assembly_subsystem',
                                                    '_Entity', '_Entity_natural_src_list', '_Entity_natural_src',
                                                    '_Entity_experimental_src_list', '_Chem_comp', '_Chem_comp_atom',
                                                    '_Sample', '_Sample_condition_list', '_Entity_purity_list', '_Software',
                                                    '_Method', '_Mass_spec', '_Mass_spectrometer_list', '_Mass_spec_ref_compd_set',
                                                    '_Chromatographic_system', '_Chromatographic_column',
                                                    '_Fluorescence_instrument', '_EMR_instrument', '_Xray_instrument',
                                                    '_NMR_spectrometer', '_NMR_spectrometer_list', '_NMR_spectrometer_probe',
                                                    '_Experiment_list', '_NMR_spec_expt', '_NMR_spectral_processing',
                                                    '_MS_expt', '_MS_expt_param', '_MS_expt_software',
                                                    '_Computer', '_Chem_shift_reference', '_Assigned_chem_shift_list',
                                                    '_Chem_shifts_calc_type',
                                                    '_Theoretical_chem_shift_list', '_Theoretical_chem_shift',
                                                    '_Coupling_constant_list', '_Theoretical_coupling_constant_list',
                                                    '_Spectral_peak_list', '_Resonance_linker_list', '_Resonance_assignment',
                                                    '_Chem_shift_isotope_effect_list', '_Chem_shift_perturbation_list',
                                                    '_Chem_shift_anisotropy',
                                                    '_RDC_list', '_RDC_experiment', '_RDC_software', '_RDC',
                                                    '_Dipolar_coupling_list', '_Dipolar_coupling_experiment',
                                                    '_Dipolar_coupling_software', '_Dipolar_coupling',
                                                    '_Spectral_density_list', '_Spectral_density_experiment',
                                                    '_Spectral_density_software', '_Spectral_density', '_Other_data_type_list',
                                                    '_Other_data_experiment', '_Other_data_software', '_Other_data',
                                                    '_Chemical_rate_list', '_Chemical_rate_experiment', '_Chemical_rate_software',
                                                    '_Chemical_rate',
                                                    '_H_exch_rate_list', '_H_exch_rate_experiment',
                                                    '_H_exch_rate_software', '_H_exch_rate',
                                                    '_H_exch_protection_factor_list', '_H_exch_protection_fact_experiment',
                                                    '_H_exch_protection_fact_software', '_H_exch_protection_factor',
                                                    '_Homonucl_NOE_list', '_Homonucl_NOE_experiment', '_Homonucl_NOE_software',
                                                    '_Homonucl_NOE', '_Heteronucl_NOE_list', '_Heteronucl_NOE_experiment',
                                                    '_Heteronucl_NOE_software', '_Heteronucl_NOE',
                                                    '_Theoretical_heteronucl_NOE_list', '_Theoretical_heteronucl_NOE_experiment',
                                                    '_Theoretical_heteronucl_NOE_software', '_Theoretical_heteronucl_NOE',
                                                    '_Heteronucl_T1_list', '_Heteronucl_T1_experiment', '_Heteronucl_T1_software',
                                                    '_T1',
                                                    '_Theoretical_heteronucl_T1_list', '_Theoretical_heteronucl_T1_experiment',
                                                    '_Theoretical_heteronucl_T1_software', '_Theoretical_T1',
                                                    '_Heteronucl_T1rho_list', '_Heteronucl_T1rho_experiment',
                                                    '_Heteronucl_T1rho_software', '_T1rho',
                                                    '_Heteronucl_T2_list', '_Heteronucl_T2_experiment', '_Heteronucl_T2_software',
                                                    '_T2',
                                                    '_Theoretical_heteronucl_T2_list', '_Theoretical_heteronucl_T2_experiment',
                                                    '_Theoretical_heteronucl_T2_software', '_Theoretical_T2',
                                                    '_Auto_relaxation_list', '_Auto_relaxation_experiment',
                                                    '_Auto_relaxation_software', '_Auto_relaxation',
                                                    '_Theoretical_auto_relaxation_list', '_Theoretical_auto_relaxation_experiment',
                                                    '_Theoretical_auto_relaxation_software', '_Theoretical_auto_relaxation',
                                                    '_Dipole_dipole_relax_list', '_Dipole_dipole_relax_experiment',
                                                    '_Dipole_dipole_relax_software', '_Dipole_dipole_relax',
                                                    '_Cross_correlation_DD_list', '_Cross_correlation_DD_experiment',
                                                    '_Cross_correlation_DD_software', '_Cross_correlation_DD',
                                                    '_Theoretical_cross_correlation_DD_list',
                                                    '_Theoretical_cross_correlation_DD_experiment',
                                                    '_Theoretical_cross_correlation_DD_software',
                                                    '_Theoretical_cross_correlation_DD',
                                                    '_Cross_correlation_D_CSA_list', '_Cross_correlation_D_CSA_experiment',
                                                    '_Cross_correlation_D_CSA_software',
                                                    '_Cross_correlation_D_CSA', '_Order_parameter_list',
                                                    '_Order_parameter_experiment', '_Order_parameter_software', '_Order_param',
                                                    '_PH_titration_list', '_PH_titration_experiment', '_PH_titration_software',
                                                    '_PH_titr_result', '_PH_param_list', '_PH_param',
                                                    '_D_H_fractionation_factor_list', '_D_H_fract_factor_experiment',
                                                    '_D_H_fract_factor_software', '_D_H_fractionation_factor',
                                                    '_Binding_value_list', '_Binding_experiment', '_Binding_software',
                                                    '_Binding_result', '_Binding_partners', '_Binding_param_list', '_Binding_param',
                                                    '_Deduced_secd_struct_list', '_Deduced_secd_struct_experiment',
                                                    '_Deduced_secd_struct_software', '_Deduced_secd_struct_exptl',
                                                    '_Deduced_secd_struct_feature', '_Deduced_H_bond_list',
                                                    '_Deduced_H_bond_experiment', '_Deduced_H_bond_software', '_Deduced_H_bond',
                                                    '_Conformer_stat_list', '_Conformer_stat_list_ens',
                                                    '_Conformer_stat_list_rep', '_Conf_stats_software',
                                                    '_Conformer_family_coord_set', '_Conformer_family_refinement',
                                                    '_Conformer_family_software', '_Energetic_penalty_function',
                                                    '_Conformer_family_coord_set_expt', '_Conf_family_coord_set_constr_list',
                                                    '_Struct_image', '_Local_structure_quality', '_Model_type',
                                                    '_Atom_site', '_Atom_sites_footnote',
                                                    '_Representative_conformer', '_Rep_conf_refinement', '_Rep_conf_software',
                                                    '_Terminal_residue',
                                                    '_Rep_conf', '_Rep_coordinate_details',
                                                    '_Constraint_stat_list', '_Constraint_stat_list_ens',
                                                    '_Constraint_stat_list_rep', '_Constraint_stats_constr_list',
                                                    '_Constraint_file',
                                                    '_Force_constant_list', '_Force_constant_software',
                                                    '_Force_constant', '_Angular_order_parameter_list', '_Angular_order_param',
                                                    '_Tertiary_struct_element_list', '_Tertiary_struct_element_sel',
                                                    '_Tertiary_struct',
                                                    '_Structure_annotation', '_Struct_anno_software', '_Struct_classification',
                                                    '_Struct_anno_char',
                                                    '_Secondary_struct_list', '_Secondary_struct_sel', '_Secondary_struct',
                                                    '_Bond_annotation_list', '_Bond_annotation', '_Bond_observed_conformer',
                                                    '_Structure_interaction_list', '_Structure_interaction', '_Observed_conformer',
                                                    '_Other_struct_feature_list', '_Other_struct_feature', '_Tensor_list',
                                                    '_Interatomic_distance_list', '_Interatomic_dist',
                                                    '_Gen_dist_constraint_list', '_Gen_dist_constraint_expt',
                                                    '_Gen_dist_constraint_software', '_Gen_dist_constraint_software_param',
                                                    '_Gen_dist_constraint',
                                                    '_Gen_dist_constraint_comment_org', '_Gen_dist_constraint_parse_err',
                                                    '_Gen_dist_constraint_parse_file', '_Gen_dist_constraint_conv_err',
                                                    '_Distance_constraint_list', '_Distance_constraint_expt',
                                                    '_Distance_constraint_software', '_Dist_constr_software_setting',
                                                    '_Dist_constraint_tree', '_Dist_constraint',
                                                    '_Dist_constraint_value', '_Dist_constraint_comment_org',
                                                    '_Dist_constraint_parse_err',
                                                    '_Dist_constraint_parse_file', '_Dist_constraint_conv_err',
                                                    '_Floating_chirality_assign', '_Floating_chirality_software',
                                                    '_Floating_chirality',
                                                    '_Torsion_angle_constraint_list', '_Torsion_angle_constraints_expt',
                                                    '_Torsion_angle_constraint_software',
                                                    '_Karplus_equation', '_Torsion_angle_constraint',
                                                    '_TA_constraint_comment_org', '_TA_constraint_parse_err',
                                                    '_TA_constraint_parse_file', '_TA_constraint_conv_err',
                                                    '_RDC_constraint_list', '_RDC_constraint_expt', '_RDC_constraint_software',
                                                    '_RDC_constraint',
                                                    '_RDC_constraint_comment_org', '_RDC_constraint_parse_err',
                                                    '_RDC_constraint_parse_file', '_RDC_constraint_conv_err',
                                                    '_J_three_bond_constraint_list', '_J_three_bond_constraint_expt',
                                                    '_J_three_bond_constraint_software',
                                                    '_J_three_bond_constraint', '_CA_CB_constraint_list', '_CA_CB_constraint_expt',
                                                    '_CA_CB_constraint_software', '_CA_CB_constraint',
                                                    '_H_chem_shift_constraint_list', '_H_chem_shift_constraint_expt',
                                                    '_H_chem_shift_constraint_software', '_H_chem_shift_constraint',
                                                    '_Peak_constraint_link_list', '_Peak_constraint_link',
                                                    '_SAXS_constraint_list', '_SAXS_constraint_expt', '_SAXS_constraint_software',
                                                    '_SAXS_constraint',
                                                    '_Other_constraint_list', '_Other_constraint_expt',
                                                    '_Other_constraint_software', '_Org_constr_file_comment',
                                                    '_MZ_ratio_data_list', '_MZ_ratio_experiment', '_MZ_ratio_software',
                                                    '_MZ_ratio_spectrum_param', '_MZ_precursor_ion', '_MZ_precursor_ion_annotation',
                                                    '_MZ_product_ion', '_MZ_product_ion_annotation',
                                                    '_MS_chromatogram_list', '_MS_chromatogram_experiment',
                                                    '_MS_chromatogram_software', '_MS_chromatogram_param',
                                                    '_MS_chromatogram_ion', '_MS_chrom_ion_annotation',
                                                    '_Software_specific_info_list', '_Software_specific_info',
                                                    '_Software_applied_list',
                                                    '_Software_applied_methods', '_Software_applied_history',
                                                    '_History', '_Audit'],
                                     'poly_seq': ['_Assembly_type', '_Entity_assembly', '_Bond', '_Entity_deleted_atom',
                                                  '_Struct_asym', '_Assembly_db_link', '_Assembly_common_name',
                                                  '_Assembly_systematic_name', '_Assembly_interaction', '_Chem_comp_assembly',
                                                  '_PDBX_poly_seq_scheme', '_PDBX_nonpoly_scheme', '_Atom_type', '_Atom',
                                                  '_Assembly_bio_function', '_Angle', '_Torsion_angle',
                                                  '_Assembly_segment', '_Assembly_segment_description', '_Assembly_keyword',
                                                  '_Assembly_citation', '_Author_annotation', '_Sample_component',
                                                  '_Chemical_rate', '_Auto_relaxation', '_Theoretical_auto_relaxation',
                                                  '_Binding_result', '_Binding_partners', '_Struct_anno_char'],
                                     'entity': ['_Entity_db_link', '_Entity_biological_function',
                                                '_Entity_common_name', '_Entity_systematic_name',
                                                '_Entity_keyword', '_Entity_comp_index', '_Entity_poly_seq',
                                                '_Entity_chimera_segment', '_Entity_comp_index_alt',
                                                '_Entity_atom_list', '_Entity_chem_comp_deleted_atom',
                                                '_Entity_bond', '_Entity_citation'],
                                     'chem_shift': ['_Chem_shift_experiment', '_Systematic_chem_shift_offset',
                                                    '_Chem_shift_software', '_Atom_chem_shift', '_Ambiguous_atom_chem_shift',
                                                    '_Spectral_peak_list', '_Assigned_peak_chem_shift',
                                                    '_Assigned_spectral_transition'],
                                     'chem_shift_ref': ['_Chem_shift_ref', '_Assigned_chem_shift_list', '_Chem_shifts_calc_type'],
                                     'dist_restraint': ['_Gen_dist_constraint_expt', '_Gen_dist_constraint_software',
                                                        '_Gen_dist_constraint_software_param', '_Gen_dist_constraint',
                                                        '_Gen_dist_constraint_comment_org', '_Gen_dist_constraint_parse_err',
                                                        '_Gen_dist_constraint_parse_file', '_Gen_dist_constraint_conv_err'],
                                     'dihed_restraint': ['_Torsion_angle_constraints_expt', '_Torsion_angle_constraint_software',
                                                         '_Karplus_equation', '_Torsion_angle_constraint',
                                                         '_TA_constraint_comment_org', '_TA_constraint_parse_err',
                                                         '_TA_constraint_parse_file', '_TA_constraint_conv_err'],
                                     'rdc_restraint': ['_RDC_constraint_expt', '_RDC_constraint_software', '_RDC_constraint',
                                                       '_RDC_constraint_comment_org', '_RDC_constraint_parse_err',
                                                       '_RDC_constraint_parse_file', '_RDC_constraint_conv_err'],
                                     'spectral_peak': ['_Spectral_dim', '_Spectral_dim_transfer', '_Spectral_peak_software',
                                                       '_Peak', '_Peak_general_char', '_Peak_char', '_Assigned_peak_chem_shift',
                                                       '_Peak_row_format', '_Spectral_transition',
                                                       '_Spectral_transition_general_char', '_Spectral_transition_char',
                                                       '_Assigned_spectral_transition',
                                                       '_Gen_dist_constraint', '_Dist_constraint_value'],
                                     'spectral_peak_alt': ['_Spectral_dim', '_Spectral_dim_transfer', '_Spectral_peak_software',
                                                           '_Peak', '_Peak_general_char', '_Peak_char', '_Assigned_peak_chem_shift',
                                                           '_Peak_row_format', '_Spectral_transition',
                                                           '_Spectral_transition_general_char', '_Spectral_transition_char',
                                                           '_Assigned_spectral_transition', '_Gen_dist_constraint',
                                                           '_Dist_constraint_value'],
                                     'noepk_restraint': ['Homonucl_NOE_experiment', 'Homonucl_NOE_software', 'Homonucl_NOE'],
                                     'jcoup_restraint': ['J_three_bond_constraint_expt', 'J_three_bond_constraint_software',
                                                         'J_three_bond_constraint'],
                                     'rdc_raw_data': ['RDC_experiment', 'RDC_software', 'RDC'],
                                     'csa_restraint': ['CS_anisotroty_experiment', 'CS_anisotroty_software', 'CS_anisotroty'],
                                     'ddc_restraint': ['Dipolar_coupling_experiment', 'Dipolar_coupling_software',
                                                       'Dipolar_coupling'],
                                     'hvycs_restraint': ['CA_CB_constraint_expt', 'CA_CB_constraint_software', 'CA_CB_constraint'],
                                     'procs_restraint': ['H_chem_shift_constraint_expt', 'H_chem_shift_constraint_software',
                                                         'H_chem_shift_constraint'],
                                     'csp_restraint': ['Chem_shift_perturbation_experiment', 'Chem_shift_perturbation_software',
                                                       'Chem_shift_perturbation'],
                                     'auto_relax_restraint': ['Auto_relaxation_experiment', 'Auto_relaxation_software',
                                                              'Auto_relaxation'],
                                     'heteronucl_noe_data': ['Heteronucl_NOE_experiment', 'Heteronucl_NOE_software',
                                                             'Heteronucl_NOE'],
                                     'heteronucl_t1_data': ['Heteronucl_T1_experiment', 'Heteronucl_T1_software', 'T1'],
                                     'heteronucl_t2_data': ['Heteronucl_T2_experiment', 'Heteronucl_T2_software', 'T2'],
                                     'heteronucl_t1r_data': ['Heteronucl_T1rho_experiment', 'Heteronucl_T1rho_software', 'T1rho'],
                                     'order_param_data': ['Order_parameter_experiment', 'Order_parameter_software', 'Order_param'],
                                     'ph_titr_data': ['PH_titration_experiment', 'PH_titration_software', 'PH_titr_result'],
                                     'ph_param_data': ['PH_param_list'],
                                     'coupling_const_data': ['Coupling_constant'],
                                     'ccr_d_csa_restraint': ['Cross_correlation_D_CSA_experiment',
                                                             'Cross_correlation_D_CSA_software', 'Cross_correlation_D_CSA'],
                                     'ccr_dd_restraint': ['Cross_correlation_DD_experiment', 'Cross_correlation_DD_software',
                                                          'Cross_correlation_DD'],
                                     'fchiral_restraint': ['Floating_chirality_software', 'Floating_chirality'],
                                     'saxs_restraint': ['SAXS_constraint_expt', 'SAXS_constraint_software', 'SAXS_constraint'],
                                     'other_restraint': ['Other_data_experiment', 'Other_data_software', 'Other_data']
                                     }
                        }

# auxiliary loop key items
AUX_KEY_ITEMS = {'nef': {'entry_info': None,
                         'poly_seq': {
                             '_nef_covalent_links': [{'name': 'chain_code_1', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                     {'name': 'sequence_code_1', 'type': 'int'},
                                                     {'name': 'residue_name_1', 'type': 'str', 'uppercase': True},
                                                     {'name': 'atom_name_1', 'type': 'str'},
                                                     {'name': 'chain_code_2', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                                     {'name': 'sequence_code_2', 'type': 'int'},
                                                     {'name': 'residue_name_2', 'type': 'str', 'uppercase': True},
                                                     {'name': 'atom_name_2', 'type': 'str'}
                                                     ],
                             '_nef_sequence': [{'name': 'chain_code', 'type': 'str', 'default': REPRESENTATIVE_ASYM_ID},
                                               {'name': 'sequence_code', 'type': 'int'},
                                               {'name': 'residue_name', 'type': 'str', 'uppercase': True}
                                               ]
                         },
                         'entity': None,
                         'chem_shift': None,
                         'chem_shift_ref': None,
                         'dist_restraint': None,
                         'dihed_restraint': None,
                         'rdc_restraint': None,
                         'spectral_peak': {
                             '_nef_spectrum_dimension': [{'name': 'dimension_id', 'type': 'index-int'}
                                                         ],
                             '_nef_spectrum_dimension_transfer': [{'name': 'dimension_1', 'type': 'positive-int'},
                                                                  {'name': 'dimension_2', 'type': 'positive-int'},
                                                                  ]
                         },
                         'spectral_peak_alt': None,
                         'noepk_restraint': None,
                         'jcoup_restraint': None,
                         'rdc_raw_data': None,
                         'csa_restraint': None,
                         'ddc_restraint': None,
                         'hvycs_restraint': None,
                         'procs_restraint': None,
                         'csp_restraint': None,
                         'auto_relax_restraint': None,
                         'heteronucl_noe_data': None,
                         'heteronucl_t1_data': None,
                         'heteronucl_t2_data': None,
                         'heteronucl_t1r_data': None,
                         'order_param_data': None,
                         'ph_titr_data': None,
                         'ph_param_data': None,
                         'coupling_const_data': None,
                         'ccr_d_csa_restraint': None,
                         'ccr_dd_restraint': None,
                         'fchiral_restraint': None,
                         'saxs_restraint': None,
                         'other_restraint': None
                         },
                 'nmr-star': {'entry_info': None,
                              'poly_seq': {
                                  '_Bond': [{'name': 'ID', 'type': 'index-int', 'mandatory': True, 'default-from': 'self'},
                                            {'name': 'Type', 'type': 'enum', 'mandatory': True, 'default': 'covalent',
                                             'enum': ('amide', 'covalent', 'directed', 'disulfide', 'ester', 'ether', 'hydrogen',
                                                      'metal coordination', 'peptide', 'thioether', 'oxime', 'thioester',
                                                      'phosphoester', 'phosphodiester', 'diselenide', 'na')},
                                            {'name': 'Value_order', 'type': 'enum', 'mandatory': True, 'default': 'sing',
                                             'enum': ('sing', 'doub', 'trip', 'quad', 'arom', 'poly', 'delo', 'pi', 'directed')},
                                            {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                             'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                            {'name': 'Comp_index_ID_1', 'type': 'int'},
                                            {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_1', 'type': 'str'},
                                            {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                             'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                            {'name': 'Comp_index_ID_2', 'type': 'int'},
                                            {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_2', 'type': 'str'}
                                            ],
                                  '_Entity_deleted_atom': [{'name': 'ID', 'type': 'index-int', 'mandatory': True,
                                                            'default-from': 'self'},
                                                           {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                            'default': '1', 'default-from': 'self'},
                                                           {'name': 'Comp_index_ID', 'type': 'int'},
                                                           {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                           {'name': 'Atom_ID', 'type': 'str'}
                                                           ],
                                  '_Entity_assembly': [{'name': 'ID', 'type': 'index-int', 'mandatory': True,
                                                        'default-from': 'self'},
                                                       {'name': 'Entity_assembly_name', 'type': 'str', 'mandatory': True},
                                                       {'name': 'Entity_ID', 'type': 'positive-int'},
                                                       {'name': 'Entity_label', 'type': 'str'}
                                                       ]
                              },
                              'entity': None,
                              'chem_shift': {
                                  '_Ambiguous_atom_chem_shift': [{'name': 'Ambiguous_shift_set_ID', 'type': 'positive-int',
                                                                  'mandatory': True,
                                                                  'default-from': 'self'},
                                                                 {'name': 'Atom_chem_shift_ID', 'type': 'positive-int',
                                                                  'mandatory': True}
                                                                 ]
                              },
                              'chem_shift_ref': None,
                              'dist_restraint': None,
                              'dihed_restraint': None,
                              'rdc_restraint': None,
                              'spectral_peak': {
                                  '_Spectral_dim': [{'name': 'ID', 'type': 'index-int'}
                                                    ],
                                  '_Spectral_dim_transfer': [{'name': 'Spectral_dim_ID_1', 'type': 'positive-int'},
                                                             {'name': 'Spectral_dim_ID_2', 'type': 'positive-int'},
                                                             ]
                              },
                              'spectral_peak_alt': {
                                  '_Spectral_dim': [{'name': 'ID', 'type': 'index-int'}
                                                    ],
                                  '_Spectral_dim_transfer': [{'name': 'Spectral_dim_ID_1', 'type': 'positive-int'},
                                                             {'name': 'Spectral_dim_ID_2', 'type': 'positive-int'},
                                                             ],
                                  '_Peak': [{'name': 'ID', 'type': 'int'}],
                                  '_Peak_general_char': [],
                                  '_Peak_char': [],
                                  '_Assigned_peak_chem_shift': []
                              },
                              'noepk_restraint': None,
                              'jcoup_restraint': None,
                              'rdc_raw_data': None,
                              'csa_restraint': None,
                              'ddc_restraint': None,
                              'hvycs_restraint': None,
                              'procs_restraint': None,
                              'csp_restraint': None,
                              'auto_relax_restraint': None,
                              'heteronucl_noe_data': None,
                              'heteronucl_t1_data': None,
                              'heteronucl_t2_data': None,
                              'heteronucl_t1r_data': None,
                              'order_param_data': None,
                              'ph_titr_data': None,
                              'ph_param_data': None,
                              'coupling_const_data': None,
                              'ccr_d_csa_restraint': None,
                              'ccr_dd_restraint': None,
                              'fchiral_restraint': None,
                              'saxs_restraint': None,
                              'other_restraint': None
                              }
                 }

# auxiliary loop data items
AUX_DATA_ITEMS = {'nef': {'entry_info': None,
                          'poly_seq': {
                              '_nef_covalent_links': [],
                              '_nef_sequence': [{'name': 'linking', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('start', 'end', 'middle', 'cyclic', 'break', 'single', 'dummy'),
                                                 'enforce-enum': True},
                                                {'name': 'residue_variant', 'type': 'str', 'mandatory': False},
                                                {'name': 'cis_peptide', 'type': 'bool', 'mandatory': False}
                                                ]
                          },
                          'entity': None,
                          'chem_shift': None,
                          'chem_shift_ref': None,
                          'dist_restraint': None,
                          'dihed_restraint': None,
                          'rdc_restraint': None,
                          'spectral_peak': {
                              '_nef_spectrum_dimension': [{'name': 'axis_unit', 'type': 'enum', 'mandatory': True,
                                                           'enum': ('ppm', 'Hz'),
                                                           'enforce-enum': True},
                                                          {'name': 'axis_code', 'type': 'str', 'mandatory': True},
                                                          {'name': 'spectrometer_frequency', 'type': 'positive-float',
                                                           'mandatory': False, 'enforce-non-zero': True},
                                                          {'name': 'spectral_width', 'type': 'positive-float', 'mandatory': False,
                                                           'enforce-non-zero': True},
                                                          {'name': 'value_first_point', 'type': 'float', 'mandatory': False},
                                                          {'name': 'folding', 'type': 'enum', 'mandatory': False,
                                                           'enum': ('circular', 'mirror', 'none')},
                                                          {'name': 'absolute_peak_positions', 'type': 'bool', 'mandatory': False},
                                                          {'name': 'is_acquisition', 'type': 'bool', 'mandatory': False},
                                                          ],
                              '_nef_spectrum_dimension_transfer': [{'name': 'transfer_type', 'type': 'enum', 'mandatory': True,
                                                                    'enum': ('onebond', 'jcoupling', 'jmultibond',
                                                                             'relayed', 'relayed-alternate',
                                                                             'through-space', 'through-space?'),
                                                                    # 'through-space?' will be resolved
                                                                    # based on related experiment type
                                                                    'enforce-enum': True},
                                                                   {'name': 'is_indirect', 'type': 'bool', 'mandatory': False}
                                                                   ]
                          },
                          'spectral_peak_alt': None,
                          'noepk_restraint': None,
                          'jcoup_restraint': None,
                          'rdc_raw_data': None,
                          'csa_restraint': None,
                          'ddc_restraint': None,
                          'hvycs_restraint': None,
                          'procs_restraint': None,
                          'csp_restraint': None,
                          'auto_relax_restraint': None,
                          'heteronucl_noe_data': None,
                          'heteronucl_t1_data': None,
                          'heteronucl_t2_data': None,
                          'heteronucl_t1r_data': None,
                          'order_param_data': None,
                          'ph_titr_data': None,
                          'ph_param_data': None,
                          'coupling_const_data': None,
                          'ccr_d_csa_restraint': None,
                          'ccr_dd_restraint': None,
                          'fchiral_restraint': None,
                          'saxs_restraint': None,
                          'other_restraint': None
                          },
                  'nmr-star': {'entry_info': None,
                               'poly_seq': {
                                   '_Bond': [{'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False}
                                             ],
                                   '_Entity_deleted_atom': [{'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                            {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                            {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                            {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False}
                                                            ],
                                   '_Entity_assembly': [{'name': 'Asym_ID', 'type': 'str', 'mandatory': False},
                                                        {'name': 'PDB_chain_ID', 'type': 'str', 'mandatory': False},
                                                        {'name': 'Experimental_data_reported', 'type': 'enum', 'mandatory': False,
                                                         'enum': ('no', 'yes')},
                                                        {'name': 'Physical_state', 'type': 'enum', 'mandatory': False,
                                                         'enum': ('native', 'denatured', 'molten globule', 'unfolded',
                                                                  'intrinsically disordered', 'partially disordered', 'na')}
                                                        ]
                               },
                               'entity': None,
                               'chem_shift': {
                                   '_Ambiguous_atom_chem_shift': [{'name': 'Assigned_chem_shift_list_ID', 'type': 'pointer-index',
                                                                   'mandatory': True, 'default': '1', 'default-from': 'parent'}
                                                                  ]
                               },
                               'chem_shift_ref': None,
                               'dist_restraint': None,
                               'dihed_restraint': None,
                               'rdc_restraint': None,
                               'spectral_peak': {
                                   '_Spectral_dim': [{'name': 'Axis_code', 'type': 'str', 'mandatory': True,
                                                      'default-from': 'Atom_type'},
                                                     {'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                      'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                      'enforce-enum': True},
                                                     {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                      'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                      'enforce-enum': True},
                                                     {'name': 'Spectrometer_frequency', 'type': 'positive-float',
                                                      'mandatory': False, 'enforce-non-zero': True},
                                                     {'name': 'Under_sampling_type', 'type': 'enum', 'mandatory': False,
                                                      'enum': ('aliased', 'folded', 'not observed')},
                                                     {'name': 'Sweep_width', 'type': 'positive-float', 'mandatory': False,
                                                      'enforce-non-zero': True},
                                                     {'name': 'Sweep_width_units', 'type': 'enum', 'mandatory': False,
                                                      'default': 'Hz', 'enum': ('ppm', 'Hz'), 'enforce-enum': True},
                                                     {'name': 'Value_first_point', 'type': 'float', 'mandatory': False},
                                                     {'name': 'Absolute_peak_positions', 'type': 'bool', 'mandatory': False},
                                                     {'name': 'Acquisition', 'type': 'bool', 'mandatory': False},
                                                     {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                      'default-from': 'parent'}
                                                     ],
                                   '_Spectral_dim_transfer': [{'name': 'Indirect', 'type': 'bool', 'mandatory': False},
                                                              {'name': 'Type', 'type': 'enum', 'mandatory': True,
                                                               'enum': ('onebond', 'jcoupling', 'jmultibond',
                                                                        'relayed', 'relayed-alternate',
                                                                        'through-space', 'through-space?'),
                                                               # 'through-space?' will be resolved based on related experiment type
                                                               'enforce-enum': True},
                                                              {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index',
                                                               'mandatory': True, 'default-from': 'parent'}
                                                              ]
                               },
                               'spectral_peak_alt': {
                                   '_Spectral_dim': [{'name': 'Axis_code', 'type': 'str', 'mandatory': True,
                                                      'default-from': 'Atom_type'},
                                                     {'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                      'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                      'enforce-enum': True},
                                                     {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                      'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                      'enforce-enum': True},
                                                     {'name': 'Spectrometer_frequency', 'type': 'positive-float',
                                                      'mandatory': False, 'enforce-non-zero': True},
                                                     {'name': 'Under_sampling_type', 'type': 'enum', 'mandatory': False,
                                                      'enum': ('aliased', 'folded', 'not observed')},
                                                     {'name': 'Sweep_width', 'type': 'positive-float', 'mandatory': False,
                                                      'enforce-non-zero': True},
                                                     {'name': 'Sweep_width_units', 'type': 'enum', 'mandatory': True,
                                                      'default': 'Hz', 'enum': ('ppm', 'Hz'), 'enforce-enum': True},
                                                     {'name': 'Value_first_point', 'type': 'float', 'mandatory': False},
                                                     {'name': 'Absolute_peak_positions', 'type': 'bool', 'mandatory': False},
                                                     {'name': 'Acquisition', 'type': 'bool', 'mandatory': False},
                                                     {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                      'default-from': 'parent'}
                                                     ],
                                   '_Spectral_dim_transfer': [{'name': 'Indirect', 'type': 'bool', 'mandatory': False},
                                                              {'name': 'Type', 'type': 'enum', 'mandatory': True,
                                                               'enum': ('onebond', 'jcoupling', 'jmultibond',
                                                                        'relayed', 'relayed-alternate',
                                                                        'through-space', 'through-space?'),
                                                               # 'through-space?' will be resolved based on related experiment type
                                                               'enforce-enum': True},
                                                              {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index',
                                                               'mandatory': True, 'default-from': 'parent'}
                                                              ],
                                   '_Peak': [{'name': 'Figure_of_merit', 'type': 'range-float', 'mandatory': False,
                                              'range': WEIGHT_RANGE},
                                             {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default-from': 'parent'}
                                             ],
                                   '_Peak_general_char': [{'name': 'Peak_ID', 'type': 'int', 'mandatory': True},
                                                          {'name': 'Intensity_val', 'type': 'float', 'mandatory': True},
                                                          {'name': 'Intensity_val_err', 'type': 'positive-float',
                                                           'mandatory': False, 'void-zero': True},
                                                          {'name': 'Measurement_method', 'type': 'enum', 'mandatory': False,
                                                           'enum': ('absolute height', 'height', 'relative height', 'volume',
                                                                    'number of contours', 'integration')},
                                                          {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index',
                                                           'mandatory': True, 'default-from': 'parent'}
                                                          ],
                                   '_Peak_char': [{'name': 'Peak_ID', 'type': 'int', 'mandatory': True},
                                                  {'name': 'Spectral_dim_ID', 'type': 'enum-int', 'mandatory': True,
                                                   'enum': set(range(1, MAX_DIM_NUM_OF_SPECTRA)),
                                                   'enforce-enum': True},
                                                  {'name': 'Chem_shift_val', 'type': 'range-float', 'mandatory': True,
                                                   'range': CS_RESTRAINT_RANGE},
                                                  {'name': 'Chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'range': CS_UNCERTAINTY_RANGE},
                                                  {'name': 'Line_width_val', 'type': 'positive-float', 'mandatory': False},
                                                  {'name': 'Line_width_val_err', 'type': 'positive-float', 'mandatory': False,
                                                   'void-zero': True},
                                                  {'name': 'Coupling_pattern', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('d', 'dd', 'ddd', 'dm', 'dt', 'hxt', 'hpt', 'm',
                                                            'q', 'qd', 'qn', 's', 'sxt', 't', 'td', 'LR', '1JCH')},
                                                  {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                   'default-from': 'parent'}
                                                  ],
                                   '_Assigned_peak_chem_shift': [{'name': 'Peak_ID', 'type': 'int', 'mandatory': True},
                                                                 {'name': 'Spectral_dim_ID', 'type': 'enum-int', 'mandatory': True,
                                                                  'enum': set(range(1, MAX_DIM_NUM_OF_SPECTRA)),
                                                                  'enforce-enum': True},
                                                                 {'name': 'Set_ID', 'type': 'positive-int', 'mandatory': False},
                                                                 {'name': 'Magnetization_linkage_ID', 'type': 'positive-int',
                                                                  'mandatory': False},
                                                                 {'name': 'Val', 'type': 'range-float', 'mandatory': False,
                                                                  'range': CS_RESTRAINT_RANGE},
                                                                 {'name': 'Contribution_fractional_val', 'type': 'range-float',
                                                                  'mandatory': False,
                                                                  'range': WEIGHT_RANGE},
                                                                 {'name': 'Figure_of_merit', 'type': 'range-float',
                                                                  'mandatory': False, 'range': WEIGHT_RANGE},
                                                                 {'name': 'Assigned_chem_shift_list_ID', 'type': 'pointer-index',
                                                                  'mandatory': False},
                                                                 {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                                                  'mandatory': False},
                                                                 {'name': 'Entity_ID', 'type': 'positive-int', 'mandatory': False},
                                                                 {'name': 'Comp_index_ID', 'type': 'int', 'mandatory': False},
                                                                 {'name': 'Comp_ID', 'type': 'str', 'mandatory': False,
                                                                  'uppercase': True},
                                                                 {'name': 'Atom_ID', 'type': 'str', 'mandatory': False},
                                                                 {'name': 'Ambiguity_code', 'type': 'enum-int', 'mandatory': False,
                                                                  'enum': ALLOWED_AMBIGUITY_CODES},
                                                                 {'name': 'Ambiguity_set_ID', 'type': 'positive-int',
                                                                  'mandatory': False},
                                                                 {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                                 {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                                 {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                                 {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index',
                                                                  'mandatory': True, 'default-from': 'parent'}
                                                                 ]
                               },
                               'noepk_restraint': None,
                               'jcoup_restraint': None,
                               'rdc_raw_data': None,
                               'csa_restraint': None,
                               'ddc_restraint': None,
                               'hvycs_restraint': None,
                               'procs_restraint': None,
                               'csp_restraint': None,
                               'auto_relax_restraint': None,
                               'heteronucl_noe_data': None,
                               'heteronucl_t1_data': None,
                               'heteronucl_t2_data': None,
                               'heteronucl_t1r_data': None,
                               'order_param_data': None,
                               'ph_titr_data': None,
                               'ph_param_data': None,
                               'coupling_const_data': None,
                               'ccr_d_csa_restraint': None,
                               'ccr_dd_restraint': None,
                               'fchiral_restraint': None,
                               'saxs_restraint': None,
                               'other_restraint': None
                               }
                  }

# allowed auxiliary loop tags
AUX_ALLOWED_TAGS = {'nef': {'entry_info': None,
                            'poly_seq': {
                                '_nef_covalent_links': ['chain_code_1', 'sequence_code_1', 'residue_name_1', 'atom_name_1',
                                                        'chain_code_2', 'sequence_code_2', 'residue_name_2', 'atom_name_2'],
                                '_nef_sequence': ['index', 'chain_code', 'sequence_code', 'residue_name',
                                                  'linking', 'residue_variant', 'cis_peptide']
                            },
                            'entity': None,
                            'chem_shift': None,
                            'chem_shift_ref': None,
                            'dist_restraint': None,
                            'dihed_restraint': None,
                            'rdc_restraint': None,
                            'spectral_peak': {
                                '_nef_spectrum_dimension': ['dimension_id', 'axis_unit', 'axis_code',
                                                            'spectrometer_frequency', 'spectral_width',
                                                            'value_first_point', 'folding',
                                                            'absolute_peak_positions', 'is_acquisition'],
                                '_nef_spectrum_dimension_transfer': ['dimension_1', 'dimension_2', 'transfer_type', 'is_indirect']
                            },
                            'spectral_peak_alt': None,
                            'noepk_restraint': None,
                            'jcoup_restraint': None,
                            'rdc_raw_data': None,
                            'csa_restraint': None,
                            'ddc_restraint': None,
                            'hvycs_restraint': None,
                            'procs_restraint': None,
                            'csp_restraint': None,
                            'auto_relax_restraint': None,
                            'heteronucl_noe_data': None,
                            'heteronucl_t1_data': None,
                            'heteronucl_t2_data': None,
                            'heteronucl_t1r_data': None,
                            'order_param_data': None,
                            'ph_titr_data': None,
                            'ph_param_data': None,
                            'coupling_const_data': None,
                            'ccr_d_csa_restraint': None,
                            'ccr_dd_restraint': None,
                            'fchiral_restraint': None,
                            'saxs_restraint': None,
                            'other_restraint': None
                            },
                    'nmr-star': {'entry_info': None,
                                 'poly_seq': {
                                     '_Bond': ['ID', 'Type', 'Value_order', 'Assembly_atom_ID_1', 'Entity_assembly_ID_1',
                                               'Entity_assembly_name_1', 'Entity_ID_1', 'Comp_ID_1', 'Comp_index_ID_1',
                                               'Seq_ID_1', 'Atom_ID_1',
                                               'Assembly_atom_ID_2', 'Entity_assembly_ID_2', 'Entity_assembly_name_2',
                                               'Entity_ID_2', 'Comp_ID_2', 'Comp_index_ID_2', 'Seq_ID_2', 'Atom_ID_2',
                                               'Auth_entity_assembly_ID_1', 'Auth_entity_assembly_name_1', 'Auth_asym_ID_1',
                                               'Auth_seq_ID_1', 'Auth_comp_ID_1', 'Auth_atom_ID_1',
                                               'Auth_entity_assembly_ID_2', 'Auth_entity_assembly_name_2', 'Auth_asym_ID_2',
                                               'Auth_seq_ID_2', 'Auth_comp_ID_2', 'Auth_atom_ID_2',
                                               'Sf_ID', 'Entry_ID', 'Assembly_ID'],
                                     '_Entity_deleted_atom': ['ID', 'Entity_atom_list_ID', 'Entity_assembly_ID', 'Entity_ID',
                                                              'Comp_ID', 'Comp_index_ID', 'Seq_ID', 'Atom_ID',
                                                              'Auth_entity_assembly_ID', 'Auth_seq_ID', 'Auth_comp_ID',
                                                              'Auth_atom_ID', 'Sf_ID', 'Entry_ID', 'Assembly_ID'],
                                     '_Entity_assembly': ['ID', 'Entity_assembly_name', 'Entity_ID', 'Entity_label',
                                                          'Asym_ID', 'PDB_chain_ID',
                                                          'Experimental_data_reported', 'Physical_state',
                                                          'Conformational_isomer', 'Chemical_exchange_state',
                                                          'Magnetic_equivalence_group_code', 'Role', 'Details',
                                                          'Sf_ID', 'Entry_ID', 'Assembly_ID']
                                 },
                                 'entity': None,
                                 'chem_shift': {
                                     '_Ambiguous_atom_chem_shift': ['Ambiguous_shift_set_ID', 'Atom_chem_shift_ID',
                                                                    'Sf_ID', 'Entry_ID', 'Assigned_chem_shift_list_ID']
                                 },
                                 'chem_shift_ref': None,
                                 'dist_restraint': None,
                                 'dihed_restraint': None,
                                 'rdc_restraint': None,
                                 'spectral_peak': {
                                     '_Spectral_dim': ['ID', 'Axis_code', 'Spectrometer_frequency', 'Atom_type',
                                                       'Atom_isotope_number', 'Spectral_region', 'Magnetization_linkage_ID',
                                                       'Under_sampling_type', 'Sweep_width', 'Sweep_width_units',
                                                       'Value_first_point', 'Absolute_peak_positions', 'Acquisition',
                                                       'Center_frequency_offset', 'Encoding_code', 'Encoded_reduced_dimension_ID',
                                                       'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                                     '_Spectral_dim_transfer': ['Spectral_dim_ID_1', 'Spectral_dim_ID_2', 'Indirect', 'Type',
                                                                'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID']
                                 },
                                 'spectral_peak_alt': {
                                     '_Spectral_dim': ['ID', 'Axis_code', 'Spectrometer_frequency', 'Atom_type',
                                                       'Atom_isotope_number', 'Spectral_region', 'Magnetization_linkage_ID',
                                                       'Under_sampling_type', 'Sweep_width', 'Sweep_width_units',
                                                       'Value_first_point', 'Absolute_peak_positions', 'Acquisition',
                                                       'Center_frequency_offset', 'Encoding_code', 'Encoded_reduced_dimension_ID',
                                                       'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                                     '_Spectral_dim_transfer': ['Spectral_dim_ID_1', 'Spectral_dim_ID_2', 'Indirect',
                                                                'Type', 'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                                     '_Peak': ['Index_ID', 'ID', 'Figure_of_merit', 'Restraint', 'Details',
                                               'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                                     '_Peak_general_char': ['Peak_ID', 'Intensity_val', 'Intensity_val_err', 'Measurement_method',
                                                            'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID'],
                                     '_Peak_char': ['Peak_ID', 'Spectral_dim_ID', 'Chem_shift_val', 'Chem_shift_val_err',
                                                    'Line_width_val', 'Line_width_val_err', 'Phase_val', 'Phase_val_err',
                                                    'Decay_rate_val', 'Decay_rate_val_err', 'Coupling_pattern',
                                                    'Bounding_box_upper_val', 'Bounding_box_lower_val', 'Bounding_box_range_val',
                                                    'Details', 'Derivation_method_ID', 'Sf_ID', 'Entry_ID',
                                                    'Spectral_peak_list_ID'],
                                     '_Assigned_peak_chem_shift': ['Peak_ID', 'Spectral_dim_ID', 'Set_ID',
                                                                   'Magnetization_linkage_ID', 'Assembly_atom_ID',
                                                                   'Val', 'Contribution_fractional_val',
                                                                   'Figure_of_merit', 'Assigned_chem_shift_list_ID',
                                                                   'Atom_chem_shift_ID', 'Entity_assembly_ID', 'Entity_ID',
                                                                   'Comp_index_ID', 'Comp_ID', 'Atom_ID',
                                                                   'Ambiguity_code', 'Ambiguity_set_ID', 'Auth_atom_peak_num',
                                                                   # NOTICE: '_Assigned_peak_chem_shift.Auth_asym_ID' does not exist
                                                                   'Auth_entity_ID',
                                                                   'Auth_seq_ID', 'Auth_comp_ID', 'Auth_atom_ID',
                                                                   'Auth_ambiguity_code', 'Auth_ambiguity_set_ID',
                                                                   'Auth_amb_atom_grp_ID', 'Resonance_ID', 'Details',
                                                                   'Sf_ID', 'Entry_ID', 'Spectral_peak_list_ID']
                                 },
                                 'noepk_restraint': None,
                                 'jcoup_restraint': None,
                                 'rdc_raw_data': None,
                                 'csa_restraint': None,
                                 'ddc_restraint': None,
                                 'hvycs_restraint': None,
                                 'procs_restraint': None,
                                 'csp_restraint': None,
                                 'auto_relax_restraint': None,
                                 'heteronucl_noe_data': None,
                                 'heteronucl_t1_data': None,
                                 'heteronucl_t2_data': None,
                                 'heteronucl_t1r_data': None,
                                 'order_param_data': None,
                                 'ph_titr_data': None,
                                 'ph_param_data': None,
                                 'coupling_const_data': None,
                                 'ccr_d_csa_restraint': None,
                                 'ccr_dd_restraint': None,
                                 'fchiral_restraint': None,
                                 'saxs_restraint': None,
                                 'other_restraint': None
                                 }
                    }

# item name in cs loop
ITEM_NAMES_IN_CS_LOOP = {'nef': {'chain_id': 'chain_code',
                                 'seq_id': 'sequence_code',
                                 'comp_id': 'residue_name',
                                 'atom_id': 'atom_name',
                                 'value': 'value',
                                 'error': 'value_uncertainty',
                                 'atom_type': 'element',
                                 'isotope_number': 'isotope_number'
                                 },
                         'nmr-star': {'chain_id': 'Entity_assembly_ID',
                                      'seq_id': 'Comp_index_ID',
                                      'comp_id': 'Comp_ID',
                                      'atom_id': 'Atom_ID',
                                      'value': 'Val',
                                      'error': 'Val_err',
                                      'atom_type': 'Atom_type',
                                      'isotope_number': 'Atom_isotope_number',
                                      'alt_chain_id': 'Auth_asym_ID',
                                      'alt_seq_id': 'Seq_ID'
                                      }
                         }

# item name in spectral peak loop
ITEM_NAMES_IN_PK_LOOP = {'nef': {'chain_id': 'chain_code_%s',
                                 'seq_id': 'sequence_code_%s',
                                 'comp_id': 'residue_name_%s',
                                 'atom_id': 'atom_name_%s',
                                 'position': 'position_%s'
                                 },
                         'nmr-star': {'chain_id': 'Entity_assembly_ID_%s',
                                      'seq_id': 'Comp_index_ID_%s',
                                      'comp_id': 'Comp_ID_%s',
                                      'atom_id': 'Atom_ID_%s',
                                      'position': 'Position_%s',
                                      'alt_seq_id': 'Seq_ID_%s'
                                      }
                         }

# item name in distance restraint loop
ITEM_NAMES_IN_DIST_LOOP = {'nef': {'combination_id': 'restraint_combination_id',
                                   'chain_id_1': 'chain_code_1',
                                   'seq_id_1': 'sequence_code_1',
                                   'comp_id_1': 'residue_name_1',
                                   'atom_id_1': 'atom_name_1',
                                   'chain_id_2': 'chain_code_2',
                                   'seq_id_2': 'sequence_code_2',
                                   'comp_id_2': 'residue_name_2',
                                   'atom_id_2': 'atom_name_2',
                                   'target_value': 'target_value',
                                   'lower_linear_limit': 'lower_linear_limit',
                                   'upper_linear_limit': 'upper_linear_limit',
                                   'lower_limit': 'lower_limit',
                                   'upper_limit': 'upper_limit'
                                   },
                           'nmr-star': {'combination_id': 'Combination_ID',
                                        'chain_id_1': 'Entity_assembly_ID_1',
                                        'seq_id_1': 'Comp_index_ID_1',
                                        'comp_id_1': 'Comp_ID_1',
                                        'atom_id_1': 'Atom_ID_1',
                                        'chain_id_2': 'Entity_assembly_ID_2',
                                        'seq_id_2': 'Comp_index_ID_2',
                                        'comp_id_2': 'Comp_ID_2',
                                        'atom_id_2': 'Atom_ID_2',
                                        'target_value': 'Target_val',
                                        'target_value_alt': 'Distance_val',
                                        'lower_linear_limit': 'Lower_linear_limit',
                                        'upper_linear_limit': 'Upper_linear_limit',
                                        'lower_limit': 'Distance_lower_bound_val',
                                        'upper_limit': 'Distance_upper_bound_val',
                                        'alt_seq_id_1': 'Seq_ID_1',
                                        'alt_seq_id_2': 'Seq_ID_2',
                                        'member_id': 'Member_ID',
                                        'member_logic_code': 'Member_logic_code',
                                        }
                           }

# item name in dihedral angle restraint loop
ITEM_NAMES_IN_DIHED_LOOP = {'nef': {'combination_id': 'restraint_combination_id',
                                    'chain_id_1': 'chain_code_1',
                                    'seq_id_1': 'sequence_code_1',
                                    'comp_id_1': 'residue_name_1',
                                    'atom_id_1': 'atom_name_1',
                                    'chain_id_2': 'chain_code_2',
                                    'seq_id_2': 'sequence_code_2',
                                    'comp_id_2': 'residue_name_2',
                                    'atom_id_2': 'atom_name_2',
                                    'chain_id_3': 'chain_code_3',
                                    'seq_id_3': 'sequence_code_3',
                                    'comp_id_3': 'residue_name_3',
                                    'atom_id_3': 'atom_name_3',
                                    'chain_id_4': 'chain_code_4',
                                    'seq_id_4': 'sequence_code_4',
                                    'comp_id_4': 'residue_name_4',
                                    'atom_id_4': 'atom_name_4',
                                    'angle_type': 'name',
                                    'target_value': 'target_value',
                                    'lower_linear_limit': 'lower_linear_limit',
                                    'upper_linear_limit': 'upper_linear_limit',
                                    'lower_limit': 'lower_limit',
                                    'upper_limit': 'upper_limit'
                                    },
                            'nmr-star': {'combination_id': 'Combination_ID',
                                         'chain_id_1': 'Entity_assembly_ID_1',
                                         'seq_id_1': 'Comp_index_ID_1',
                                         'comp_id_1': 'Comp_ID_1',
                                         'atom_id_1': 'Atom_ID_1',
                                         'chain_id_2': 'Entity_assembly_ID_2',
                                         'seq_id_2': 'Comp_index_ID_2',
                                         'comp_id_2': 'Comp_ID_2',
                                         'atom_id_2': 'Atom_ID_2',
                                         'chain_id_3': 'Entity_assembly_ID_3',
                                         'seq_id_3': 'Comp_index_ID_3',
                                         'comp_id_3': 'Comp_ID_3',
                                         'atom_id_3': 'Atom_ID_3',
                                         'chain_id_4': 'Entity_assembly_ID_4',
                                         'seq_id_4': 'Comp_index_ID_4',
                                         'comp_id_4': 'Comp_ID_4',
                                         'atom_id_4': 'Atom_ID_4',
                                         'angle_type': 'Torsion_angle_name',
                                         'alt_seq_id_1': 'Seq_ID_1',
                                         'alt_seq_id_2': 'Seq_ID_2',
                                         'alt_seq_id_3': 'Seq_ID_3',
                                         'alt_seq_id_4': 'Seq_ID_4',
                                         'target_value': 'Angle_target_val',
                                         'lower_linear_limit': 'Angle_lower_linear_limit',
                                         'upper_linear_limit': 'Angle_upper_linear_limit',
                                         'lower_limit': 'Angle_lower_bound_val',
                                         'upper_limit': 'Angle_upper_bound_val'
                                         }
                            }

# item name in RDC restraint loop
ITEM_NAMES_IN_RDC_LOOP = {'nef': {'combination_id': 'restraint_combination_id',
                                  'chain_id_1': 'chain_code_1',
                                  'seq_id_1': 'sequence_code_1',
                                  'comp_id_1': 'residue_name_1',
                                  'atom_id_1': 'atom_name_1',
                                  'chain_id_2': 'chain_code_2',
                                  'seq_id_2': 'sequence_code_2',
                                  'comp_id_2': 'residue_name_2',
                                  'atom_id_2': 'atom_name_2',
                                  'target_value': 'target_value',
                                  'lower_linear_limit': 'lower_linear_limit',
                                  'upper_linear_limit': 'upper_linear_limit',
                                  'lower_limit': 'lower_limit',
                                  'upper_limit': 'upper_limit'
                                  },
                          'nmr-star': {'combination_id': 'Combination_ID',
                                       'chain_id_1': 'Entity_assembly_ID_1',
                                       'seq_id_1': 'Comp_index_ID_1',
                                       'comp_id_1': 'Comp_ID_1',
                                       'atom_id_1': 'Atom_ID_1',
                                       'chain_id_2': 'Entity_assembly_ID_2',
                                       'seq_id_2': 'Comp_index_ID_2',
                                       'comp_id_2': 'Comp_ID_2',
                                       'atom_id_2': 'Atom_ID_2',
                                       'alt_seq_id_1': 'Seq_ID_1',
                                       'alt_seq_id_2': 'Seq_ID_2',
                                       'target_value': 'Target_value',
                                       'lower_linear_limit': 'RDC_lower_linear_limit',
                                       'upper_linear_limit': 'RDC_upper_linear_limit',
                                       'lower_limit': 'RDC_lower_bound',
                                       'upper_limit': 'RDC_upper_bound'
                                       }
                          }

# saveframe tag name for chemical shift list in spectral peak
CS_LIST_SF_TAG_NAME = {'nef': 'chemical_shift_list',
                       'nmr-star': 'Chemical_shift_list'
                       }

NMR_STAR_SF_TAG_PREFIXES = {'dist_restraint': '_Gen_dist_constraint_list',
                            'dihed_restraint': '_Torsion_angle_constraint_list',
                            'rdc_restraint': '_RDC_constraint_list',
                            'noepk_restraint': '_Homonucl_NOE_list',
                            'jcoup_restraint': '_J_three_bond_constraint_list',
                            'rdc_raw_data': '_RDC_list',
                            'csa_restraint': '_Chem_shift_anisotropy',
                            'ddc_restraint': '_Dipolar_coupling_list',
                            'hvycs_restraint': '_CA_CB_constraint_list',
                            'procs_restraint': '_H_chem_shift_constraint_list',
                            'csp_restraint': '_Chem_shift_perturbation_list',
                            'auto_relax_restraint': '_Auto_relaxation_list',
                            'heteronucl_noe_data': '_Heteronucl_NOE_list',
                            'heteronucl_t1_data': '_Heteronucl_T1_list',
                            'heteronucl_t2_data': '_Heteronucl_T2_list',
                            'heteronucl_t1r_data': '_Heteronucl_T1rho_list',
                            'order_param_data': '_Order_parameter_list',
                            'ph_titr_data': '_PH_titration_list',
                            'ph_param_data': '_PH_param_list',
                            'coupling_const_data': '_Coupling_constant_list',
                            'ccr_d_csa_restraint': '_Cross_correlation_D_CSA_list',
                            'ccr_dd_restraint': '_Cross_correlation_DD_list',
                            'fchiral_restraint': '_Floating_chirality_assign',
                            'saxs_restraint': '_SAXS_constraint_list',
                            'other_restraint': '_Other_data_type_list',
                            'spectral_peak': '_Spectral_peak_list',
                            'chem_shift': '_Assigned_chem_shift_list'
                            }

NMR_STAR_SF_CATEGORIES = {'dist_restraint': 'general_distance_constraints',
                          'dihed_restraint': 'torsion_angle_constraints',
                          'rdc_restraint': 'RDC_constraints',
                          'noepk_restraint': 'homonucl_NOEs',
                          'jcoup_restraint': 'J_three_bond_constraints',
                          'rdc_raw_data': 'RDCs',
                          'csa_restraint': 'chem_shift_anisotropy',
                          'ddc_restraint': 'dipolar_couplings',
                          'hvycs_restraint': 'CA_CB_chem_shift_constraints',
                          'procs_restraint': 'H_chem_shift_constraints',
                          'csp_restraint': 'chem_shift_perturbation',
                          'auto_relax_restraint': 'auto_relaxation',
                          'heteronucl_noe_data': 'heteronucl_NOEs',
                          'heteronucl_t1_data': 'heteronucl_T1_relaxation',
                          'heteronucl_t2_data': 'heteronucl_T2_relaxation',
                          'heteronucl_t1r_data': 'heteronucl_T1rho_relaxation',
                          'order_param_data': 'order_parameters',
                          'ph_titr_data': 'pH_titration',
                          'ph_param_data': 'pH_param_list',
                          'coupling_const_data': 'coupling_constants',
                          'ccr_d_csa_restraint': 'dipole_CSA_cross_correlations',
                          'ccr_dd_restraint': 'dipole_dipole_cross_correlations',
                          'fchiral_restraint': 'floating_chiral_stereo_assign',
                          'saxs_restraint': 'saxs_constraints',
                          'other_restraint': 'other_data_types',
                          'spectral_peak': 'spectral_peak_list',
                          'chem_shift': 'assigned_chemical_shifts'
                          }

NMR_STAR_SF_TAG_ITEMS = {'dist_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                            {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                            {'name': 'Constraint_type', 'type': 'enum', 'mandatory': False,
                                             'enum': ('NOE', 'NOE build-up', 'NOE not seen', 'ROE', 'ROE build-up',
                                                      'hydrogen bond', 'disulfide bond', 'paramagnetic relaxation',
                                                      'symmetry', 'general distance', 'mutation', 'chemical shift perturbation',
                                                      'undefined', 'unknown')},
                                            {'name': 'Potential_type', 'type': 'enum', 'mandatory': False,
                                             'enum': ('log-harmonic', 'parabolic', 'square-well-parabolic',
                                                      'square-well-parabolic-linear', 'upper-bound-parabolic',
                                                      'lower-bound-parabolic', 'upper-bound-parabolic-linear',
                                                      'lower-bound-parabolic-linear', 'undefined', 'unknown')},
                                            {'name': 'Details', 'type': 'str', 'mandatory': False},
                                            {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                            {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                         'dihed_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                             {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                             {'name': 'Constraint_type', 'type': 'enum', 'mandatory': False,
                                              'enum': ('J-couplings', 'backbone chemical shifts', 'undefined', 'unknown')},
                                             {'name': 'Potential_type', 'type': 'enum', 'mandatory': False,
                                              'enum': ('parabolic', 'square-well-parabolic', 'square-well-parabolic-linear',
                                                       'upper-bound-parabolic', 'lower-bound-parabolic',
                                                       'upper-bound-parabolic-linear', 'lower-bound-parabolic-linear',
                                                       'undefined', 'unknown')},
                                             {'name': 'Details', 'type': 'str', 'mandatory': False},
                                             {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                             {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                         'rdc_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'Constraint_type', 'type': 'enum', 'mandatory': False,
                                            'enum': ('RDC', 'undefined', 'unknown')},
                                           {'name': 'Potential_type', 'type': 'enum', 'mandatory': False,
                                            'enum': ('parabolic', 'square-well-parabolic', 'square-well-parabolic-linear',
                                                     'upper-bound-parabolic', 'lower-bound-parabolic',
                                                     'upper-bound-parabolic-linear', 'lower-bound-parabolic-linear',
                                                     'undefined', 'unknown')},
                                           {'name': 'Tensor_magnitude', 'type': 'float', 'mandatory': False},
                                           {'name': 'Tensor_rhombicity', 'type': 'positive-float', 'mandatory': False},
                                           {'name': 'Tensor_auth_asym_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Tensor_auth_seq_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Tensor_auth_comp_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Details', 'type': 'str', 'mandatory': False},
                                           {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                           {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                         'noepk_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                             {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                             {'name': 'Homonuclear_NOE_val_type', 'type': 'enum', 'mandatory': True,
                                              'enum': ('peak volume', 'peak height', 'contour count', 'na')},
                                             {'name': 'Details', 'type': 'str', 'mandatory': False},
                                             {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                             # allows to have software-native id starting from zero
                                             {'name': 'ID', 'type': 'int', 'mandatory': True},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                         'jcoup_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                             {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                             {'name': 'Details', 'type': 'str', 'mandatory': False},
                                             {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                             {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                         'rdc_raw_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                          {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                          {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                           'enforce-non-zero': True},
                                          {'name': 'Details', 'type': 'str', 'mandatory': False},
                                          {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                          {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                          {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                          ],
                         'csa_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                            'enforce-non-zero': True},
                                           {'name': 'Val_units', 'type': 'enum', 'mandatory': False,
                                            'enum': ('ppm', 'ppb')},
                                           {'name': 'Details', 'type': 'str', 'mandatory': False},
                                           {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                           {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                         'ddc_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                            'enforce-non-zero': True},
                                           {'name': 'Scaling_factor', 'type': 'positive-float', 'mandatory': False},
                                           {'name': 'Fitting_procedure', 'type': 'str', 'mandatory': False},
                                           {'name': 'Details', 'type': 'str', 'mandatory': False},
                                           {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                           {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                         'hvycs_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                             {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                             {'name': 'Units', 'type': 'str', 'mandatory': False},
                                             {'name': 'Details', 'type': 'str', 'mandatory': False},
                                             {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                             {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                         'procs_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                             {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                             {'name': 'Units', 'type': 'str', 'mandatory': False},
                                             {'name': 'Details', 'type': 'str', 'mandatory': False},
                                             {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                             {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                         'csp_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'Type', 'type': 'enum', 'mandatory': False,
                                            'enum': ('macromolecular binding', 'ligand binding',
                                                     'ligand fragment binding', 'paramagnetic ligand binding')},
                                           {'name': 'Details', 'type': 'str', 'mandatory': False},
                                           {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                           {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                         'auto_relax_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Temp_calibration_method', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('methanol', 'monoethylene glycol', 'no calibration applied')},
                                                  {'name': 'Temp_control_method', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('single scan interleaving', 'temperature compensation block',
                                                            'single scan interleaving and temperature compensation block',
                                                            'no temperature control applied')},
                                                  {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float',
                                                   'mandatory': False, 'enforce-non-zero': True},
                                                  {'name': 'Exact_field_strength', 'type': 'positive-float', 'mandatory': False,
                                                   'enforce-non-zero': True},
                                                  {'name': 'Common_relaxation_type_name', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('R1', 'R2', 'R1rho', 'ZQ relaxation', 'longitudinal spin order',
                                                            'single quantum antiphase', 'DQ relaxation')},
                                                  {'name': 'Relaxation_coherence_type', 'type': 'enum', 'mandatory': True,
                                                   'enum': ('Iz', 'Sz', '(I+)+(I-)', '(S+)+(S-)', 'I+', 'I-', 'S+', 'S-',
                                                            '(I+S-)+(I-S+)', 'I-S+', 'I+S-', 'IzSz', '((I+)+(I-))Sz',
                                                            'Iz((S+)+(S-))', 'I+Sz', 'I-Sz', 'IzS+', 'IzS-', '(I+S+)+(I-S-)',
                                                            'I+S+', 'I-S-')},
                                                  {'name': 'Relaxation_val_units', 'type': 'enum', 'mandatory': True,
                                                   'enum': ('s-1', 'ms-1', 'us-1', 'ns-1', 'ps-1')},
                                                  {'name': 'Rex_units', 'type': 'enum', 'mandatory': False,
                                                   'enum': ('s-1', 'ms-1', 'us-1')},
                                                  {'name': 'Rex_field_strength', 'type': 'positive-float', 'mandatory': False,
                                                   'enforce-non-zero': True},
                                                  {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                  {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                  {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                  ],
                         'heteronucl_noe_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                                  'enforce-non-zero': True},
                                                 {'name': 'Heteronuclear_NOE_val_type', 'type': 'enum', 'mandatory': True,
                                                  'enum': ('peak height', 'peak integral', 'contour count',
                                                           'relative intensities', 'na')},
                                                 {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                 {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                 ],
                         'heteronucl_t1_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                                 'enforce-non-zero': True},
                                                {'name': 'T1_coherence_type', 'type': 'enum', 'mandatory': True,
                                                 'enum': ('Iz', 'Sz', 'na')},
                                                {'name': 'T1_val_units', 'type': 'enum', 'mandatory': True,
                                                 'enum': ('s', 's-1', 'ms', 'ms-1')},
                                                {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                ],
                         'heteronucl_t2_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                {'name': 'Temp_calibration_method', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('methanol', 'monoethylene glycol', 'no calibration applied')},
                                                {'name': 'Temp_control_method', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('single scan interleaving', 'temperature compensation block',
                                                          'single scan interleaving and temperature compensation block',
                                                          'no temperature control applied')},
                                                {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                                 'enforce-non-zero': True},
                                                {'name': 'T2_coherence_type', 'type': 'enum', 'mandatory': True,
                                                 'enum': ('I(+,-)', 'S(+,-)', 'na')},
                                                {'name': 'T2_val_units', 'type': 'enum', 'mandatory': True,
                                                 'enum': ('s', 's-1', 'ms', 'ms-1')},
                                                {'name': 'Rex_units', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('s-1', 'ms-1', 'us-1')},
                                                {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                ],
                         'heteronucl_t1r_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Temp_calibration_method', 'type': 'enum', 'mandatory': False,
                                                  'enum': ('methanol', 'monoethylene glycol', 'no calibration applied')},
                                                 {'name': 'Temp_control_method', 'type': 'enum', 'mandatory': False,
                                                  'enum': ('single scan interleaving', 'temperature compensation block',
                                                           'single scan interleaving and temperature compensation block',
                                                           'no temperature control applied')},
                                                 {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                                  'enforce-non-zero': True},
                                                 {'name': 'T1rho_coherence_type', 'type': 'enum', 'mandatory': True,
                                                  'enum': ('I(+,-)', 'S(+,-)', 'na')},
                                                 {'name': 'T1rho_val_units', 'type': 'enum', 'mandatory': True,
                                                  'enum': ('s', 's-1', 'ms', 'ms-1')},
                                                 {'name': 'Rex_units', 'type': 'enum', 'mandatory': False,
                                                  'enum': ('s-1', 'ms-1', 'us-1')},
                                                 {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                 {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                 ],
                         'order_param_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                              {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                              {'name': 'Tau_e_val_units', 'type': 'enum', 'mandatory': False,
                                               'enum': ('s', 'ms', 'us', 'ns', 'ps')},
                                              {'name': 'Tau_f_val_units', 'type': 'enum', 'mandatory': False,
                                               'enum': ('s', 'ms', 'us', 'ns', 'ps')},
                                              {'name': 'Tau_s_val_units', 'type': 'enum', 'mandatory': False,
                                               'enum': ('s', 'ms', 'us', 'ns', 'ps')},
                                              {'name': 'Rex_val_units', 'type': 'enum', 'mandatory': False,
                                               'enum': ('s-1', 'ms-1', 'us-1')},
                                              {'name': 'Rex_field_strength', 'type': 'positive-float', 'mandatory': False,
                                               'enforce-non-zero': True},
                                              {'name': 'Details', 'type': 'str', 'mandatory': False},
                                              {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                              {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                         'ph_titr_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                          {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                          {'name': 'Expt_observed_param', 'type': 'enum', 'mandatory': True,
                                           'enum': ('chemical shift', 'coupling constant', 'peak height', 'peak volume')},
                                          {'name': 'Details', 'type': 'str', 'mandatory': False},
                                          {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                          {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                          {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                          ],
                         'ph_param_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'Observed_NMR_param', 'type': 'enum', 'mandatory': True,
                                            'enum': ('chemical shift', 'coupling constant', 'peak height', 'peak volume')},
                                           {'name': 'PH_titration_list_ID', 'type': 'positive-int', 'mandatory': True,
                                            'default': '1'},
                                           {'name': 'Details', 'type': 'str', 'mandatory': False},
                                           {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                           {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                         'coupling_const_data': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                                  'enforce-non-zero': True},
                                                 {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                 {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                 ],
                         'ccr_d_csa_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                                 {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                                  'enforce-non-zero': True},
                                                 {'name': 'Val_units', 'type': 'enum', 'mandatory': True,
                                                  'enum': ('s-1', 'ms-1', 'us-1')},
                                                 {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                                 {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                 ],
                         'ccr_dd_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                              {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                              {'name': 'Spectrometer_frequency_1H', 'type': 'positive-float', 'mandatory': False,
                                               'enforce-non-zero': True},
                                              {'name': 'Val_units', 'type': 'enum', 'mandatory': True,
                                               'enum': ('s-1', 'ms-1', 'us-1')},
                                              {'name': 'Details', 'type': 'str', 'mandatory': False},
                                              {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                              {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                         'fchiral_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                               {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                               {'name': 'Stereo_count', 'type': 'int', 'mandatory': False},
                                               {'name': 'Stereo_assigned_count', 'type': 'int', 'mandatory': True},
                                               {'name': 'Details', 'type': 'str', 'mandatory': False},
                                               {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                               {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                               {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                               ],
                         'saxs_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                            {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                            {'name': 'Details', 'type': 'str', 'mandatory': False},
                                            {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                            {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                         'other_restraint': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                             {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                             {'name': 'Definition', 'type': 'str', 'mandatory': True},
                                             {'name': 'Details', 'type': 'str', 'mandatory': False},
                                             {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                             {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                         'spectral_peak': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                           {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                           {'name': 'Number_of_spectral_dimensions', 'type': 'enum-int', 'mandatory': True,
                                            'enum': set(range(1, MAX_DIM_NUM_OF_SPECTRA)),
                                            'enforce-enum': True},
                                           {'name': 'Experiment_class', 'type': 'str', 'mandatory': False},
                                           {'name': 'Experiment_type', 'type': 'str', 'mandatory': False},
                                           {'name': 'Chemical_shift_list', 'type': 'str', 'mandatory': True},
                                           {'name': 'Details', 'type': 'str', 'mandatory': False},
                                           {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                           # allows to have software-native id starting from zero
                                           {'name': 'ID', 'type': 'int', 'mandatory': True},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                         'chem_shift': [{'name': 'Sf_category', 'type': 'str', 'mandatory': True},
                                        {'name': 'Sf_framecode', 'type': 'str', 'mandatory': True},
                                        {'name': 'Details', 'type': 'str', 'mandatory': False},
                                        {'name': 'Data_file_name', 'type': 'str', 'mandatory': False},
                                        {'name': 'ID', 'type': 'positive-int', 'mandatory': True},
                                        {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                        ]
                         }

NMR_STAR_LP_CATEGORIES = {'dist_restraint': '_Gen_dist_constraint',
                          'dihed_restraint': '_Torsion_angle_constraint',
                          'rdc_restraint': '_RDC_constraint',
                          'noepk_restraint': '_Homonucl_NOE',
                          'jcoup_restraint': '_J_three_bond_constraint',
                          'rdc_raw_data': '_RDC',
                          'csa_restraint': '_CS_anisotropy',
                          'ddc_restraint': '_Dipolar_coupling',
                          'hvycs_restraint': '_CA_CB_constraint',
                          'procs_restraint': '_H_chem_shift_constraint',
                          'csp_restraint': '_Chem_shift_perturbation',
                          'auto_relax_restraint': '_Auto_relaxation',
                          'heteronucl_noe_data': '_Heteronucl_NOE',
                          'heteronucl_t1_data': '_T1',
                          'heteronucl_t2_data': '_T2',
                          'heteronucl_t1r_data': '_T1rho',
                          'order_param_data': '_Order_param',
                          'ph_titr_data': '_PH_titr_result',
                          'ph_param_data': '_PH_param',
                          'coupling_const_data': '_Coupling_constant',
                          'ccr_d_csa_restraint': '_Cross_correlation_D_CSA',
                          'ccr_dd_restraint': '_Cross_correlation_DD',
                          'fchiral_restraint': '_Floating_chirality',
                          'saxs_restraint': '_SAXS_constraint',
                          'other_restraint': '_Other_data',
                          'spectral_peak': '_Peak_row_format',
                          'chem_shift': '_Atom_chem_shift'
                          }

NMR_STAR_LP_KEY_ITEMS = {'dist_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                            {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                             'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                            {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                            {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                            {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_1', 'type': 'str'},
                                            {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                             'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                            {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                            {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                            {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                            {'name': 'Atom_ID_2', 'type': 'str'}
                                            ],
                         'dihed_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                             {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                             {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_1', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                             {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                             {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_2', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                             {'name': 'Entity_ID_3', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                             {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_3', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                             {'name': 'Entity_ID_4', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                             {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_4', 'type': 'str'}
                                             ],
                         'rdc_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                           {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                            'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                           {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                           {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                           {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID_1', 'type': 'str'},
                                           {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                            'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                           {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                           {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                           {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID_2', 'type': 'str'}
                                           ],
                         # allows to have software-native id starting from zero
                         'noepk_restraint': [{'name': 'ID', 'type': 'int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                             {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                             {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_1', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                             {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                             {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_2', 'type': 'str'}
                                             ],
                         'jcoup_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                             {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                             {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_1', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                             {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                             {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_2', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                             {'name': 'Entity_ID_3', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                             {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_3', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                             {'name': 'Entity_ID_4', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                             {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_4', 'type': 'str'}
                                             ],
                         'rdc_raw_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                          {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                          {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                          {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                          {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                          {'name': 'Atom_ID_1', 'type': 'str'},
                                          {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                          {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                          {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                          {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                          {'name': 'Atom_ID_2', 'type': 'str'}
                                          ],
                         'csa_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                           {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Entity_ID', 'type': 'positive-int'},
                                           {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                           {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID', 'type': 'str'}
                                           ],
                         'ddc_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                           {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                           {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                           {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID_1', 'type': 'str'},
                                           {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                           {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                           {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID_2', 'type': 'str'}
                                           ],
                         'hvycs_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                             {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                             {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_1', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                             {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                             {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_2', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_3'},
                                             {'name': 'Entity_ID_3', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_3', 'type': 'int', 'default-from': 'Seq_ID_3'},
                                             {'name': 'Comp_ID_3', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_3', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_4'},
                                             {'name': 'Entity_ID_4', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_4', 'type': 'int', 'default-from': 'Seq_ID_4'},
                                             {'name': 'Comp_ID_4', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_4', 'type': 'str'},
                                             {'name': 'Entity_assembly_ID_5', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID_5'},
                                             {'name': 'Entity_ID_5', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID_5', 'type': 'int', 'default-from': 'Seq_ID_5'},
                                             {'name': 'Comp_ID_5', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID_5', 'type': 'str'}
                                             ],
                         'procs_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                              'default': '1', 'default-from': 'Auth_asym_ID'},
                                             {'name': 'Entity_ID', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                             {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID', 'type': 'str'}
                                             ],
                         'csp_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                           {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                           {'name': 'Entity_ID', 'type': 'positive-int'},
                                           {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                           {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                           {'name': 'Atom_ID', 'type': 'str'}
                                           ],
                         'auto_relax_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                  {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                  {'name': 'Entity_ID', 'type': 'positive-int'},
                                                  {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                  {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                  {'name': 'Atom_ID', 'type': 'str'}
                                                  ],
                         'heteronucl_noe_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                 {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                  'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                                 {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                                 {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                 {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID_1', 'type': 'str'},
                                                 {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                  'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                                 {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                                 {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                 {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID_2', 'type': 'str'}
                                                 ],
                         'heteronucl_t1_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                {'name': 'Entity_ID', 'type': 'positive-int'},
                                                {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                {'name': 'Atom_ID', 'type': 'str'}
                                                ],
                         'heteronucl_t2_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                {'name': 'Entity_ID', 'type': 'positive-int'},
                                                {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                {'name': 'Atom_ID', 'type': 'str'}
                                                ],
                         'heteronucl_t1r_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                 {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                                 {'name': 'Entity_ID', 'type': 'positive-int'},
                                                 {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                                 {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID', 'type': 'str'}
                                                 ],
                         'order_param_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                              {'name': 'Entity_ID', 'type': 'positive-int'},
                                              {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                              {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                              {'name': 'Atom_ID', 'type': 'str'}
                                              ],
                         'ph_titr_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                          {'name': 'Atm_obs_entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                          {'name': 'Atm_obs_entity_ID', 'type': 'positive-int'},
                                          {'name': 'Atm_obs_comp_index_ID', 'type': 'int', 'default-from': 'Atm_obs_seq_ID'},
                                          {'name': 'Atm_obs_comp_ID', 'type': 'str', 'uppercase': True},
                                          {'name': 'Atm_obs_atom_ID', 'type': 'str'},
                                          {'name': 'Atm_titr_entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                          {'name': 'Atm_titr_entity_ID', 'type': 'positive-int'},
                                          {'name': 'Atm_titr_comp_index_ID', 'type': 'int', 'default-from': 'Atm_titr_seq_ID'},
                                          {'name': 'Atm_titr_comp_ID', 'type': 'str', 'uppercase': True},
                                          {'name': 'Atm_titr_atom_ID', 'type': 'str'}
                                          ],
                         'ph_param_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True}
                                           ],
                         'coupling_const_data': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                 {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'default': '1'},
                                                 {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                                 {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                                 {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID_1', 'type': 'str'},
                                                 {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'default': '1'},
                                                 {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                                 {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                                 {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Atom_ID_2', 'type': 'str'}
                                                 ],
                         'ccr_d_csa_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                                 {'name': 'Dipole_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                  'default': '1'},
                                                 {'name': 'Dipole_entity_ID_1', 'type': 'positive-int'},
                                                 {'name': 'Dipole_comp_index_ID_1', 'type': 'int',
                                                  'default-from': 'Dipole_seq_ID_1'},
                                                 {'name': 'Dipole_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Dipole_atom_ID_1', 'type': 'str'},
                                                 {'name': 'Dipole_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                  'default': '1'},
                                                 {'name': 'Dipole_entity_ID_2', 'type': 'positive-int'},
                                                 {'name': 'Dipole_comp_index_ID_2', 'type': 'int',
                                                  'default-from': 'Dipole_seq_ID_2'},
                                                 {'name': 'Dipole_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                 {'name': 'Dipole_atom_ID_2', 'type': 'str'},
                                                 {'name': 'CSA_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                  'default': '1'},
                                                 {'name': 'CSA_entity_ID_1', 'type': 'positive-int'},
                                                 {'name': 'CSA_comp_index_ID_1', 'type': 'int', 'default-from': 'CSA_seq_ID_1'},
                                                 {'name': 'CSA_comp_ID_1', 'type': 'str', 'uppercase': True},
                                                 {'name': 'CSA_atom_ID_1', 'type': 'str'},
                                                 {'name': 'CSA_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                  'default': '1'},
                                                 {'name': 'CSA_entity_ID_2', 'type': 'positive-int'},
                                                 {'name': 'CSA_comp_index_ID_2', 'type': 'int', 'default-from': 'CSA_seq_ID_2'},
                                                 {'name': 'CSA_comp_ID_2', 'type': 'str', 'uppercase': True},
                                                 {'name': 'CSA_atom_ID_2', 'type': 'str'}
                                                 ],
                         'ccr_dd_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                              {'name': 'Dipole_1_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                               'default': '1'},
                                              {'name': 'Dipole_1 entity_ID_1', 'type': 'positive-int'},
                                              {'name': 'Dipole_1_comp_index_ID_1', 'type': 'int',
                                               'default-from': 'Dipole_1_seq_ID_1'},
                                              {'name': 'Dipole_1_comp_ID_1', 'type': 'str', 'uppercase': True},
                                              {'name': 'Dipole_1_atom_ID_1', 'type': 'str'},
                                              {'name': 'Dipole_1_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                               'default': '1'},
                                              {'name': 'Dipole_1_entity_ID_2', 'type': 'positive-int'},
                                              {'name': 'Dipole_1_comp_index_ID_2', 'type': 'int', 'default-from':
                                               'Dipole_1_seq_ID_2'},
                                              {'name': 'Dipole_1_comp_ID_2', 'type': 'str', 'uppercase': True},
                                              {'name': 'Dipole_1_atom_ID_2', 'type': 'str'},
                                              {'name': 'Dipole_2_entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                               'default': '1'},
                                              {'name': 'Dipole_2_entity_ID_1', 'type': 'positive-int'},
                                              {'name': 'Dipole_2_comp_index_ID_1', 'type': 'int', 'default-from':
                                               'Dipole_2_seq_ID_1'},
                                              {'name': 'Dipole_2_comp_ID_1', 'type': 'str', 'uppercase': True},
                                              {'name': 'Dipole_2_atom_ID_1', 'type': 'str'},
                                              {'name': 'Dipole_2_entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                               'default': '1'},
                                              {'name': 'Dipole_2_entity_ID_2', 'type': 'positive-int'},
                                              # NOTICE: 'Dipole_2_comp_index_ID_2' is inferred from NMR-STAR Dictionary
                                              {'name': 'Dipole_2_comp_index_ID_2', 'type': 'int',
                                               'default-from': 'Dipole_2_seq_ID_2'},
                                              {'name': 'Dipole_2_comp_ID_2', 'type': 'str', 'uppercase': True},
                                              {'name': 'Dipole_2_atom_ID_2', 'type': 'str'}
                                              ],
                         'fchiral_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                               {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str',
                                                'default': '1', 'default-from': 'Auth_asym_ID_1'},
                                               {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                               {'name': 'Comp_index_ID_1', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                               {'name': 'Comp_ID_1', 'type': 'str', 'uppercase': True},
                                               {'name': 'Atom_ID_1', 'type': 'str'},
                                               {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str',
                                                'default': '1', 'default-from': 'Auth_asym_ID_2'},
                                               {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                               {'name': 'Comp_index_ID_2', 'type': 'int', 'default-from': 'Seq_ID_2'},
                                               {'name': 'Comp_ID_2', 'type': 'str', 'uppercase': True},
                                               {'name': 'Atom_ID_2', 'type': 'str'}
                                               ],
                         'saxs_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                            {'name': 'Q_value', 'type': 'positive-float'}
                                            ],
                         'other_restraint': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                             {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'default': '1'},
                                             {'name': 'Entity_ID', 'type': 'positive-int'},
                                             {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID'},
                                             {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                             {'name': 'Atom_ID', 'type': 'str'}
                                             ],
                         # allows to have software-native id starting from zero
                         'spectral_peak': [{'name': 'ID', 'type': 'int', 'auto-increment': True}],
                         'chem_shift': [{'name': 'ID', 'type': 'positive-int', 'auto-increment': True},
                                        {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str',
                                         'default': '1', 'default-from': 'Auth_asym_ID'},
                                        {'name': 'Entity_ID', 'type': 'positive-int'},
                                        {'name': 'Comp_index_ID', 'type': 'int', 'default-from': 'Seq_ID_1'},
                                        {'name': 'Comp_ID', 'type': 'str', 'uppercase': True},
                                        {'name': 'Atom_ID', 'type': 'str'},
                                        {'name': 'Occupancy', 'type': 'positive-float', 'default': '.'}
                                        ]
                         }

NMR_STAR_LP_DATA_ITEMS = {'dist_restraint': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                             {'name': 'Combination_ID', 'type': 'positive-int', 'mandatory': False,
                                              'enforce-non-zero': True},
                                             {'name': 'Member_ID', 'type': 'positive-int', 'mandatory': False,
                                              'enforce-non-zero': True},
                                             {'name': 'Member_logic_code', 'type': 'enum', 'mandatory': False,
                                              'enum': ('OR', 'AND'),
                                              'enforce-enum': True},
                                             {'name': 'Target_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True, 'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': DIST_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Lower_linear_limit',
                                                                        'Upper_linear_limit',
                                                                        'Distance_lower_bound_val',
                                                                        'Distance_upper_bound_val'],
                                                        'coexist-with': None,
                                                        'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val'],
                                                        'larger-than': ['Distance_upper_bound_val', 'Upper_linear_limit']}},
                                             {'name': 'Target_val_uncertainty', 'type': 'range-float', 'mandatory': False,
                                              'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': DIST_UNCERTAINTY_RANGE},
                                             {'name': 'Lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True, 'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': DIST_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_val',
                                                                        'Upper_linear_limit',
                                                                        'Distance_lower_bound_val',
                                                                        'Distance_upper_bound_val'],
                                                        'coexist-with': None,
                                                        # ['Upper_linear_limit', 'Distance_lower_bound_val',
                                                        #  'Distance_upper_bound_val'],
                                                        'smaller-than': None,
                                                        'larger-than': ['Distance_lower_bound_val', 'Distance_upper_bound_val',
                                                                        'Upper_linear_limit']}},
                                             {'name': 'Distance_lower_bound_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True, 'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': DIST_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_val', 'Lower_linear_limit',
                                                                        'Upper_linear_limit', 'Distance_upper_bound_val'],
                                                        'coexist-with': None,  # ['Distance_upper_bound_val'],
                                                        'smaller-than': ['Lower_linear_limit'],
                                                        'larger-than': ['Distance_upper_bound_val', 'Upper_linear_limit']}},
                                             {'name': 'Distance_upper_bound_val', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True, 'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': DIST_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_val', 'Lower_linear_limit',
                                                                        'Upper_linear_limit', 'Distance_lower_bound_val'],
                                                        'coexist-with': None,  # ['Distance_lower_bound_val'],
                                                        'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val'],
                                                        'larger-than': ['Upper_linear_limit']}},
                                             {'name': 'Upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                              'group-mandatory': True, 'void-zero': True,
                                              'clear-bad-pattern': True,
                                              'range': DIST_RESTRAINT_RANGE,
                                              'group': {'member-with': ['Target_val',
                                                                        'Lower_linear_limit',
                                                                        'Distance_lower_bound_val',
                                                                        'Distance_upper_bound_val'],
                                                        'coexist-with': None,
                                                        # ['Lower_linear_limit', 'Distance_lower_bound_val',
                                                        #  'Distance_upper_bound_val'],
                                                        'smaller-than': ['Lower_linear_limit', 'Distance_lower_bound_val',
                                                                         'Distance_upper_bound_val'],
                                                        'larger-than': None}},
                                             {'name': 'Weight', 'type': 'range-float', 'mandatory': False,
                                              'range': WEIGHT_RANGE},
                                             # 'enforce-non-zero': True},
                                             {'name': 'Distance_val', 'type': 'range-float', 'mandatory': False,
                                                      'range': DIST_RESTRAINT_RANGE},
                                             {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_name_1', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                             {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Auth_atom_name_2', 'type': 'str', 'mandatory': False},
                                             {'name': 'Gen_dist_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                          'dihed_restraint': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                              {'name': 'Combination_ID', 'type': 'positive-int', 'mandatory': False,
                                               'enforce-non-zero': True},
                                              {'name': 'Torsion_angle_name', 'type': 'str', 'mandatory': False},
                                              {'name': 'Angle_target_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': ANGLE_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Angle_lower_linear_limit',
                                                                         'Angle_upper_linear_limit',
                                                                         'Angle_lower_bound_val',
                                                                         'Angle_upper_bound_val'],
                                                         'coexist-with': None,
                                                         # (DAOTHER-8442) ['Angle_lower_linear_limit', 'Angle_lower_bound_val'],
                                                         'smaller-than': None,
                                                         # (DAOTHER-8442) ['Angle_upper_bound_val', 'Angle_upper_linear_limit'],
                                                         'larger-than': None,
                                                         'circular-shift': 360.0}},
                                              {'name': 'Angle_target_val_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': ANGLE_UNCERTAINTY_RANGE},
                                              {'name': 'Angle_lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': ANGLE_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Angle_target_val', 'Angle_upper_linear_limit',
                                                                         'Angle_lower_bound_val', 'Angle_upper_bound_val'],
                                                         # ['Angle_upper_linear_limit', 'Angle_lower_bound_val',
                                                         #  'Angle_upper_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': None,
                                                         'larger-than': ['Angle_lower_bound_val'],
                                                         # (DAOTHER-8442) ['Angle_lower_bound_val', 'Angle_upper_bound',
                                                         #                 'Angle_upper_linear_limit'],
                                                         'circular-shift': 360.0}},
                                              {'name': 'Angle_lower_bound_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': ANGLE_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Angle_target_val', 'Angle_lower_linear_limit',
                                                                         'Angle_upper_linear_limit', 'Angle_upper_bound_val'],
                                                         'coexist-with': None,  # ['Angle_upper_bound_val'],
                                                         'smaller-than': ['Angle_lower_linear_limit'],
                                                         # (DAOTHER-8442) ['Angle_upper_bound_val', 'Angle_upper_linear_limit'],
                                                         'larger-than': None,
                                                         'circular-shift': 360.0}},
                                              {'name': 'Angle_upper_bound_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': ANGLE_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Angle_target_val', 'Angle_lower_linear_limit',
                                                                         'Angle_upper_linear_limit', 'Angle_lower_bound_val'],
                                                         'coexist-with': None,  # ['Angle_lower_bound_val'],
                                                         # (DAOTHER-8442) ['Angle_lower_bound_val', 'Angle_upper_linear_limit'],
                                                         'smaller-than': None,
                                                         'larger-than': ['Angle_upper_linear_limit'],
                                                         'circular-shift': 360.0}},
                                              {'name': 'Angle_upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': ANGLE_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Angle_target_val', 'Angle_lower_linear_limit',
                                                                         'Angle_lower_bound_val', 'Angle_upper_bound_val'],
                                                         # ['Angle_lower_linear_limit', 'Angle_lower_bound_val',
                                                         #  'Angle_upper_bound_val'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Angle_upper_bound_val'],
                                                         # (DAOTHER-8442) ['Angle_lower_linear_limit', 'Angle_lower_bound_val',
                                                         #                 'Angle_upper_bound_val'],
                                                         'larger-than': None,
                                                         'circular-shift': 360.0}},
                                              {'name': 'Weight', 'type': 'range-float', 'mandatory': False,
                                               'range': WEIGHT_RANGE},
                                              # 'enforce-non-zero': True},
                                              {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_name_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_name_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_name_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_name_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Torsion_angle_constraint_list_ID', 'type': 'pointer-index',
                                               'mandatory': True, 'default': '1', 'default-from': 'parent'},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                          'rdc_restraint': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                            {'name': 'Combination_ID', 'type': 'positive-int', 'mandatory': False,
                                             'enforce-non-zero': True},
                                            {'name': 'Target_value', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['RDC_lower_linear_limit', 'RDC_upper_linear_limit',
                                                                       'RDC_lower_bound', 'RDC_upper_bound'],
                                                       'coexist-with': None,
                                                       'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound'],
                                                       'larger-than': ['RDC_upper_bound', 'RDC_upper_linear_limit']}},
                                            {'name': 'Target_value_uncertainty', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_UNCERTAINTY_RANGE},
                                            {'name': 'RDC_lower_linear_limit', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Target_value', 'RDC_upper_linear_limit',
                                                                       'RDC_lower_bound', 'RDC_upper_bound'],
                                                       # ['RDC_upper_linear_limit', 'RDC_lower_bound', 'RDC_upper_bound'],
                                                       'coexist-with': None,
                                                       'smaller-than': None,
                                                       'larger-than': ['RDC_lower_bound', 'RDC_upper_bound',
                                                                       'RDC_upper_linear_limit']}},
                                            {'name': 'RDC_lower_bound', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Target_value', 'RDC_lower_linear_limit',
                                                                       'RDC_upper_linear_limit', 'RDC_upper_bound'],
                                                       # ['RDC_upper_bound'],
                                                       'coexist-with': None,
                                                       'smaller-than': ['RDC_lower_linear_limit'],
                                                       'larger-than': ['RDC_upper_bound', 'RDC_upper_linear_limit']}},
                                            {'name': 'RDC_upper_bound', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Target_value', 'RDC_lower_linear_limit',
                                                                       'RDC_upper_linear_limit', 'RDC_lower_bound'],
                                                       # ['RDC_lower_bound'],
                                                       'coexist-with': None,
                                                       'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound'],
                                                       'larger-than': ['RDC_upper_linear_limit']}},
                                            {'name': 'RDC_upper_linear_limit', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Target_value', 'RDC_upper_linear_limit',
                                                                       'RDC_lower_bound', 'RDC_upper_bound'],
                                                       # ['RDC_upper_linear_limit', 'RDC_lower_bound', 'RDC_upper_bound'],
                                                       'coexist-with': None,
                                                       'smaller-than': ['RDC_lower_linear_limit', 'RDC_lower_bound',
                                                                        'RDC_upper_bound'],
                                                       'larger-than': None}},
                                            {'name': 'Weight', 'type': 'range-float', 'mandatory': False,
                                             'range': WEIGHT_RANGE},
                                            # 'enforce-non-zero': True},
                                            {'name': 'RDC_val', 'type': 'range-float', 'mandatory': False,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE},
                                            {'name': 'RDC_val_err', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_UNCERTAINTY_RANGE},
                                            {'name': 'RDC_val_scale_factor', 'type': 'range-float', 'mandatory': False,
                                             'range': SCALE_RANGE,
                                             'enforce-non-zero': True},
                                            {'name': 'RDC_distant_dependent', 'type': 'bool', 'mandatory': False},
                                            {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_name_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_name_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'RDC_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                             'default': '1', 'default-from': 'parent'},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                          'noepk_restraint': [{'name': 'Val', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'group': {'member-with': ['Val_min', 'Val_max'],
                                                         'coexist-with': None,
                                                         'smaller-than': None,
                                                         'larger-than': None}},
                                              {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': {'min_inclusive': 0.0}},
                                              {'name': 'Val_min', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'group': {'member-with': ['Val', 'Val_max'],
                                                         'coexist-with': None,
                                                         'smaller-than': None,
                                                         'larger-than': ['Val_max']}},
                                              {'name': 'Val_max', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'group': {'member-with': ['Val', 'Val_min'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Val_min'],
                                                         'larger-than': None}},
                                              {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Homonucl_NOE_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                               'default': '1', 'default-from': 'parent'},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                          'jcoup_restraint': [{'name': 'Coupling_constant_val', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': RDC_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Coupling_constant_lower_bound',
                                                                         'Coupling_constant_upper_bound'],
                                                         'coexist-with': None,
                                                         'smaller-than': None,
                                                         'larger-than': None}},
                                              {'name': 'Coupling_constant_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': {'min_inclusive': 0.0}},
                                              {'name': 'Coupling_constant_lower_bound', 'type': 'range-float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': RDC_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Coupling_constant_upper_bound'],
                                                         'coexist-with': None,
                                                         'smaller-than': None,
                                                         'larger-than': ['Coupling_constant_upper_bound']}},
                                              {'name': 'Coupling_constant_upper_bound', 'type': 'float', 'mandatory': False,
                                               'group-mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': RDC_RESTRAINT_RANGE,
                                               'group': {'member-with': ['Coupling_constant_lower_bound'],
                                                         'coexist-with': None,
                                                         'smaller-than': ['Coupling_constant_lower_bound'],
                                                         'larger-than': None}},
                                              {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'J_three_bond_constraint_list_ID', 'type': 'pointer-index',
                                               'mandatory': True, 'default': '1', 'default-from': 'parent'},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                          'rdc_raw_data': [{'name': 'RDC_code', 'type': 'str', 'mandatory': True},
                                           {'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                            'default-from': 'Atom_ID_1',
                                            'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                            'enforce-enum': True},
                                           {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                            'default-from': 'Atom_ID_1',
                                            'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                            'enforce-enum': True},
                                           {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                            'enum': ALLOWED_AMBIGUITY_CODES,
                                            'enforce-enum': True},
                                           {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                            'default-from': 'Atom_ID_2',
                                            'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                            'enforce-enum': True},
                                           {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                            'default-from': 'Atom_ID_2',
                                            'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                            'enforce-enum': True},
                                           {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                            'enum': ALLOWED_AMBIGUITY_CODES,
                                            'enforce-enum': True},
                                           {'name': 'Val', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                            'clear-bad-pattern': True,
                                            'group': {'member-with': ['Val_min', 'Val_max'],
                                                      'coexist-with': None,
                                                      'smaller-than': None,
                                                      'larger-than': None}},
                                           {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                            'void-zero': True,
                                            'clear-bad-pattern': True,
                                            'range': {'min_inclusive': 0.0}},
                                           {'name': 'Val_min', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                            'clear-bad-pattern': True,
                                            'group': {'member-with': ['Val', 'Val_max'],
                                                      'coexist-with': None,
                                                      'smaller-than': None,
                                                      'larger-than': ['Val_max']}},
                                           {'name': 'Val_max', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                            'clear-bad-pattern': True,
                                            'group': {'member-with': ['Val', 'Val_min'],
                                                      'coexist-with': None,
                                                      'smaller-than': ['Val_min'],
                                                      'larger-than': None}},
                                           {'name': 'Val_bond_length', 'type': 'range-float', 'mandatory': False,
                                            'range': DIST_RESTRAINT_RANGE},
                                           {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                           {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                           {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                           {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                           {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                           {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                           {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                           {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                           {'name': 'RDC_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                            'default': '1', 'default-from': 'parent'},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                          'csa_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atom_ID',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atom_ID',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': CSA_RESTRAINT_RANGE},
                                            {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': {'min_inclusive': 0.0}},
                                            {'name': 'Principal_value_sigma_11_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': CSA_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_value_sigma_22_val',
                                                                       'Principal_value_sigma_33_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_value_sigma_22_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': CSA_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_value_sigma_11_val',
                                                                       'Principal_value_sigma_33_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_value_sigma_33_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': CSA_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_value_sigma_11_val',
                                                                       'Principal_value_sigma_22_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_Euler_angle_alpha_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': ANGLE_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_Euler_angle_beta_val',
                                                                       'Principal_Euler_angle_gamma_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_Euler_angle_beta_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': ANGLE_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                       'Principal_Euler_angle_gamma_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_Euler_angle_gamma_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': ANGLE_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                       'Principal_Euler_angle_beta_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Bond_length', 'type': 'range-float', 'mandatory': False,
                                             'range': DIST_RESTRAINT_RANGE},
                                            {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Chem_shift_anisotropy_ID', 'type': 'pointer-index', 'mandatory': True,
                                             'default': '1', 'default-from': 'parent'},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                          'ddc_restraint': [{'name': 'Dipolar_coupling_code', 'type': 'str', 'mandatory': True},
                                            {'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atom_ID_1',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atom_ID_1',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                             'enum': ALLOWED_AMBIGUITY_CODES,
                                             'enforce-enum': True},
                                            {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atom_ID_2',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atom_ID_2',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                             'enum': ALLOWED_AMBIGUITY_CODES,
                                             'enforce-enum': True},
                                            {'name': 'Val', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Val_min', 'Val_max'],
                                                       'coexist-with': None,
                                                       'smaller-than': None,
                                                       'larger-than': None}},
                                            {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': {'min_inclusive': 0.0}},
                                            {'name': 'Val_min', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Val_max'],
                                                       'coexist-with': None,
                                                       'smaller-than': None,
                                                       'larger-than': ['Val_max']}},
                                            {'name': 'Val_max', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                             'clear-bad-pattern': True,
                                             'range': RDC_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Val_min'],
                                                       'coexist-with': None,
                                                       'smaller-than': ['Val_min'],
                                                       'larger-than': None}},
                                            {'name': 'Principal_Euler_angle_alpha_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': ANGLE_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_Euler_angle_beta_val',
                                                                       'Principal_Euler_angle_gamma_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_Euler_angle_beta_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': ANGLE_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                       'Principal_Euler_angle_gamma_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Principal_Euler_angle_gamma_val', 'type': 'range-float', 'mandatory': False,
                                             'group-mandatory': False,
                                             'range': ANGLE_RESTRAINT_RANGE,
                                             'group': {'member-with': ['Principal_Euler_angle_alpha_val',
                                                                       'Principal_Euler_angle_beta_val'],
                                                       'coexist-with': None}},
                                            {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                            {'name': 'Dipolar_coupling_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                             'default': '1', 'default-from': 'parent'},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                          'hvycs_restraint': [{'name': 'CA_chem_shift_val', 'type': 'range-float', 'mandatory': True,
                                               'clear-bad-pattern': True,
                                               'range': CS_RESTRAINT_RANGE},
                                              {'name': 'CA_chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': CS_UNCERTAINTY_RANGE},
                                              {'name': 'CB_chem_shift_val', 'type': 'range-float', 'mandatory': False,
                                               'clear-bad-pattern': True,
                                               'range': CS_RESTRAINT_RANGE},
                                              {'name': 'CB_chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': CS_UNCERTAINTY_RANGE},
                                              {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_asym_ID_5', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID_5', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID_5', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID_5', 'type': 'str', 'mandatory': False},
                                              {'name': 'CA_CB_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                               'default': '1', 'default-from': 'parent'},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                          'procs_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                               'default-from': 'Atom_ID',
                                               'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                               'enforce-enum': True},
                                              {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                               'default-from': 'Atom_ID',
                                               'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                               'enforce-enum': True},
                                              {'name': 'Chem_shift_val', 'type': 'range-float', 'mandatory': True,
                                               'remove-bad-pattern': True,
                                               'range': CS_RESTRAINT_RANGE},
                                              {'name': 'Chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': CS_UNCERTAINTY_RANGE},
                                              {'name': 'Auth_asym_ID', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                              {'name': 'H_chem_shift_constraint_list_ID', 'type': 'pointer-index',
                                               'mandatory': True, 'default': '1', 'default-from': 'parent'},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                          'csp_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                             'default-from': 'Atom_ID',
                                             'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                             'enforce-enum': True},
                                            {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                             'default-from': 'Atom_ID',
                                             'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                             'enforce-enum': True},
                                            {'name': 'Chem_shift_val', 'type': 'range-float', 'mandatory': False,
                                             'clear-bad-pattern': True,
                                             'range': CS_RESTRAINT_RANGE},
                                            {'name': 'Chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': CS_UNCERTAINTY_RANGE},
                                            {'name': 'Difference_chem_shift_val', 'type': 'range-float', 'mandatory': False,
                                             'clear-bad-pattern': True,
                                             'range': CS_RESTRAINT_RANGE},
                                            {'name': 'Difference_chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                             'void-zero': True,
                                             'clear-bad-pattern': True,
                                             'range': CS_UNCERTAINTY_RANGE},
                                            {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                            {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                            {'name': 'Chem_shift_perturbation_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                             'default': '1', 'default-from': 'parent'},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                          'auto_relax_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                    'default-from': 'Atom_ID',
                                                    'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                    'enforce-enum': True},
                                                   {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                    'default-from': 'Atom_ID',
                                                    'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                    'enforce-enum': True},
                                                   {'name': 'Auto_relaxation_val', 'type': 'range-float', 'mandatory': True,
                                                    'remove-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Auto_relaxation_val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Rex_val', 'type': 'range-float', 'mandatory': False,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Rex_val_err', 'type': 'range-float', 'mandatory': False,
                                                    'void-zero': True,
                                                    'clear-bad-pattern': True,
                                                    'range': PRE_RESTRAINT_RANGE},
                                                   {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                   {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                   {'name': 'Auto_relaxation_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                    'default': '1', 'default-from': 'parent'},
                                                   {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                   ],
                          'heteronucl_noe_data': [{'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID_1',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID_1',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID_2',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID_2',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Val', 'type': 'float', 'mandatory': True,
                                                   'remove-bad-pattern': True},
                                                  {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': {'min_inclusive': 0.0}},
                                                  {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Heteronucl_NOE_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                   'default': '1', 'default-from': 'parent'},
                                                  {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                  ],
                          'heteronucl_t1_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                  'default-from': 'Atom_ID',
                                                  'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                  'enforce-enum': True},
                                                 {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                  'default-from': 'Atom_ID',
                                                  'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                  'enforce-enum': True},
                                                 {'name': 'Val', 'type': 'float', 'mandatory': True,
                                                  'remove-bad-pattern': True},
                                                 {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                  'void-zero': True,
                                                  'clear-bad-pattern': True,
                                                  'range': {'min_inclusive': 0.0}},
                                                 {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                 {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Heteronucl_T1_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                  'default': '1', 'default-from': 'parent'},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                 ],
                          'heteronucl_t2_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                  'default-from': 'Atom_ID',
                                                  'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                  'enforce-enum': True},
                                                 {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                  'default-from': 'Atom_ID',
                                                  'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                  'enforce-enum': True},
                                                 {'name': 'T2_val', 'type': 'float', 'mandatory': True,
                                                  'remove-bad-pattern': True},
                                                 {'name': 'T2_val_err', 'type': 'range-float', 'mandatory': False,
                                                  'void-zero': True,
                                                  'clear-bad-pattern': True,
                                                  'range': {'min_inclusive': 0.0}},
                                                 {'name': 'Rex_val', 'type': 'float', 'mandatory': False,
                                                  'clear-bad-pattern': True},
                                                 {'name': 'Rex_err', 'type': 'range-float', 'mandatory': False,
                                                  'void-zero': True,
                                                  'clear-bad-pattern': True,
                                                  'range': {'min_inclusive': 0.0}},
                                                 {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                 {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Heteronucl_T2_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                  'default': '1', 'default-from': 'parent'},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                 ],
                          'heteronucl_t1r_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'T1rho_val', 'type': 'float', 'mandatory': True,
                                                   'remove-bad-pattern': True},
                                                  {'name': 'T1rho_val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': {'min_inclusive': 0.0}},
                                                  {'name': 'Rex_val', 'type': 'float', 'mandatory': False,
                                                   'clear-bad-pattern': True},
                                                  {'name': 'Rex_val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': {'min_inclusive': 0.0}},
                                                  {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Heteronucl_T1rho_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                   'default': '1', 'default-from': 'parent'},
                                                  {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                  ],
                          'order_param_data': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Atom_ID',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Atom_ID',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Order_param_val', 'type': 'range-float', 'mandatory': True,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'Order_param_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'Tau_e_val', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Tau_e_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Tau_f_val', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Tau_f_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Tau_s_val', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Tau_s_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Rex_val', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PRE_RESTRAINT_RANGE},
                                               {'name': 'Rex_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': PRE_RESTRAINT_RANGE},
                                               {'name': 'Model_free_sum_squared_errs', 'type': 'positive-float', 'mandatory': False,
                                                'clear-bad-pattern': True},
                                               {'name': 'Model_fit', 'type': 'enum', 'mandatory': False,
                                                'enum': ('Rex', 'S2', 'S2, te', 'S2, Rex', 'S2, te, Rex', 'S2f, S2, ts',
                                                         'S2f, S2s, ts', 'S2f, tf, S2, ts', 'S2f, tf, S2s, ts', 'S2f, S2, ts, Rex',
                                                         'S2f, S2s, ts, Rex', 'S2f, tf, S2, ts, Rex', 'S2f, tf, S2s, ts, Rex',
                                                         'na')},
                                               {'name': 'Sf2_val', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'Sf2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'Ss2_val', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'Ss2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'SH2_val', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'SH2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'SN2_val', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'SN2_val_fit_err', 'type': 'range-float', 'mandatory': False,
                                                'clear-bad-pattern': True,
                                                'range': PROBABILITY_RANGE},
                                               {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                               {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                               {'name': 'Order_parameter_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                'default': '1', 'default-from': 'parent'},
                                               {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                               ],
                          'ph_titr_data': [{'name': 'Atm_obs_atom_type', 'type': 'enum', 'mandatory': True,
                                            'default-from': 'Atm_obs_atom_ID',
                                            'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                            'enforce-enum': True},
                                           {'name': 'Atm_obs_atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                            'default-from': 'Atm_obs_atom_ID',
                                            'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                            'enforce-enum': True},
                                           {'name': 'Atm_titr_atom_type', 'type': 'enum', 'mandatory': True,
                                            'default-from': 'Atm_titr_atom_ID',
                                            'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                            'enforce-enum': True},
                                           {'name': 'Atm_titr_atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                            'default-from': 'Atm_titr_atom_ID',
                                            'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                            'enforce-enum': True},
                                           {'name': 'Hill_coeff_val', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'Hill_coeff_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'High_PH_param_fit_val', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'High_PH_param_fit_val_err', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'Low_PH_param_fit_val', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'Low_PH_param_fit_val_err', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'PKa_val', 'type': 'positive-float', 'mandatory': True,
                                            'clear-bad-pattern': True},
                                           {'name': 'PKa_val_fit_err', 'type': 'positive-float', 'mandatory': True,
                                            'clear-bad-pattern': True},
                                           {'name': 'PHmid_val', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'PHmid_val_fit_err', 'type': 'positive-float', 'mandatory': False,
                                            'clear-bad-pattern': True},
                                           {'name': 'Atm_obs_auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Atm_obs_auth_seq_ID', 'type': 'int', 'mandatory': False},
                                           {'name': 'Atm_obs_auth_comp_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Atm_obs_auth_atom_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Atm_titr_auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Atm_titr_auth_seq_ID', 'type': 'int', 'mandatory': False},
                                           {'name': 'Atm_titr_auth_comp_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'Atm_titr_auth_atom_ID', 'type': 'str', 'mandatory': False},
                                           {'name': 'PH_titration_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                            'default': '1', 'default-from': 'parent'},
                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                           ],
                          'ph_param_data': [{'name': 'PH_titr_result_ID', 'type': 'positive-int', 'mandatory': True},
                                            {'name': 'PH_val', 'type': 'positive-float', 'mandatory': True},
                                            {'name': 'PH_val_err', 'type': 'positive-float', 'mandatory': False},
                                            {'name': 'Observed_NMR_param_val', 'type': 'positive-float', 'mandatory': True},
                                            {'name': 'Observed_NMR_param_val_err', 'type': 'positive-float', 'mandatory': False},
                                            {'name': 'PH_param_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                             'default': '1', 'default-from': 'parent'},
                                            {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                            ],
                          'coupling_const_data': [{'name': 'Code', 'type': 'str', 'mandatory': True},
                                                  {'name': 'Atom_type_1', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID_1',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID_1',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                                   'enum': ALLOWED_AMBIGUITY_CODES,
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_type_2', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Atom_ID_2',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Atom_ID_2',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                                   'enum': ALLOWED_AMBIGUITY_CODES,
                                                   'enforce-enum': True},
                                                  {'name': 'Val', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'group': {'member-with': ['Val_min', 'Val_max'],
                                                             'coexist-with': None,
                                                             'smaller-than': None,
                                                             'larger-than': None}},
                                                  {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': {'min_inclusive': 0.0}},
                                                  {'name': 'Val_min', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'group': {'member-with': ['Val', 'Val_max'],
                                                             'coexist-with': None,
                                                             'smaller-than': None,
                                                             'larger-than': ['Val_max']}},
                                                  {'name': 'Val_max', 'type': 'float', 'mandatory': False, 'group-mandatory': True,
                                                   'clear-bad-pattern': True,
                                                   'group': {'member-with': ['Val', 'Val_min'],
                                                             'coexist-with': None,
                                                             'smaller-than': ['Val_min'],
                                                             'larger-than': None}},
                                                  {'name': 'Auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Coupling_constant_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                   'default': '1', 'default-from': 'parent'},
                                                  {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                  ],
                          'ccr_d_csa_restraint': [{'name': 'Dipole_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Dipole_atom_ID_1',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Dipole_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Dipole_atom_ID_1',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Dipole_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'Dipole_atom_ID_2',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'Dipole_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'Dipole_atom_ID_2',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'CSA_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'CSA_atom_ID_1',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'CSA_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'CSA_atom_ID_1',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'CSA_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                   'default-from': 'CSA_atom_ID_2',
                                                   'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                   'enforce-enum': True},
                                                  {'name': 'CSA_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                   'default-from': 'CSA_atom_ID_2',
                                                   'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                   'enforce-enum': True},
                                                  {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                                   'remove-bad-pattern': True,
                                                   'range': CCR_RESTRAINT_RANGE},
                                                  {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                   'void-zero': True,
                                                   'clear-bad-pattern': True,
                                                   'range': CCR_RESTRAINT_RANGE},
                                                  {'name': 'Dipole_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Dipole_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Dipole_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Dipole_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Dipole_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Dipole_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                  {'name': 'Dipole_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Dipole_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'CSA_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'CSA_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                  {'name': 'CSA_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'CSA_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                  {'name': 'CSA_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'CSA_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                  {'name': 'CSA_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'CSA_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                  {'name': 'Cross_correlation_D_CSA_list_ID', 'type': 'pointer-index',
                                                   'mandatory': True, 'default': '1', 'default-from': 'parent'},
                                                  {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                  ],
                          'ccr_dd_restraint': [{'name': 'Dipole_1_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Dipole_1_atom_ID_1',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_1_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Dipole_1_atom_ID_1',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_1_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Dipole_1_atom_ID_2',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_1_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Dipole_1_atom_ID_2',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_2_atom_type_1', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Dipole_2_atom_ID_1',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_2_atom_isotope_number_1', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Dipole_2_atom_ID_1',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_2_atom_type_2', 'type': 'enum', 'mandatory': True,
                                                'default-from': 'Dipole_2_atom_ID_2',
                                                'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                'enforce-enum': True},
                                               {'name': 'Dipole_2_atom_isotope_number_2', 'type': 'enum-int', 'mandatory': True,
                                                'default-from': 'Dipole_2_atom_ID_2',
                                                'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                'enforce-enum': True},
                                               {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                                'remove-bad-pattern': True,
                                                'range': CCR_RESTRAINT_RANGE},
                                               {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                                'void-zero': True,
                                                'clear-bad-pattern': True,
                                                'range': CCR_RESTRAINT_RANGE},
                                               {'name': 'Dipole_1_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_1_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_entity_assembly_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_entity_assembly_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Dipole_2_auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                               {'name': 'Cross_correlation_DD_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                'default': '1', 'default-from': 'parent'},
                                               {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                               ],
                          'fchiral_restraint': [{'name': 'Stereospecific_assignment_code', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                                {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                                {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                                {'name': 'Floating_chirality_assign_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                ],
                          'saxs_restraint': [{'name': 'Intensity_val', 'type': 'float', 'mandatory': True,
                                              'remove-bad-pattern': True},
                                             {'name': 'Intensity_val_err', 'type': 'float', 'mandatory': True,
                                              'clear-bad-pattern': True},
                                             {'name': 'Weight_val', 'type': 'range-float', 'mandatory': False,
                                              'range': WEIGHT_RANGE},
                                             {'name': 'SAXS_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                              'default': '1', 'default-from': 'parent'},
                                             {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                             ],
                          'other_restraint': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                               'default-from': 'Atom_ID',
                                               'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                               'enforce-enum': True},
                                              {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                               'default-from': 'Atom_ID',
                                               'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                               'enforce-enum': True},
                                              {'name': 'Val', 'type': 'float', 'mandatory': True,
                                               'remove-bad-pattern': True},
                                              {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                               'void-zero': True,
                                               'clear-bad-pattern': True,
                                               'range': {'min_inclusive': 0.0}},
                                              {'name': 'Auth_entity_assembly_ID', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                              {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                              {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                              {'name': 'Other_data_type_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                               'default': '1', 'default-from': 'parent'},
                                              {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                              ],
                          'peak2d': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                     {'name': 'Position_1', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_1', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_1', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_1', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Position_2', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_2', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_2', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_2', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Volume', 'type': 'float', 'mandatory': False},
                                     {'name': 'Volume_uncertainty', 'type': 'float', 'mandatory': False},
                                     {'name': 'Height', 'type': 'float', 'mandatory': False},
                                     {'name': 'Height_uncertainty', 'type': 'float', 'mandatory': False},
                                     {'name': 'Figure_of_merit', 'type': 'range-float', 'mandatory': False,
                                      'range': WEIGHT_RANGE},
                                     {'name': 'Details', 'type': 'str', 'mandatory': False},
                                     {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                      'default': '1', 'default-from': 'parent'},
                                     {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                     ],
                          'peak3d': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                     {'name': 'Position_1', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_1', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_1', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_1', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Position_2', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_2', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_2', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_2', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Position_3', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_3', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_3', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_3', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_3', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_3', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_3', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_3', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_3', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_3', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Volume', 'type': 'float', 'mandatory': False},
                                     {'name': 'Volume_uncertainty', 'type': 'float', 'mandatory': False},
                                     {'name': 'Height', 'type': 'float', 'mandatory': False},
                                     {'name': 'Height_uncertainty', 'type': 'float', 'mandatory': False},
                                     {'name': 'Figure_of_merit', 'type': 'range-float', 'mandatory': False,
                                      'range': WEIGHT_RANGE},
                                     {'name': 'Details', 'type': 'str', 'mandatory': False},
                                     {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                      'default': '1', 'default-from': 'parent'},
                                     {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                     ],
                          'peak4d': [{'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                     {'name': 'Position_1', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_1', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_1', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_1', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_1', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_1', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_1', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_1', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_1', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_1', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Position_2', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_2', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_2', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_2', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_2', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_2', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_2', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_2', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_2', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_2', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Position_3', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_3', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_3', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_3', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_3', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_3', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_3', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_3', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_3', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_3', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_3', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_3', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_3', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Position_4', 'type': 'float', 'mandatory': True},
                                     {'name': 'Position_uncertainty_4', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_4', 'type': 'float', 'mandatory': False},
                                     {'name': 'Line_width_uncertainty_4', 'type': 'float', 'mandatory': False},
                                     {'name': 'Entity_assembly_ID_4', 'type': 'positive-int-as-str', 'mandatory': False},
                                     {'name': 'Entity_ID_4', 'type': 'positive-int'},
                                     {'name': 'Comp_index_ID_4', 'type': 'int', 'mandatory': False},
                                     {'name': 'Comp_ID_4', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                     {'name': 'Atom_ID_4', 'type': 'str', 'mandatory': False},
                                     {'name': 'Ambiguity_code_4', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES},
                                     {'name': 'Ambiguity_set_ID_4', 'type': 'positive-int', 'mandatory': False},
                                     {'name': 'Auth_asym_ID_4', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_seq_ID_4', 'type': 'int', 'mandatory': False},
                                     {'name': 'Auth_comp_ID_4', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_atom_ID_4', 'type': 'str', 'mandatory': False},
                                     {'name': 'Auth_ambiguity_code_4', 'type': 'enum-int', 'mandatory': False,
                                      'enum': ALLOWED_AMBIGUITY_CODES,
                                      'enforce-enum': True},
                                     {'name': 'Volume', 'type': 'float', 'mandatory': False},
                                     {'name': 'Volume_uncertainty', 'type': 'float', 'mandatory': False},
                                     {'name': 'Height', 'type': 'float', 'mandatory': False},
                                     {'name': 'Height_uncertainty', 'type': 'float', 'mandatory': False},
                                     {'name': 'Figure_of_merit', 'type': 'range-float', 'mandatory': False,
                                      'range': WEIGHT_RANGE},
                                     {'name': 'Details', 'type': 'str', 'mandatory': False},
                                     {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                      'default': '1', 'default-from': 'parent'},
                                     {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                     ],
                          'chem_shift': [{'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                          'default-from': 'Atom_ID',
                                          'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                          'enforce-enum': True},
                                         {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                          'default-from': 'Atom_ID',
                                          'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                          'enforce-enum': True},
                                         {'name': 'Val', 'type': 'range-float', 'mandatory': True,
                                          'remove-bad-pattern': True,
                                          'range': CS_RESTRAINT_RANGE},
                                         {'name': 'Val_err', 'type': 'range-float', 'mandatory': False,
                                          'void-zero': True,
                                          'clear-bad-pattern': True,
                                          'range': CS_UNCERTAINTY_RANGE},
                                         {'name': 'Ambiguity_code', 'type': 'enum-int', 'mandatory': False,
                                          'enum': ALLOWED_AMBIGUITY_CODES,
                                          'enforce-enum': True},
                                         {'name': 'Ambiguity_set_ID', 'type': 'positive-int', 'mandatory': False,
                                          'enforce-non-zero': True},
                                         {'name': 'Seq_ID', 'type': 'int', 'mandatory': False},
                                         {'name': 'Auth_asym_ID', 'type': 'str', 'mandatory': False},
                                         {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                         {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                         {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                         {'name': 'Details', 'type': 'str', 'mandatory': False},
                                         {'name': 'Assigned_chem_shift_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                          'default': '1', 'default-from': 'parent'},
                                         {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                         ]
                          }

NMR_STAR_LP_DATA_ITEMS_INS_CODE = {'dist_restraint': copy.copy(NMR_STAR_LP_DATA_ITEMS['dist_restraint'][:-2]),
                                   'dihed_restraint': copy.copy(NMR_STAR_LP_DATA_ITEMS['dihed_restraint'][:-2]),
                                   'rdc_restraint': copy.copy(NMR_STAR_LP_DATA_ITEMS['rdc_restraint'][:-2])
                                   }

NMR_STAR_LP_DATA_ITEMS_INS_CODE['dist_restraint'].extend([{'name': 'PDB_ins_code_1', 'type': 'str', 'mandatory': False},
                                                          {'name': 'PDB_ins_code_2', 'type': 'str', 'mandatory': False},
                                                          {'name': 'Gen_dist_constraint_list_ID',
                                                           'type': 'pointer-index', 'mandatory': True,
                                                           'default': '1', 'default-from': 'parent'},
                                                          {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                          ])

NMR_STAR_LP_DATA_ITEMS_INS_CODE['dihed_restraint'].extend([{'name': 'PDB_ins_code_1', 'type': 'str', 'mandatory': False},
                                                           {'name': 'PDB_ins_code_2', 'type': 'str', 'mandatory': False},
                                                           {'name': 'PDB_ins_code_3', 'type': 'str', 'mandatory': False},
                                                           {'name': 'PDB_ins_code_4', 'type': 'str', 'mandatory': False},
                                                           {'name': 'Torsion_angle_constraint_list_ID',
                                                            'type': 'pointer-index', 'mandatory': True,
                                                            'default': '1', 'default-from': 'parent'},
                                                           {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                           ])

NMR_STAR_LP_DATA_ITEMS_INS_CODE['rdc_restraint'].extend([{'name': 'PDB_ins_code_1', 'type': 'str', 'mandatory': False},
                                                         {'name': 'PDB_ins_code_2', 'type': 'str', 'mandatory': False},
                                                         {'name': 'RDC_constraint_list_ID', 'type': 'pointer-index',
                                                          'mandatory': True, 'default': '1', 'default-from': 'parent'},
                                                         {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}
                                                         ])

NMR_STAR_ALT_LP_CATEGORIES = {'spectral_peak': ['_Peak', '_Peak_general_char', '_Peak_char', '_Assigned_peak_chem_shift']
                              }

NMR_STAR_ALT_LP_KEY_ITEMS = {'spectral_peak': {'_Peak': [
                                               {'name': 'ID', 'type': 'int'}],
                                               '_Peak_general_char': [
                                               {'name': 'Peak_ID', 'type': 'int'}],
                                               '_Peak_char': [
                                               {'name': 'Peak_ID', 'type': 'int'},
                                               {'name': 'Spectral_dim_ID', 'type': 'positive-int'}],
                                               '_Assigned_peak_chem_shift': [
                                               {'name': 'Peak_ID', 'type': 'int'},
                                               {'name': 'Spectral_dim_ID', 'type': 'positive-int'}]
                                               }
                             }

NMR_STAR_ALT_LP_DATA_ITEMS = {'spectral_peak': {'_Peak': [
                                                {'name': 'Index_ID', 'type': 'index-int', 'mandatory': False},
                                                {'name': 'Figure_of_merit', 'type': 'range-float', 'mandatory': False,
                                                 'range': WEIGHT_RANGE},
                                                {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}],
                                                '_Peak_general_char': [
                                                {'name': 'Intensity_val', 'type': 'float', 'mandatory': True},
                                                {'name': 'Intensity_val_err', 'type': 'float', 'mandatory': False},
                                                {'name': 'Measurement_method', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('absolute height', 'height', 'relative height', 'volume',
                                                          'number of contours', 'integration')},
                                                {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}],
                                                '_Peak_char': [
                                                {'name': 'Chem_shift_val', 'type': 'range-float', 'mandatory': True,
                                                 'range': CS_RESTRAINT_RANGE},
                                                {'name': 'Chem_shift_val_err', 'type': 'range-float', 'mandatory': False,
                                                 'void-zero': True,
                                                 'range': CS_UNCERTAINTY_RANGE},
                                                {'name': 'Line_width_val', 'type': 'positive-float', 'mandatory': False},
                                                {'name': 'Line_width_val_err', 'type': 'positive-float', 'mandatory': False,
                                                 'void-zero': True},
                                                {'name': 'Coupling_pattern', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('d', 'dd', 'ddd', 'dm', 'dt', 'hxt', 'hpt', 'm',
                                                          'q', 'qd', 'qn', 's', 'sxt', 't', 'td', 'LR', '1JCH')},
                                                {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}],
                                                '_Assigned_peak_chem_shift': [
                                                {'name': 'Set_ID', 'type': 'positive-int', 'mandatory': False},
                                                {'name': 'Magnetization_linkage_ID', 'type': 'positive-int', 'mandatory': False},
                                                {'name': 'Val', 'type': 'range-float', 'mandatory': False,
                                                 'range': CS_RESTRAINT_RANGE},
                                                {'name': 'Contribution_fractional_val', 'type': 'range-float', 'mandatory': False,
                                                 'range': WEIGHT_RANGE},
                                                {'name': 'Figure_of_merit', 'type': 'range-float', 'mandatory': False,
                                                 'range': WEIGHT_RANGE},
                                                {'name': 'Assigned_chem_shift_list_ID', 'type': 'pointer-index',
                                                 'mandatory': False},
                                                {'name': 'Entity_assembly_ID', 'type': 'positive-int-as-str', 'mandatory': False},
                                                {'name': 'Entity_ID', 'type': 'positive-int'},
                                                {'name': 'Comp_index_ID', 'type': 'int', 'mandatory': False},
                                                {'name': 'Comp_ID', 'type': 'str', 'mandatory': False, 'uppercase': True},
                                                {'name': 'Atom_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Ambiguity_code', 'type': 'enum-int', 'mandatory': False,
                                                 'enum': ALLOWED_AMBIGUITY_CODES},
                                                {'name': 'Ambiguity_set_ID', 'type': 'positive-int', 'mandatory': False},
                                                # NOTICE: '_Assigned_peak_chem_shift.Auth_asym_ID' does not exist
                                                {'name': 'Auth_entity_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_seq_ID', 'type': 'int', 'mandatory': False},
                                                {'name': 'Auth_comp_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Auth_atom_ID', 'type': 'str', 'mandatory': False},
                                                {'name': 'Details', 'type': 'str', 'mandatory': False},
                                                {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}]}}

NMR_STAR_AUX_LP_CATEGORIES = {'dist_restraint': ['_Gen_dist_constraint_software_param'],
                              'spectral_peak': ['_Spectral_dim', '_Spectral_dim_transfer']
                              }

NMR_STAR_AUX_LP_KEY_ITEMS = {'dist_restraint': {'_Gen_dist_constraint_software_param': [
                                                {'name': 'Software_ID', 'type': 'int'},
                                                {'name': 'Type', 'type': 'str'}]
                                                },
                             'spectral_peak': {'_Spectral_dim': [
                                               # allows to have software-native id starting from zero
                                               {'name': 'ID', 'type': 'int', 'auto-increment': True}
                                               ],
                                               '_Spectral_dim_transfer': [
                                               {'name': 'Spectral_dim_ID_1', 'type': 'positive-int'},
                                               {'name': 'Spectral_dim_ID_2', 'type': 'positive-int'}]
                                               }
                             }

NMR_STAR_AUX_LP_DATA_ITEMS = {'dist_restraint': {'_Gen_dist_constraint_software_param': [
                                                 {'name': 'Value', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Range', 'type': 'str', 'mandatory': False},
                                                 {'name': 'Gen_dist_constraint_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                  'default': '1', 'default-from': 'parent'},
                                                 {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}]
                                                 },
                              'spectral_peak': {'_Spectral_dim': [
                                                {'name': 'Atom_type', 'type': 'enum', 'mandatory': True,
                                                 'enum': set(ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS.keys()),
                                                 'enforce-enum': True},
                                                {'name': 'Atom_isotope_number', 'type': 'enum-int', 'mandatory': True,
                                                 'enum': set(ALLOWED_ISOTOPE_NUMBERS),
                                                 'enforce-enum': True},
                                                {'name': 'Axis_code', 'type': 'str'},
                                                {'name': 'Spectrometer_frequency', 'type': 'positive-float', 'mandatory': False,
                                                 'enforce-non-zero': True},
                                                {'name': 'Under_sampling_type', 'type': 'enum', 'mandatory': False,
                                                 'enum': ('aliased', 'folded', 'not observed')},
                                                {'name': 'Spectral_region', 'type': 'str', 'mandatory': True},
                                                {'name': 'Sweep_width', 'type': 'positive-float', 'mandatory': False,
                                                 'enforce-non-zero': True},
                                                {'name': 'Sweep_width_units', 'type': 'enum', 'mandatory': True, 'default': 'Hz',
                                                 'enum': ('ppm', 'Hz'),
                                                 'enforce-enum': True},
                                                {'name': 'Value_first_point', 'type': 'float', 'mandatory': False},
                                                {'name': 'Absolute_peak_positions', 'type': 'bool', 'mandatory': False},
                                                {'name': 'Acquisition', 'type': 'bool', 'mandatory': False},
                                                {'name': 'Center_frequency_offset', 'type': 'float', 'mandatory': False},
                                                {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}],
                                                '_Spectral_dim_transfer': [
                                                {'name': 'Type', 'type': 'enum', 'mandatory': True,
                                                 'enum': ('onebond', 'jcoupling', 'jmultibond', 'relayed', 'relayed-alternate',
                                                          'through-space', 'through-space?'),
                                                 'enforce-enum': True},
                                                {'name': 'Indirect', 'type': 'bool', 'mandatory': False},
                                                {'name': 'Spectral_peak_list_ID', 'type': 'pointer-index', 'mandatory': True,
                                                 'default': '1', 'default-from': 'parent'},
                                                {'name': 'Entry_ID', 'type': 'str', 'mandatory': True}]
                                                }
                              }

CARTN_DATA_ITEMS = [{'name': 'Cartn_x', 'type': 'float', 'alt_name': 'x'},
                    {'name': 'Cartn_y', 'type': 'float', 'alt_name': 'y'},
                    {'name': 'Cartn_z', 'type': 'float', 'alt_name': 'z'}
                    ]

AUTH_ATOM_DATA_ITEMS = [{'name': 'auth_asym_id', 'type': 'str', 'alt_name': 'chain_id', 'default': REPRESENTATIVE_ASYM_ID},
                        {'name': 'auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                        {'name': 'label_comp_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                        {'name': 'label_atom_id', 'type': 'starts-with-alnum', 'alt_name': 'atom_id'}
                        ]

ATOM_NAME_DATA_ITEMS = [{'name': 'label_comp_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                        {'name': 'label_atom_id', 'type': 'starts-with-alnum', 'alt_name': 'atom_id'}
                        ]

AUTH_ATOM_CARTN_DATA_ITEMS = CARTN_DATA_ITEMS
AUTH_ATOM_CARTN_DATA_ITEMS.extend(AUTH_ATOM_DATA_ITEMS)

PTNR1_AUTH_ATOM_DATA_ITEMS = [{'name': 'ptnr1_auth_asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                              {'name': 'ptnr1_auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                              {'name': 'ptnr1_label_comp_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                              {'name': 'ptnr1_label_atom_id', 'type': 'starts-with-alnum', 'alt_name': 'atom_id'}
                              ]

PTNR2_AUTH_ATOM_DATA_ITEMS = [{'name': 'ptnr2_auth_asym_id', 'type': 'str', 'alt_name': 'chain_id'},
                              {'name': 'ptnr2_auth_seq_id', 'type': 'int', 'alt_name': 'seq_id'},
                              {'name': 'ptnr2_label_comp_id', 'type': 'starts-with-alnum', 'alt_name': 'comp_id'},
                              {'name': 'ptnr2_label_atom_id', 'type': 'starts-with-alnum', 'alt_name': 'atom_id'}
                              ]

REMEDIATE_BACKBONE_ANGLE_NAME_PAT = re.compile(r'pseudo (PHI|PSI|OMEGA) \(0, (0|1|\-1), (0|1|\-1), 0\)')

SPECTRAL_DIM_TEMPLATE = {'axis_code': None,
                         'spectrometer_frequency': None,
                         'under_sampling_type': None,
                         'atom_type': None,
                         'atom_isotope_number': None,
                         'spectral_region': None,
                         # 'magnetization_linkage_id': None,  not required for _Peak_row_format loop
                         'sweep_width': None,
                         'sweep_width_units': 'Hz',
                         'value_first_point': None,
                         'absolute_peak_positions': None,
                         'acquisition': None,
                         'center_frequency_offset': None,
                         # 'encoding_code': None,  not required for _Peak_row_format loop
                         # 'encoded_reduced_dimension_id': None  not required for _Peak_row_format loop
                         }

DEFAULT_DATUM_COUNTER = {'1H chemical shifts': 0,
                         '2H chemical shifts': 0,
                         '3H chemical shifts': 0,
                         '13C chemical shifts': 0,
                         '15N chemical shifts': 0,
                         '31P chemical shifts': 0,
                         '111Cd chemical shifts': 0,
                         '113Cd chemical shifts': 0,
                         '19F chemical shifts': 0,
                         '6Li chemical shifts': 0,
                         '10B chemical shifts': 0,
                         '11B chemical shifts': 0,
                         '17O chemical shifts': 0,
                         '23Na chemical shifts': 0,
                         '29Si chemical shifts': 0,
                         '35Cl chemical shifts': 0,
                         '129Xe chemical shifts': 0,
                         '195Pt chemical shifts': 0,
                         'theoretical 1H chemical shifts': 0,
                         'theoretical 13C chemical shifts': 0,
                         'theoretical 15N chemical shifts': 0,
                         'chemical rates': 0,
                         'coupling constants': 0,
                         'theoretical coupling constants': 0,
                         'chemical shift isotope effects': 0,
                         'chemical shift perturbation values': 0,
                         'T1 relaxation values': 0,
                         'theoretical T1 relaxation values': 0,
                         'T1rho relaxation values': 0,
                         'T2 relaxation values': 0,
                         'theoretical T2 relaxation values': 0,
                         'dipole-dipole relaxation values': 0,
                         'dipole-dipole cross correlation relaxation values': 0,
                         'theoretical dipole-dipole cross-correlation values': 0,
                         'chemical shift anisotropy values': 0,
                         'chemical shift anisotropy tensor values': 0,
                         'quadrupolar couplings': 0,
                         'theoretical chemical shifts': 0,
                         'chemical shift tensors': 0,
                         'residual dipolar couplings': 0,
                         'dipolar coupling values': 0,
                         'dipolar coupling tensor values': 0,
                         'heteronuclear NOE values': 0,
                         'theoretical heteronuclear NOE values': 0,
                         'homonuclear NOE values': 0,
                         'order parameters': 0,
                         'spectral density values': 0,
                         'H exchange rates': 0,
                         'H exchange protection factors': 0,
                         'pKa values': 0,
                         'pH NMR parameter values': 0,
                         'binding constants': 0,
                         'D/H fractionation factors': 0,
                         'bond orientation values': 0,
                         'deduced secondary structure values': 0,
                         'deduced hydrogen bonds': 0,
                         'distance constraints': 0,
                         'ambiguous distance constraints': 0,
                         'hydrogen bond distance constraints': 0,
                         'torsion angle constraints': 0,
                         'chemical shift constraints': 0,
                         'symmetry constraints': 0
                         }

DEFAULT_LIST_ID_COUNTER = {'dist_restraint': 0,
                           'dihed_restraint': 0,
                           'rdc_restraint': 0,
                           'noepk_restraint': 0,
                           'jcoup_restraint': 0,
                           'rdc_raw_data': 0,
                           'csa_restraint': 0,
                           'ddc_restraint': 0,
                           'hvycs_restraint': 0,
                           'procs_restraint': 0,
                           'csp_restraint': 0,
                           'auto_relax_restraint': 0,
                           'heteronucl_noe_data': 0,
                           'heteronucl_t1_data': 0,
                           'heteronucl_t2_data': 0,
                           'heteronucl_t1r_data': 0,
                           'order_param_data': 0,
                           'ph_titr_data': 0,
                           'ph_param_data': 0,
                           'coupling_const_data': 0,
                           'ccr_d_csa_restraint': 0,
                           'ccr_dd_restraint': 0,
                           'fchiral_restraint': 0,
                           'saxs_restraint': 0,
                           'other_restraint': 0,
                           'spectral_peak': 0,
                           'chem_shift': 0
                           }

DEFAULT_SUBTYPE_DATA = {'entry_info': [],
                        'poly_seq': [],
                        'entity': [],
                        'chem_shift': [],
                        'chem_shift_ref': [],
                        'dist_restraint': [],
                        'dihed_restraint': [],
                        'rdc_restraint': [],
                        'spectral_peak': [],
                        'spectral_peak_alt': [],
                        'noepk_restraint': [],
                        'jcoup_restraint': [],
                        'rdc_raw_data': [],
                        'csa_restraint': [],
                        'ddc_restraint': [],
                        'hvycs_restraint': [],
                        'procs_restraint': [],
                        'csp_restraint': [],
                        'auto_relax_restraint': [],
                        'heteronucl_noe_data': [],
                        'heteronucl_t1_data': [],
                        'heteronucl_t2_data': [],
                        'heteronucl_t1r_data': [],
                        'order_param_data': [],
                        'ph_titr_data': [],
                        'ph_param_data': [],
                        'coupling_const_data': [],
                        'ccr_d_csa_restraint': [],
                        'ccr_dd_restraint': [],
                        'fchiral_restraint': [],
                        'saxs_restraint': [],
                        'other_restraint': []
                        }

DEFAULT_COORD_PROPERTIES = {'tautomer': {},
                            'rotamer': {},
                            'near_ring': {},
                            'near_para_ferro': {},
                            'bond_length': {},
                            'tautomer_per_model': []
                            }

ASSIGNMENT_SEPARATOR_PAT = re.compile(r'[^\w\'\"]+')
ASSIGNMENT_RESID_PAT = re.compile(r'\d+')
ASSIGNMENT_HALF_SPIN_NUCLEUS = ('H', 'Q', 'M', 'C', 'N', 'P', 'F')

C_CARBONYL_CENTER_MAX_TOR = 190
C_CARBONYL_CENTER_MAX = 180
C_CARBONYL_CENTER_MIN = 170

C_AROMATIC_CENTER_MAX = 133
C_AROMATIC_CENTER_MIN = 128
C_AROMATIC_CENTER_MIN_TOR = 123

N_AMIDE_CENTER_MAX = C_AROMATIC_CENTER_MIN
N_AMIDE_CENTER_MIN = 115

C_ALL_CENTER_MAX = 90
C_ALL_CENTER_MIN = 60

C_ALIPHATIC_CENTER_MAX = C_ALL_CENTER_MIN
C_ALIPHATIC_CENTER_MIN = 30

C_METHYL_CENTER_MAX = C_ALIPHATIC_CENTER_MIN
C_METHYL_CENTER_MIN = 10

HN_AROMATIC_CENTER_MAX = 9
HN_AROMATIC_CENTER_MIN = 6

H_IMIDE_CENTER_MAX = 15
H_IMIDE_CENTER_MIN = 10

H_ALL_CENTER_MAX = HN_AROMATIC_CENTER_MIN
H_ALL_CENTER_MIN = 4

H_ALIPHATIC_CENTER_MAX = H_ALL_CENTER_MIN
H_ALIPHATIC_CENTER_MIN = 2

H_METHYL_CENTER_MAX = H_ALIPHATIC_CENTER_MIN
H_METHYL_CENTER_MIN = 0

MIN_CORRCOEF_FOR_ONE_BOND_TRANSFER = 0.2

PROTEIN_RELATED_WORDS = ('protein', 'peptide', 'amino', 'n-term', 'c-term', 'domain', 'enzyme', 'ase')
DNA_RELATED_WORDS = ('dna', 'deoxyribonucleotide', 'nucleotide', "5'-", "3'-")
RNA_RELATED_WORDS = ('rna', 'ribonucleotide', 'nucleotide', "5'-", "3'-")

ALLOWED_THIOL_STATES = ('all disulfide bound', 'all other bound', 'all free',
                        'not present', 'not available', 'unknown', 'not reported',
                        'free and disulfide bound', 'free and other bound',
                        'free disulfide and other bound', 'disulfide and other bound')

UNIDENTIFIED_TAX_ID = (32644, 1780429)  # used only in BMRB internal annotation
