Skip to content

Fix an unexpected warning from makewindows#933

Open
hisakatha wants to merge 1 commit intoarq5x:masterfrom
hisakatha:makewindows-fix-empty-chrom
Open

Fix an unexpected warning from makewindows#933
hisakatha wants to merge 1 commit intoarq5x:masterfrom
hisakatha:makewindows-fix-empty-chrom

Conversation

@hisakatha
Copy link
Contributor

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,

$ bedtools makewindows -g <(echo -e "chromA\t8") -n 3
chromA  0       2
chromA  2       4
chromA  4       8
WARNING: Interval :0-0 is smaller than the number of windows requested. Skipping.

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

if (window_size == 0)

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

NewGenomeFile *_genome = new NewGenomeFile(genomeFileName);

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

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
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.

1 participant