# This script will test how to use the BEAGLE command line based imputation tool within R

# Assign parameters
genotypes = "test.25Nov19.28d.vcf.gz"
genotypes = "newdata.vcf"
outfile = "test_output"

# Define the system command
command_prefix <- "java -Xmx1g -jar beagle.25Nov19.28d.jar"
command_args <- paste(" gt=", genotypes, " out=", outfile, sep = "")
command <- paste(command_prefix, command_args)

# Run BEAGLE using the system function
test <- system(command, intern = T, invisible = F)

