# Automation of monophenotype analyses

2 posts / 0 new
Offline
Joined: 11/10/2020 - 18:07
Automation of monophenotype analyses

Hello,

please could you let me know whether it is possible to automate monophenotype analyses ( and also when adjusting for age and sex)?

I was searching whether this might be possible, and found one similar question (https://openmx.ssri.psu.edu/node/4673) with very similar code to what I am currently using. However, it is unclear whether it is possible to do this or not. I have 142 monophenotypes I need to calculate heritability for.

Thank-you.

Offline
Joined: 03/01/2013 - 14:09
Yes, it is possible.

Given that it's only 142 phenotypes, I would just put it in a for loop and use umxACEv, something like:

require(umx)
modelList <- vector("list",142)
for (pheno in myPhenotypesList) {modelList[i] <- umxACEv(selDVs=pheno)}

Note that the phenotypes are expected to be the pheno with _T1 and _T2 for the two twins (default, see ?umxACEv for options). Note also that variance components can go negative with this approach. However, the approach is superior in several respects, particularly bias control.

To summarize the results, you may have to do something like summary(modelList[[5]]) with 2 square brackets around the particular model for some likely fairly rational reason to do with how R works. Apply is useful here too, e.g., to pull out all the estimates which coef(modelList[[1]]) would do for just the first model in the vector. You might want to save only the estimates and fit statistics instead of the whole model if you have a lot of data in your model and not enough computer memory.