コード例 #1
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem_1219
def protonation_indicator(ick):
    """ protonation indicator (last character of the key)
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    prot = cap_dct[Parse.PROT_KEY]
    return prot
コード例 #2
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem_1219
def second_hash(ick):
    """ the second hash block, indicating stereochemistry etc.
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    hash2 = cap_dct[Parse.HASH2_KEY]
    return hash2
コード例 #3
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem_1219
def version_indicator(ick):
    """ the version indicator following the second hash block
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    ver = cap_dct[Parse.VERSION_KEY]
    return ver
コード例 #4
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem_1219
def first_hash(ick):
    """ the first hash block, indicating connectivity
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    hash1 = cap_dct[Parse.HASH1_KEY]
    return hash1
コード例 #5
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem
def protonation_indicator(ick):
    """ Parse final character of InChIKey for the protonation indicator.

        :param ick: InChIKey
        :type ick: str
        :rtype: str
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    prot = cap_dct[Parse.PROT_KEY]
    return prot
コード例 #6
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem
def version_indicator(ick):
    """ Parse InChIKey second-hash block for the InChIKey version indicator.

        :param ick: InChIKey
        :type ick: str
        :rtype: str
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    ver = cap_dct[Parse.VERSION_KEY]
    return ver
コード例 #7
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem
def second_hash(ick):
    """ Parse InChIKey for the second hash block, indicating stereochemistry.

        :param ick: InChIKey
        :type ick: str
        :rtype: str
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    hash2 = cap_dct[Parse.HASH2_KEY]
    return hash2
コード例 #8
0
ファイル: inchi_key.py プロジェクト: sjklipp/autochem
def first_hash(ick):
    """ Parse InChIKey for the first hash block, indicating connectivity.

        :param ick: InChIKey
        :type ick: str
        :rtype: str
    """
    assert is_valid(ick)
    cap_dct = apf.first_named_capture(Parse.PATTERN, ick)
    hash1 = cap_dct[Parse.HASH1_KEY]
    return hash1