Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # change/update phenotypes in PLINK files
- # See the video tutorial on the Genomics Boot Camp YouTube channel
- # Clear workspace
- rm(list = ls())
- # Set working directory
- setwd("XXXXXXXXXXXXXXXXXXXXXXXXXX")
- # update phenotype column - single phenotype in file
- system("plink --file testData --pheno heightData.txt --recode --out phenoUpdated")
- # update phenotype column - select a specific one from a list
- system("plink --file testData --pheno PhenotypeMeasures.txt --mpheno 2 --recode --out phenoUpdated_weight_v1")
- system("plink --file testData --pheno PhenotypeMeasures.txt --pheno-name weight --recode --out phenoUpdated_weight_v2")
- # separate PLINK files for all phenotypes
- # ATTENTION!!! Might take a lot of HDD space - ped+map file for each phenotype
- nrMeasures <- 3 # this is how many phenotype measurements you have in the PhenotypeMeasures.txt file
- for (i in 1:nrMeasures) {
- system(
- paste0("plink --file testData --pheno PhenotypeMeasures.txt --mpheno ", i,
- " --recode --out phenoUpdated_trait",i))
- }
- # separate PLINK files for all phenotypes - named pheotypes
- # ATTENTION!!! Might take a lot of HDD space - ped+map file for each phenotype
- nrMeasures <- c("height", "weight", "shoeSize") # this is how many phenotype measurements you have in the PhenotypeMeasures.txt file
- for (i in 1:length(nrMeasures)) {
- system(
- paste0("plink --file testData --pheno PhenotypeMeasures.txt --pheno-name ", nrMeasures[i],
- " --recode --out phenoUpdated_trait_",nrMeasures[i]))
- #GWAS
- #visualization
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement