cleanBayesAll: Clean up a BayessAllFile

View source: R/cleanBayesAll.R

cleanBayesAllR Documentation

Clean up a BayessAllFile

Description

This function attempts to restore a corrupted file. See details to know more about when this may happen, and what problems this function can fix.

Usage

cleanBayesAll(dir.in, bayesallfile = "bayesallfile.gz")

Arguments

dir.in

The local folder containing migrate-n output files (default: NULL)

bayesallfile

The name of the bayesallfile (default: NULL)

Details

When a run is interrupted, for example when it crashes or gets killed because it reached the limit set by a walltime, some lines (generally the last one) may be incomplete. This can cause issue when reading the file. Another situation where there might be issues with the BayesAllFile is when you recover the run. Every time you restart a run, Migrate-n appends the headings and other text at the end of the file before starting logging again, which when read as a table, causes problems. Also, when you restart the run multiple times, this text is appended multiple times but Migrate-n uses the second instance to restart the run, so you restart the run always from the same point rather than from the last processed locus. This function tries to clean up the file by removing incomplete lines and the unnecessary text, so that it can be read as a table, and if you restart the run, it will resume form the last processed locus.

Value

Invisibly, the bayesAllFile content as a character vector


carlopacioni/mtraceR documentation built on Nov. 3, 2023, 4:30 a.m.