I have this code which I want to make parallel however I can't seem to get it to work.
I get the impression that dopar has problems with writing something to a file is this true? and if so what do I need to change?
start = Sys.time()
# print chromosome chr != chrnumber read in due to sorting of data ie chr10 comes before chr2
# get .raw file name + path
rawfile = paste(RAWfolder, chrs_raw[chr],sep="/")
# get .bim file name + path
bimfile = paste(RAWfolder, chrs_bim[chr],sep="/")
# Read in genetype data in raw format
geno_data = fread(rawfile, data.table=FALSE, showProgress = FALSE)
# Remove first 7 columns
geno_data = as.matrix(geno_data[,c(7:ncol(geno_data))])
# Apply LD subsetting function Lubke et al 2012
LDsubset = snp_sel(geno_data,k, bl)