Code Monkey home page Code Monkey logo

dnam-based-age-predictor's Introduction

DNAm-based-age-predictors

Chronological age predictor based on DNA methylation from Illumina HumanMethylation450/EPIC arrays

There are two predictors (two sets of coefficients) built based on same set of 13,566 training samples, but using different methods. One is based on Elastic Net, the other is based on best linear unbiased prediction (BLUP). 514 probes have been selected by Elastic Net and BLUP used all (319,607) probes.

Since our training dataset contains a large number of samples, these samples should not be used as test samples since the prediction results will be biased. Detailed sample information is available in our paper (see Citation).

How to use the predictor

Rscript pred.R -i input_file -o output_file -a age_file

input_file: a R object file which contains the DNA methylation information for individuals (N * M matrix). N is the number of individuals and M is the number of CpG sites. Beta value is used as DNA methylation measurement.

output_file: the name of output file. The output file contains four columns: individual ID, real chronological age, predicted age using predictior based on Elastic Net and predicted age using predictior based on BLUP.

age_file: an input file which has two column: individual ID and real chronological age. Please note, the first line should be the header.

Examples

Please use this example to test whether the preditor can work properly in your working environment

Rscript pred.R -i data.rds -o age.pred -a data.age     

Contact us

I'm not a frequent GitHub user, so if you have any problems about the code and predictor, the easier way to contact me is through e-mail: [email protected]

Citation

Zhang Q, Vallerga C, Walker R, Lin T, Henders A, Montgomery G, He J, Fan D, Fowdar J, Kennedy M, et al: Improved precision of epigenetic clock estimates across tissues and its implication for biological ageing. Genome Medicine, 2019.

dnam-based-age-predictor's People

Contributors

qzhang314 avatar

Stargazers

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

Watchers

 avatar

dnam-based-age-predictor's Issues

Error in change of NAs to mean, and BLUP method

Dear Zhang,

Thank you for the tool (it works and it's user-friendly, unlike DNAmAge).

This is to report what I think may be a bug in the transformation of missing data to the mean value when feeding the tool with an input with NAs in it.

Here is what happened to me: I have methylation data including several CpGs with NAs and when I run DNAm-based-age-predictor I get back the EN prediction, but the "blupred" column comes with NAs only. Of course, maybe I'm making a mistake here, I'm not sure. I hope you can help me. Please, let me walk you through it and provide my input data for you...

First, I created the required input for DNAm-based-age-predictor (RDS file) from my table containing the DNA methylation values at all CpG sites in all my samples.

In R:

# read DNA methylation data
data <- as.matrix(t(read.table(file = "Nexs_methyl.tsv", 
                               header = TRUE, sep = "\t", row.names = 1, as.is=TRUE)))
# export R object
saveRDS(data, file = "Nexs.rds")

Once having the RDS file ready, I ran the tool:

In the terminal:

$ Rscript pred.R -i Nexs.rds -o Nexs_age.pred -a Nexs.age 
[1] "1. Data loading and QC"
[1] "1.1 Reading the data"
[1] "1.2 Replacing missing values with mean value"
[1] "1.3 Standardizing"
[1] "2. Loading predictors"
[1] "3. Checking misssing probes"
[1] "0 probe(s) in Elastic Net predictor is(are) not in the data"
[1] "0 probe(s) in BLUP predictor is(are) not in the data"
[1] "BLUP can perform better if the number of missing probes is too large!"
[1] "4. Predicting"
[1] "Completed!!!"
$ cat Nexs_age.pred
ID age enpred blupred
Nex10 0 23.5517451927356 NA
Nex12 0 27.16853446086 NA
Nex18 0 26.9359837106917 NA
Nex6 0 36.3717094129017 NA
Nex8 0 22.8164441953937 NA

Using this Dropbox link you can download a zip file containing all the files mentioned above: Nexs_methyl.tsv, Nexs.rds, Nexs.age, and Nexs_age.pred.

Thank you in advance!

Regards,
Katterinne

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.