mosdepth icon indicating copy to clipboard operation
mosdepth copied to clipboard

Related to issue #81 Bed file output using the 5th column (score) for counts

Open duartemolha opened this issue 5 years ago • 4 comments

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

duartemolha avatar Apr 29 '19 15:04 duartemolha

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.

brentp avatar Apr 29 '19 15:04 brentp

ha ... I see

duartemolha avatar Apr 29 '19 15:04 duartemolha

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?

duartemolha avatar Apr 29 '19 15:04 duartemolha

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.

brentp avatar Apr 29 '19 15:04 brentp