Source code for pyrfume.dream

"""Utilities for DREAM challenge data"""

import numpy as np

import pyrfume


[docs]def get_descriptors(format=False): """Get DREAM challenge descriptors""" if format: result = [ "Intensity", "Pleasantness", "Bakery", "Sweet", "Fruit", "Fish", "Garlic", "Spices", "Cold", "Sour", "Burnt", "Acid", "Warm", "Musky", "Sweaty", "Ammonia", "Decayed", "Wood", "Grass", "Flower", "Chemical", ] else: result = [ "INTENSITY/STRENGTH", "VALENCE/PLEASANTNESS", "BAKERY", "SWEET", "FRUIT", "FISH", "GARLIC", "SPICES", "COLD", "SOUR", "BURNT", "ACID", "WARM", "MUSKY", "SWEATY", "AMMONIA/URINOUS", "DECAYED", "WOOD", "GRASS", "FLOWER", "CHEMICAL", ] return result
[docs]def get_cids(): """Get PubChem IDs for DREAM challenge molecules""" df = pyrfume.load_data("keller_2017/cids.csv", index_col=None) return list(df["CID"])
[docs]def dilution_to_magnitude(dilution): denom = dilution.replace('"', "").replace("'", "").split("/")[1].replace(",", "") return np.log10(1.0 / float(denom))