Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

duartemolha
Copy link

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 duartemolha changed the title Related to issue #84 Bed file output usnig the 6th column (score) for counts Related to issue #81 Bed file output usnig the 6th column (score) for counts Apr 29, 2019
@duartemolha duartemolha changed the title Related to issue #81 Bed file output usnig the 6th column (score) for counts Related to issue #81 Bed file output using the 5th column (score) for counts Apr 29, 2019
@brentp
Copy link
Owner

brentp commented Apr 29, 2019

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.

CHANGES.md Outdated Show resolved Hide resolved
functional-tests.sh Outdated Show resolved Hide resolved
@duartemolha
Copy link
Author

ha ... I see

@duartemolha
Copy link
Author

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?

@brentp
Copy link
Owner

brentp commented Apr 29, 2019

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 brentp force-pushed the master branch 5 times, most recently from 5198b39 to 30548ed Compare May 11, 2020 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants