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

Trim intervals loaded from interval files. #6375

Merged
merged 3 commits into from
Feb 10, 2020
Merged

Conversation

cmnbroad
Copy link
Collaborator

Fixes #6371.

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmnbroad I'm not sure this handles every case yet.

ret.add(glParser.parseGenomeLoc(line));
final String trimmedLine = line.trim();
if (!trimmedLine.isEmpty()) {
ret.add(glParser.parseGenomeLoc(trimmedLine));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is at least one other call to parseGenomeLoc that are still not trimmed. See line 332. I think it should also be trimmed or the trimming should just be pushed down into parseGenomeLoc as well to be sure that it always happens.

Copy link
Collaborator Author

@cmnbroad cmnbroad Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added trim call to GenomeParserLoc, with a test.

@Test
public void testIntervalFileIntervalsAreTrimmed() throws Exception {
final GenomeLoc expectedGenomeLoc = hg19GenomeLocParser.createGenomeLoc("1", 1, 10);
final File gatkIntervalFile = createTempFile("testIntervalFileIntervalsAreTrimmed", ".intervals.list",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I've never seen this method which creates the temp file and writes to it before. That seems useful. Maybe it should be promote somewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to IOUtils with other methods with similar functionality, though now its no longer test-only.

@cmnbroad
Copy link
Collaborator Author

Back to you @lbergelson .

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lbergelson lbergelson merged commit 0d29568 into master Feb 10, 2020
@lbergelson lbergelson deleted the cn_fix_interval_list branch February 10, 2020 21:54
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.

Intervals specified with .list should trim whitespace
2 participants