Fix an unexpected warning from makewindows #933
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix an issue where makewindows with a genome option (-g) and a count option (-n)
will always raise a warning of a zero length interval, which is appended by
NewGenomeFile class
I have found that
bedtools makewindows
with genome (-g) and count (-n) options always raise a warning of a zero length interval.For example,
The warning does not affect the standard output results, but it is not related to user-defined inputs and seems to be confusing.
The warning is written at
bedtools2/src/windowMaker/windowMaker.cpp
Line 107 in 484c0d4
Then, I noticed that a zero length chromosome was appended by NewGenomeFile class, but not ignored by WindowMaker class.
Although GenomeFile class does not append a zero length chromosome and seems to work, NewGenomeFile class provides the stdin feature (commit 43ac847 and issue #735), so I avoided reverting to GenomeFile class from NewGenomeFile class at
bedtools2/src/windowMaker/windowMaker.cpp
Line 47 in 484c0d4
However, this fix relies on the order of the empty chromosome from the NewGenomeFile object, so it may be better to backport the stdin support to GenomeFile class for stability.
In addition, my English may be incorrect, so please feel free to edit my commit and comments.
Environment:
bedtools (v2.30.0 and the current master 484c0d4)
Ubuntu 20.04.2