GentlemanOfFate commited on
Commit
1deb623
·
verified ·
1 Parent(s): 5ea87da

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -15
README.md CHANGED
@@ -129,40 +129,48 @@ it can be either rounded by the researchers to full years, or converted from mon
129
 
130
  ### Benchmark a new aging clock
131
 
132
- First install our nice [library](https://github.com/ComputationalAgingLab/ComputAge) for convenient operation with datasets and other tools for aging clock design:
 
133
 
134
  `pip install computage`
135
 
136
- Now, suppose you trained a brand-new epigenetic aging clock model using classic `scikit-learn` library. You saved your model as `pickle` file. Then, the following block of code can be used for benchmarking your model. We also added several other published aging clocks for comparison with yours.
 
 
137
  ```python
138
  from computage import run_benchmark
139
 
140
- #first define NaN imputation method for in_library models
141
- #for simlicity here we recommend to use imputation with zeros
142
- imputation = 'none'
 
 
143
  models_config = {
144
- "in_library":{
145
  'HorvathV1':{'imputation':imputation},
146
  'Hannum':{'imputation':imputation},
147
  'PhenoAgeV2':{'imputation':imputation},
148
  },
149
- #here we should define a name of our new model as well as path
150
- #to the pickle file (.pkl) of the model
151
- "new_models":{
152
  #'my_new_model_name': {'path':/path/to/model.pkl}
153
  }
154
  }
155
- #now run the benchmark
 
156
  bench = run_benchmark(models_config,
157
  experiment_prefix='my_model_test',
158
  output_folder='./benchmark'
159
  )
160
- #upon completion, the results will be saved in the folder you specified
 
161
  ```
162
 
163
  ### Explore the dataset
164
 
165
- In case you want just to explore our dataset locally, use the following commands for downloading.
 
166
  ```python
167
  from huggingface_hub import snapshot_download
168
  snapshot_download(
@@ -170,13 +178,16 @@ snapshot_download(
170
  repo_type="dataset",
171
  local_dir='.')
172
  ```
 
173
  Once downloaded, the dataset can be open with `pandas` (or any other `parquet` reader).
 
174
  ```python
175
  import pandas as pd
176
- #let's choose a study id, for example `GSE100264`
 
177
  df = pd.read_parquet('data/computage_bench_data_GSE100264.parquet').T
178
- #note we transpose data for more convenient perception
179
- #Don't forget to explore metadata (which is common for all datasets):
180
  meta = pd.read_csv('computage_bench_meta.tsv', sep='\t', index_col=0)
181
  ```
182
 
 
129
 
130
  ### Benchmark a new aging clock
131
 
132
+ First, install our nice [library](https://github.com/ComputationalAgingLab/ComputAge) for convenient interaction with datasets and other tools built to design
133
+ aging clocks:
134
 
135
  `pip install computage`
136
 
137
+ Now, suppose you have trained your brand-new epigenetic aging clock model using the classic `scikit-learn` library. You saved your model as `pickle` file.
138
+ Then, the following block of code can be used to benchmark your model. We also added several published aging clock models for comparison.
139
+
140
  ```python
141
  from computage import run_benchmark
142
 
143
+ # first, define a method to impute NaNs for the in_library models
144
+ # we recommend using imputation with gold standard values from the [SeSAMe package](https://github.com/zwdzwd/sesame)
145
+ imputation = 'sesame_450k'
146
+
147
+ # for example, take these three clock models for benchmarking
148
  models_config = {
149
+ 'in_library':{
150
  'HorvathV1':{'imputation':imputation},
151
  'Hannum':{'imputation':imputation},
152
  'PhenoAgeV2':{'imputation':imputation},
153
  },
154
+ # here we can define a name of our new model, as well as path
155
+ # to the pickle file (.pkl) that contains it
156
+ 'new_models':{
157
  #'my_new_model_name': {'path':/path/to/model.pkl}
158
  }
159
  }
160
+
161
+ # run the benchmark
162
  bench = run_benchmark(models_config,
163
  experiment_prefix='my_model_test',
164
  output_folder='./benchmark'
165
  )
166
+
167
+ # upon completion, the results will be saved in the folder you have specified for output
168
  ```
169
 
170
  ### Explore the dataset
171
 
172
+ In case you want just to explore our dataset locally, use the following commands for downloading:
173
+
174
  ```python
175
  from huggingface_hub import snapshot_download
176
  snapshot_download(
 
178
  repo_type="dataset",
179
  local_dir='.')
180
  ```
181
+
182
  Once downloaded, the dataset can be open with `pandas` (or any other `parquet` reader).
183
+
184
  ```python
185
  import pandas as pd
186
+
187
+ # let's choose a study id, for example `GSE100264`
188
  df = pd.read_parquet('data/computage_bench_data_GSE100264.parquet').T
189
+ # note that we transpose data for a more convenient perception of samples and features
190
+ # don't forget to explore metadata (which is common for all datasets):
191
  meta = pd.read_csv('computage_bench_meta.tsv', sep='\t', index_col=0)
192
  ```
193