Skip to content

Commit

Permalink
stopping bmiz run if no younger ages available
Browse files Browse the repository at this point in the history
  • Loading branch information
explodecomputer committed Dec 1, 2024
1 parent 4ac23b7 commit 7516c48
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions resources/phenotypes/phenotype_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ phenoplot <- function(Yvbl, Xvbl, Quantiles=c(0.25,0.5,0.75), knots=NA, Nknots=0
organise_phenotype <- function(phecode, phenotypes, df, gen_covs, covdat, agebins, pl=TRUE) {

if(phecode != "pp" & phecode != "bmiz"){
type <- filter(df, pheno_id == phecode)$var_type
str(filter(df, pheno_id == phecode))
cs <- list()
phen <- read_phenotype_data(phecode, Sys.getenv("phenotype_input_dir"), agebins)
type <- filter(df, pheno_id == phecode)$var_type
str(filter(df, pheno_id == phecode))
cs <- list()
phen <- read_phenotype_data(phecode, Sys.getenv("phenotype_input_dir"), agebins)
}

if(phecode == "pp") {
Expand Down Expand Up @@ -368,6 +368,9 @@ organise_phenotype <- function(phecode, phenotypes, df, gen_covs, covdat, agebin
}

phen <- filter(phen, age <= 18)
if(nrow(phen) == 0) {
return(NULL)
}
phen$Month <- round(phen$age*12)

filename <- here("resources", "phenotypes", "bmi-z-who-2007.csv")
Expand Down

0 comments on commit 7516c48

Please sign in to comment.