-
Notifications
You must be signed in to change notification settings - Fork 369
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
Revert UpdateVcfSequenceDictionary handles stdout logic and repair test - DO NOT MERGE #867
Conversation
@nh13 Please review. |
I successfully tested this fix as follows:
|
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.
Minor test change requested.
@@ -59,7 +56,7 @@ | |||
programGroup = VcfOrBcf.class | |||
) | |||
public class UpdateVcfSequenceDictionary extends CommandLineProgram { | |||
@Option(shortName = StandardOptionDefinitions.INPUT_SHORT_NAME, doc = "Input VCF") | |||
@Option(shortName = StandardOptionDefinitions.INPUT_SHORT_NAME, doc = "Input VCF") |
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.
Extra space added.
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.
Done.
@@ -43,6 +39,8 @@ | |||
private static final File TEST_DATA_PATH = new File("testdata/picard/vcf/"); | |||
private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("UpdateVcfSequenceDictionaryTest", null); | |||
private static final File STD_OUT_FILE = new File(OUTPUT_DATA_PATH, "stdout.vcf"); |
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.
Not used anymore I don't think.
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.
Correct.
@Test(dataProvider = "OutputFiles") | ||
public void testUpdateVcfSequenceDictionary(final String outputFileName) throws IOException, NoSuchFieldException, IllegalAccessException { | ||
File input = new File(TEST_DATA_PATH, "vcfFormatTest.vcf"); | ||
File inputFile = new File(TEST_DATA_PATH, "vcfFormatTest.vcf"); |
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.
Not your doing, but could you make this final
?
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.
Done
Assert.assertEquals(SAMSequenceDictionaryExtractor.extractDictionary(samSequenceDictionaryVcf).size(), 82); | ||
Assert.assertEquals(SAMSequenceDictionaryExtractor.extractDictionary(outputFile).size(), 82); | ||
// Check that the output is equal to the input file if the output is not going to stdout | ||
if ( outputFileName != STD_OUT_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.
extra spaces
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.
Removed
@@ -54,51 +52,57 @@ public void teardown() { | |||
public static Object[][] outputFies() { | |||
|
|||
return new Object[][] { | |||
{OUTPUT_DATA_PATH + "updateVcfSequenceDictionaryTest-delete-me.vcf"}, | |||
{OUTPUT_DATA_PATH + "updateVcfSequenceDictionaryTest-delete-me" + VcfUtils.COMPRESSED_VCF_ENDING}, | |||
{OUTPUT_DATA_PATH + "updateVcfSequenceDictionaryTest-delete-me" + VcfUtils.UNCOMPRESSED_VCF_ENDING}, | |||
{STD_OUT_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.
Needs a test of the output:
final ByteArrayOutputStream myOut = new ByteArrayOutputStream();
System.setOut(new PrintStream(myOut));
@ronlevine any chance you could take a look at this one? |
Someone else will have to take over this PR. perhaps @cmnbroad ? |
Sure why not. |
@cmnbroad can you look at this soon or should we look for another person to take over? |
@yfarjoun I have a pretty long backlog at this point so if someone else can take this, feel free. |
@ronlevine sorry for the delay in getting to this. samtools/htsjdk#933 has been merged - can you update this PR and we can try to get it merged up? |
@gbggrant I think that we have to find someone to take over this PR...AFAIK @ronlevine will not fix this. |
@nh13 I think I've addressed all of your comments on this PR and added a separate test for verifying output to stdout. Can you re-review. |
with a minor request, I think that we can assume a 👍 .... |
Mostly cosmetic cleanup Have test verify outputs to stdout, vcf, and vcf.gz Added test to better capture stdout and verify
56bc18b
to
24593ac
Compare
Description
Fixes #863
DO NOT MERGE until using a version of htsjdk with samtools/htsjdk#933. samtools/htsjdk#933 fixes an NPE when writing to stdout and UpdateVcfSequenceDictionaryTest.testUpdateVcfSequenceDictionary will no longer fail. Reverted the code changes and fixed the test from #741. This PR did not properly implement the outputting to stdout and and interpreted a .vcf.gz as a VCF rather than a BLOCK_COMPRESSED_VCF. The stdout testing was fixed because file descriptor was interpreted as a VCF rather than VCF_STREAM by VariantContextBuilder.determineOutputTypeFromFile.
Checklist (never delete this)
Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.
Content
Review
For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests