def res_set_to_phenotype(res_set, full_list):
    """
    Converts a set of strings indicating resources to a binary string where
    the positions of 1s indicate which resources are present.

    Inputs: res_set - a set of strings indicating which resources are present
            full_list - a list of strings indicating all resources which could
                        could be present, and the order in which they should
                        map to bits in the phenotype
    returns: A binary string
    """

    full_list = list(full_list)
    phenotype = len(full_list) * ["0"]

    for i in range(len(full_list)):
        if full_list[i] in res_set:
            phenotype[i] = "1"

    assert(phenotype.count("1") == len(res_set))

    # Remove uneceesary leading 0s
    while phenotype[0] == "0" and len(phenotype) > 1:
        phenotype = phenotype[1:]

    return "0b"+"".join(phenotype)