Giter VIP home page Giter VIP logo

frailty's Introduction

Age and life expectancy clocks based on machine learning analysis of mouse frailty

See our easy-to-use webapp, where users can upload their data and calculate FRIGHT age and AFRAID score: http://frailtyclocks.sinclairlab.org

This repository contains machine learning-derived models to predict age and lifespan from frailty assesment. The FRIGHT (Frailty Inferred Geriatric Health Timeline) age model is designed to predict chronological age and the AFRAID (Analysis of Frailty and Death) score is designed to predict time to death using frailty the 31 parameter murine frailty index (Whitehead et al. 2014).

The models are packaged as fright_age.sav and afraid_score.sav. The iPython notebook shows how to load these models and use them on the data from our biorxiv preprint (https://www.biorxiv.org/content/10.1101/2019.12.20.884452v1).

Python Environment Requirements

Implementation of the FRIGHT and AFRAID models via the iPython notebook in the repository require Python version 3.6.x and the following packages:

  • jupyter (5.0.0)
  • scikit-learn (0.19.0)
  • pandas (0.20.1)
  • numpy (1.14.0)
  • scipy (1.0.0)
  • seaborn (0.8.1)

Note that the most recent version of Anaconda (2019.07) comes with these packages pre-installed. Currently the iPython script will work with a current Anaconda installation. However, to avoid issues with dependencies and future releases, a conda environment can be used.

conda create -n frailtyEnv -c conda-forge python=3.6 pandas=0.20.1 seaborn=0.8.1 numpy=1.14.0 jupyter=5.0.0 scipy=1.0.0 scikit-learn=0.20.3

You can then activate the new environment on OS/linux using source activate frailtyEnv in the terminal, or on Windows using conda activate frailtyEnv in AnacondaPrompt.

Once you've gotten started with the current version of Python via Anaconda, or with the frailtyEnv Conda environment, download the Git repository to your computer by clicking the 'Clone or Download' button (unzip the folder after it's downloaded), or using a git command (git clone https://github.com/xxx).

Navigate to the downloaded Git repository on your computer in the terminal or AnacondaPrompt and then start a Jupyter notebook (jupyter notebook).

Running the FRIGHT and AFRAID models

The FRIGHT and AFRAID models are packaged as fright_age.sav and afraid_score.sav in the repository. We've also included data from the methionine restriction intervention from the paper to provide an example of how to run the models.

Running the iPython notebook will show how to load the data, load the models and calculate FRIGHT age and AFRAID score on the data.

Note that the column names for your data must match the formatting in the iPython script as listed in the frightVariables and afraidVariables objects. If you're running into trouble running your data through the model it may be because the column names from your data doesn't exactly match the column names that the models are expecting.

frailty's People

Contributors

sinclairlab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

frailty's Issues

Hello ๐Ÿ‘‹, there was a problem when running

When I run to the step of Compute FRIGHT age for all animals, an error pops up
image


TypeError Traceback (most recent call last)
in
----> 1 frightControl = frightAge.predict(controlData[frightVariables])
2 frightMr = frightAge.predict(mrData[frightVariables])

~/opt/anaconda3/envs/test_py/lib/python3.6/site-packages/sklearn/ensemble/forest.py in predict(self, X)
679
680 # Assign chunk of trees to jobs
--> 681 n_jobs, _, _ = _partition_estimators(self.n_estimators, self.n_jobs)
682
683 # avoid storing the output of every estimator by summing them here

~/opt/anaconda3/envs/test_py/lib/python3.6/site-packages/sklearn/ensemble/base.py in _partition_estimators(n_estimators, n_jobs)
151 """Private function used to partition estimators between jobs."""
152 # Compute the number of jobs
--> 153 n_jobs = min(_get_n_jobs(n_jobs), n_estimators)
154
155 # Partition estimators between jobs

~/opt/anaconda3/envs/test_py/lib/python3.6/site-packages/sklearn/utils/init.py in _get_n_jobs(n_jobs)
462 ValueError: Parameter n_jobs == 0 has no meaning.
463 """
--> 464 if n_jobs < 0:
465 return max(cpu_count() + 1 + n_jobs, 1)
466 elif n_jobs == 0:

TypeError: '<' not supported between instances of 'NoneType' and 'int'


I hope you can take the time to answer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.