The last awk script of the bash chunk generating the step1 BED file will produce a malformed BED file where the first line is wrongly space-delimited, although the second till last lines are correctly tab-delimited. MWE is provided at the end of this issue.
I am not experienced with awk at all, but I believe this may be due to some quirky awk behavior as to when the OFS variable is being set. In particular, if I set the OFS in a BEGIN block, the output is now all correctly tab-delimited.
Below is a MWE. The first two commands set a small BED file as test input. The third and fourth commands demonstrate the error described in this issue. The last is the proposed fix, which I will make a pull request for soon.
The last awk script of the bash chunk generating the step1 BED file will produce a malformed BED file where the first line is wrongly space-delimited, although the second till last lines are correctly tab-delimited. MWE is provided at the end of this issue.
https://github.com/tgen/CovGen/blob/fc0fff88b21d5bc2fb5e549da012055231b6a67a/CovGen#L275-L285
I am not experienced with awk at all, but I believe this may be due to some quirky awk behavior as to when the OFS variable is being set. In particular, if I set the OFS in a
BEGIN
block, the output is now all correctly tab-delimited.Below is a MWE. The first two commands set a small BED file as test input. The third and fourth commands demonstrate the error described in this issue. The last is the proposed fix, which I will make a pull request for soon.
For reference I am on: