-
Notifications
You must be signed in to change notification settings - Fork 597
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
Cleaning up old interval code #6465
Conversation
* Currently things are in a weird state, picard style interval lists are handled either as tribble files if they are named correctly as .interval_list If they are named .intervals, .picard, or .list they are loaded with a different code path. This unifies it so that picard files are only loaded as .interval_list and .intervals is always considered a Gatk style list * This removes the work around for broken 0 length intervals that was put in place a long time ago. However, the workaround was effectively removed for all .interval_list files in 4.1.3.0 when we started reading those through the tribble plugin. Either the broken files no longer are used or they are misnamed as .intervals * fix tests to deal correctly with .inverval_list vs .intervals
relevant issue is #2520 |
@cmnbroad Maybe you can review this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor nits, good to go whatever you decide. Otherwise looks like a nice cleanup.
// If it's neither a Feature-containing file nor an interval file, but is an existing file, throw an error. | ||
// Note that since contigs can contain periods in their names, we can't use the mere presence of an "extension" | ||
// as evidence that the user intended the String to be interpreted as a file. | ||
else if ( new File(arg).exists() ) { | ||
throw new UserException.CouldNotReadInputFile(arg, String.format("The file %s exists, but does not contain Features " + | ||
"(ie., is not in a supported Feature file format such as vcf, bcf, or bed), " + | ||
"and does not have one of the supported interval file extensions (" + INTERVAL_FILE_EXTENSIONS + "). " + | ||
"and does not have one of the supported interval file extensions (" + GATK_INTERVAL_FILE_EXTENSIONS + "). " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of a nit, but this error message will no longer include ".interval_list", which is an acceptable extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically interval_list is a feature file now
} | ||
return ret; | ||
} catch (final UserException e){ | ||
throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block seems unnecessary ? It might be better to just rely on the next catch block, which will always include the inputPath name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I thought it might replace a more specific error with a less specific one. Since userexceptions don't show the stack trace you'd lose the underlying one in most cases.
Currently things are in a weird state, picard style interval lists are handled either as tribble files if they are named correctly as .interval_list
If they are named .intervals, .picard, or .list they are loaded with a different code path.
This unifies it so that picard files are only loaded as .interval_list and .intervals is always considered a Gatk style list
This removes the work around for broken 0 length intervals that was put in place a long time ago. However, the workaround was effectively removed
for all .interval_list files in 4.1.3.0 when we started reading those through the tribble plugin. Either the broken files no longer are used or they
are misnamed as .intervals
fix tests to deal correctly with .inverval_list vs .intervals