Skip to content

Instantly share code, notes, and snippets.

@nievergeltlab
Created July 13, 2017 20:58
Show Gist options
  • Select an option

  • Save nievergeltlab/76dbf18d0e6e3323aa76ef6afc56e229 to your computer and use it in GitHub Desktop.

Select an option

Save nievergeltlab/76dbf18d0e6e3323aa76ef6afc56e229 to your computer and use it in GitHub Desktop.
Print tables of phenotype information from list of .fam files
args <- commandArgs(trailingOnly = TRUE)
family_files <- args[1]
dat <- read.table(family_files)
for (i in dat$V1)
{
options(stringsAsFactors=F)
dat <- read.table(i,header=F)
names(dat) <- c("FIDL","IID","M","F","G","P")
print(i)
print(table(dat$P))
}
ls /home/laramie/CLEANED_DATA/SAFR_PTSD_wave1 | grep .fam | awk '{print "/home/laramie/CLEANED_DATA/SAFR_PTSD_wave1/"$1}' >> famlist.txt
Rscript familycounter.Rscript famlist.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment