mosdepth
mosdepth copied to clipboard
Related to issue #81 Bed file output using the 5th column (score) for counts
You indicated you where willing to accept a PR for changing the behaviour of mosdepth so that it does not remove content present in input bed region file,
I am still very new to NIM, but I took your offer.
This change, makes sure that your output bed files have always at least 5 fields, no matter if input bed file only has 3 columns (chr, start and end). if input has 3 bed columns, output is: chr, start, end, chr:start-end, counts
if input bed file is a full 6 or 12 column format, all fields are retained expect for the score column that gets updated with mosdepth counts.
I also added test bed files and tests for each input bed file format condition.
Forgive me if there is anything not ideal in terms of NIM code standards, as I said... still learning... It builds fine on Travis CI but on my ubuntu 19.04 machine I am having trouble building ... not sure why yet
Best regards
Duarte
PS: I took the liberty of incrementing the version number and description on changes.md not sure if this is what should be done... but since this is a change that modified the default output of the program I guess it needs to be very clear to the users going forward as it might break their scripts
some users rely on bedgraph format. (3 columns + 4th indicating depth). So we cannot inject a fake 4th column when they give a 3-column file.
ha ... I see
I can make the change... so that if input only has 3 columns the output is in bedgraph format chr,start,end and counts ...
but would it not make more sense adding a command line parameter --bedgraph-output to enforce that condition?
no. do not add a command-line option. every additional option increases the number of emails I get about 2X.
thanks for the work on this, by the way, I think if we get it right it will be a useful change.