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

Intervals specified with .list should trim whitespace #6371

Closed
lbergelson opened this issue Jan 13, 2020 · 1 comment · Fixed by #6375
Closed

Intervals specified with .list should trim whitespace #6371

lbergelson opened this issue Jan 13, 2020 · 1 comment · Fixed by #6375
Assignees
Labels

Comments

@lbergelson
Copy link
Member

Using a .list file for intervals doesn't trim white space appropriately and causes interval parsing to fail with strange errors.

For example the following line ending in a space causes an error in an interval .list file:
"20:1-100 "

This fails with the following error:


A USER ERROR has occurred: Badly formed genome unclippedLoc: Failed to parse Genome Location string: 20:1-100 : For input string: "100 "

***********************************************************************
org.broadinstitute.hellbender.exceptions.UserException$MalformedGenomeLoc: Badly formed genome unclippedLoc: Failed to parse Genome Location string: 20:1-100 : For input string: "100 "
	at org.broadinstitute.hellbender.utils.GenomeLocParser.parseGenomeLoc(GenomeLocParser.java:328)
	at org.broadinstitute.hellbender.utils.IntervalUtils.intervalFileToList(IntervalUtils.java:375)
	at org.broadinstitute.hellbender.utils.IntervalUtils.parseIntervalArguments(IntervalUtils.java:279)
	at org.broadinstitute.hellbender.utils.IntervalUtils.loadIntervals(IntervalUtils.java:226)
	at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.parseIntervals(IntervalArgumentCollection.java:174)
	at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getTraversalParameters(IntervalArgumentCollection.java:155)
	at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getIntervals(IntervalArgumentCollection.java:111)
	at org.broadinstitute.hellbender.engine.GATKTool.initializeIntervals(GATKTool.java:513)
	at org.broadinstitute.hellbender.engine.GATKTool.onStartup(GATKTool.java:708)
	at org.broadinstitute.hellbender.engine.ReadWalker.onStartup(ReadWalker.java:50)
	at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:137)
	at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:191)
	at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:210)
	at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:163)
	at org.broadinstitute.hellbender.Main.mainEntry(Main.java:206)
	at org.broadinstitute.hellbender.Main.main(Main.java:292)
Caused by: java.lang.NumberFormatException: For input string: "100 "
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at org.broadinstitute.hellbender.utils.SimpleInterval.parsePositionThrowOnFailure(SimpleInterval.java:141)
	at org.broadinstitute.hellbender.utils.IntervalUtils.getResolvedIntervals(IntervalUtils.java:1122)
	at org.broadinstitute.hellbender.utils.GenomeLocParser.parseGenomeLoc(GenomeLocParser.java:308)
@lbergelson lbergelson added the bug label Jan 13, 2020
@droazen droazen added this to the GATK-Priority-Backlog milestone Jan 13, 2020
@cmnbroad cmnbroad self-assigned this Jan 14, 2020
@cmnbroad
Copy link
Collaborator

Oh, turns out we do trim it, but we throw away the result and use the raw input.

@droazen droazen modified the milestones: GATK-Priority-Backlog, GATK-Triaged-Issues Jan 21, 2020
lbergelson pushed a commit that referenced this issue Feb 10, 2020
* Trim intervals loaded from interval files.
* Move writeTempFile to IOUtils which creates a new temp file with the specified content and returns the file path.
* Fixes #6371
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants