<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def SetEncoding(sval):
 """Sets the encoding variable according to the text passed :param sval: text specification for the desired model """

    global encoding
    s=sval.lower()
    if s == "additive":
        encoding = Encoding.Additive
    elif s == "dominant":
        encoding = Encoding.Dominant
    elif s == "recessive":
        encoding = Encoding.Recessive
    elif s == "genotype":
        encoding = Encoding.Genotype
    elif s == "raw":
        encoding = Encoding.Raw
    else:
        raise InvalidSelection("Invalid encoding, %s, selected" % (sval))