Al-Murphy / MungeSumstats

Rapid standardisation and quality control of GWAS or QTL summary statistics
https://doi.org/doi:10.18129/B9.bioc.MungeSumstats
75 stars 16 forks source link

Recognize previously formatted files of the same name #24

Closed bschilder closed 3 years ago

bschilder commented 3 years ago

This is helpful when looping over multiple sum stats, and you need to restart midway. Rather than reprocessing them all, you can just detect the ones that exist and return them.

Now implemented at the top of format_sumstats

 check_save_out <- check_save_path(save_path = save_path, 
                                    write_vcf = write_vcf)

  if(file.exists(check_save_out$save_path) & force_new==FALSE){
    message("Importing previously formatted file. Set `force_new=TRUE` to override this.")
  } else { 
    #Avoid reloading ref genome every time, save it to this parent environment
    #after being made once - speed up code
    rsids = NULL
    #Check input parameters