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

require reference as asserted in documentation #8067

Merged
merged 3 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class MergeAnnotatedRegions extends GATKTool {

final static String DEFAULT_SEPARATOR = "__";

@Override
public boolean requiresReference() {
return true;
}

@Override
public void traverse() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.broadinstitute.hellbender.tools.copynumber.utils;

import com.google.common.collect.ImmutableSortedMap;
import org.broadinstitute.barclay.argparser.CommandLineException;
import org.broadinstitute.hellbender.CommandLineProgramTest;
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions;
import org.broadinstitute.hellbender.tools.copynumber.arguments.CopyNumberStandardArgument;
Expand Down Expand Up @@ -50,4 +51,17 @@ public void basicTest() throws IOException {
Assert.assertEquals(collection.getRecords().get(4), new AnnotatedInterval(new SimpleInterval("2", 1098, 2305),
ImmutableSortedMap.of("Num_Probes", "200", "Segment_Mean", "-0.10", "Segment_Call", "0")));
}

@Test(expectedExceptions = CommandLineException.class)
public void requiresReferenceTest() throws IOException {
// This test is a bit more like the real world
final File outputFile = File.createTempFile("mergeannotatedregions", ".seg");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method doesn't clean up after itself -- use the createTempFile() method inherited from BaseTest instead, which sets the temp file to be deleted on JVM exit.

final List<String> arguments = new ArrayList<>();
arguments.add("--" + CopyNumberStandardArgument.SEGMENTS_FILE_LONG_NAME);
arguments.add(SIMPLE_TEST_FILE);
arguments.add("-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME);
arguments.add(outputFile.getAbsolutePath());
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the future consider using ArgumentsBuilder to build up your integration test command lines (though the manual method here is fine too)

runCommandLine(arguments);
}

}