
args <- commandArgs(TRUE)
exposure <- 'Exposure'
outcome <- 'Outcome'
exposure.sumstats <- NULL 
outcome.sumstats1 <- NULL
outcome.sumstats2 <- NULL
outfile <- NULL
output <- paste0(make.names(date()), ".log")
args <- strsplit(args, split = ' ')

for(i in 1:length(args)){
	eval(parse(text = args[[i]]))
}

require(G3C)

if (!is.null(outfile)) sink(outfile)

print.heading()
argmat <- cbind(unlist(args))
cat('Call:\n')
cat('g3c(')
for (i in 1:(nrow(argmat) - 1)) {
	cat(paste0(argmat[i,1], ', '))
}
cat(paste0(argmat[nrow(argmat),1], ')\n\n'))

res <- g3c(rg1.log = rg1.log, 
		rg2.log = rg2.log, 
		exposure.sumstats = exposure.sumstats, 
		outcome.sumstats1 = outcome.sumstats1,
		outcome.sumstats2 = outcome.sumstats2,
		exposure = exposure, 
		outcome = outcome,
		heading = FALSE)

if (!is.null(outfile)) sink()

