MungeSumstats icon indicating copy to clipboard operation
MungeSumstats copied to clipboard

Avoid appending old log files

Open bschilder opened this issue 2 years ago • 4 comments

Reprex

 gwas_paths <- MungeSumstats::import_sumstats(ids = meta$id, 
                                       save_dir = save_dir, 
                                       nThread = 50, 
                                       parallel_across_ids = TRUE,
                                       force_new_vcf = TRUE,
                                       force_new = TRUE,
                                       #### Record logs
                                       log_folder_ind = TRUE,
                                       log_mungesumstats_msgs = TRUE)

Issue: part 1

If you run format_sumstats with the log file options set, but then try to later re-munge some of those files, the log files from the previous runs get appended with the output from the new runs.

Here, you can see where it finished the old run and started the new run right around the middle ("Importing VCF file: ..."):

Screenshot 2021-12-23 at 14 12 33

Issue: part 2

Also, I noticed that If I start the above code, but then stop it midway, do some stuff in the R console , and then run it again, it will start recording my output from the console! (not the output of the munging process). This also gets appended to any pre-existing log files.

Screenshot 2021-12-23 at 14 11 26


Session info


bschilder avatar Dec 23 '21 14:12 bschilder