def bilayer_select(bilayer):
    """
    Select bilayer composition from either predefined selection (bilayer_type_dict) or inputted by the user in insane.py format.
    """
    bilayer_type = {"Gram neg. inner membrane": "-u POPE:67 -u POPG:23 -u CDL2:10 -l POPE:67 -l POPG:23 -l CDL2:10",
    "Gram neg. outer membrane": "-u PGIN:100 -l POPE:90 -l POPG:5 -l CDL2:5",
    "Plasma membrane": "-u POPC:20 -u DOPC:20 -u POPE:5 -u DOPE:5 -u DPSM:15 -u DPG3:10 -u CHOL:25 -l POPC:5 -l DOPC:5 -l POPE:20 -l DOPE:20 -l POPS:8 -l DOPS:7 -l POP2:10 -l CHOL:25",
    "ER membrane": "-u POPC:37 -u DOPC:37 -u POPE:8 -u DOPE:8 -u CHOL:10 -l POPC:15 -l DOPC:15 -l POPE:20 -l DOPE:20 -l POPS:10 -l POP2:10 -l CHOL:10",
    "Raft-like microdomain": "-u DPPC:27 -u DPPE:8 -u DPSM:15 -u DPG3:10 -u CHOL:40 -l DPPC:15 -l DPPE:35 -l DPPS:10 -l CHOL:40",
    "Simple": "-u POPC:70 -u CHOL:30 -l POPC:70 -l CHOL:30"}

    if bilayer in bilayer_type.keys():
        print("\nPredefined bilayer selected: {}".format(bilayer))
        bilayer=bilayer_type[bilayer]
    elif bilayer is None:
        print("\nNo bilayer selected: please choose a membrane composition")
        quit()
    else:
        print("\nCustom bilayer selected: {}".format(bilayer))
    return bilayer