Hi all,
I am trying to run a survival analysis on my data looking at SNPs which influence speed to develop the disease of interest. I have seen previous studies which have done this using the R plugin for PLINK but I am having difficulty running it.
I'm not sure how to specify the survival time and onset of the disease within the code. I have looked online for examples but the only one I can find is on the PLINK website which doesn't go into specifics. The code I'm using is as follows:
../plink --bfile testsnps --R cox_script_rplugin.txt --out test_snps_surv --noweb
cox_script_rplugin.txt is as follows:
library(survival) Rplink <- function(PHENO,GENO,CLUSTER,COVAR) { f1 <- function(s) { m <- summary( coxph( Surv( PHENO [,1], COVAR[,2] ) ~ s ) ) r <- c( m$coef , m$loglik, m$n ) c( length(r) , r ) } apply( GENO , 2 , f1 ) }
I have set up my fam file so that the first phenotype column is survival time and the 2nd phenotype column is whether or not the individual got the disease.
The results I'm getting out are:
11 rs4910084 9915879 A NA 11 rs10500715 9929638 C NA 11 rs7952455 9936337 A NA 14 rs7157940 93632946 A NA 17 rs11078308 15411904 A NA
Does anyone have an example of the script they used for this type of analysis? Any help would be greatly appreciated.
Many thanks,
Caragh