qlu-lab / SUPERGNOVA

MIT License
23 stars 10 forks source link

proportion of correlated regions #7

Open humanpaingeneticslab opened 3 years ago

humanpaingeneticslab commented 3 years ago

Hi Everyone,

I was wondering if someone could share some R code that takes for input the results of supergnova and estimates the proportion of correlated regions. Here's what I have so far;

Best to All, Marc.

R --no-save --quiet library( "ashr" )

----- load supergnova results

my <- read.table( "supanova_insomnia.txt", header=TRUE, sep=" ", as.is=TRUE, stringsAsFactors=FALSE, quote="" )

----- estimate proportion of correlated regions

J <- ash( my[,"rho"], sqrt( my[,"var"] ), mixcompdist="halfnormal" ) sum( 1 - J$result$lfdr ) / nrow( my ) # <----- is this correct?