예제 #1
0
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
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
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
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
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
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
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
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