Utils
Contains all pheval utility methods
download_hgnc_data()
Download latest HGNC complete set file.
Source code in src/pheval/utils/utils.py
126 127 128 | |
download_mondo_mapping()
Download latest MONDO SSSOM mapping file.
Source code in src/pheval/utils/utils.py
121 122 123 | |
get_resource_timestamp(file_name)
Return the ISO timestamp when the resource file was last updated. Args: file_name (str): The file name.
Source code in src/pheval/utils/utils.py
131 132 133 134 135 136 137 138 139 140 | |
rand(df, min_num, max_num, scramble_factor)
Numeric scrambling Args: df (pd.DataFrame): dataframe records min_num (int): min value from this records max_num (int): max value from this records scramble_factor (float): scramble factor scalar Returns: float: randomized number
Source code in src/pheval/utils/utils.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
semsim_scramble(input, output, columns_to_be_scrambled, scramble_factor=0.5)
Scrambles semantic similarity profile with a magnitude between 0 and 1 (scramble_factor: 0 means no scrambling and 1 means complete randomisation). It then randomises the above scores with a degree of the scramble_factor and returns a scrambles pandas dataframe. Args: input (Path): scramble_factor (float) scalar scramble factor columns_to_be_scrambled (List[str]): columns that will be scrambled in semsim file (e.g. jaccard_similarity). output (Path) Returns: pd.Dataframe: scrambled dataframe
Source code in src/pheval/utils/utils.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
semsim_scramble_df(dataframe, columns_to_be_scrambled, scramble_factor)
scramble_semsim_df Args: dataframe (pd.DataFrame): dataframe that contains semsim profile scramble_factor (float) scalar scramble factor columns_to_be_scrambled (List[str]): Returns: pd.Dataframe: scrambled dataframe
Source code in src/pheval/utils/utils.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |