Skip to content

kebab case some arguments in LocusWalker and Spark walkers #5770

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

Merged
merged 2 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -38,8 +38,9 @@
* @author Daniel Gomez-Sanchez (magicDGS)
*/
public abstract class LocusWalker extends GATKTool {
public static final String MAX_DEPTH_PER_SAMPLE_NAME = "max-depth-per-sample";

@Argument(fullName = "maxDepthPerSample", shortName = "maxDepthPerSample", doc = "Maximum number of reads to retain per sample per locus. Reads above this threshold will be downsampled. Set to 0 to disable.", optional = true)
@Argument(fullName = MAX_DEPTH_PER_SAMPLE_NAME, shortName = MAX_DEPTH_PER_SAMPLE_NAME, doc = "Maximum number of reads to retain per sample per locus. Reads above this threshold will be downsampled. Set to 0 to disable.", optional = true)
protected int maxDepthPerSample = defaultMaxDepthPerSample();

/**
Expand Down Expand Up @@ -122,9 +123,7 @@ public List<ReadFilter> getDefaultReadFilters() {
/** Returns the downsampling info using {@link #maxDepthPerSample} as target coverage. */
protected final LIBSDownsamplingInfo getDownsamplingInfo() {
if (maxDepthPerSample < 0) {
throw new CommandLineException.BadArgumentValue("maxDepthPerSample",
String.valueOf(maxDepthPerSample),
"should be a positive number");
throw new CommandLineException.BadArgumentValue(MAX_DEPTH_PER_SAMPLE_NAME, String.valueOf(maxDepthPerSample), "should be a positive number");
}
return (maxDepthPerSample == 0) ? LocusIteratorByState.NO_DOWNSAMPLING : new LIBSDownsamplingInfo(true, maxDepthPerSample);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public class AssemblyRegionReadShardArgumentCollection implements Serializable {
public static final int DEFAULT_READSHARD_SIZE = 5000;
public static final int DEFAULT_READSHARD_PADDING_SIZE = 100;

@Argument(fullName="readShardSize", shortName="readShardSize", doc = "Maximum size of each read shard, in bases. For good performance, this should be much larger than the maximum assembly region size.", optional = true)
@Argument(fullName="read-shard-size", shortName="read-shard-size", doc = "Maximum size of each read shard, in bases. For good performance, this should be much larger than the maximum assembly region size.", optional = true)
public int readShardSize = DEFAULT_READSHARD_SIZE;

@Argument(fullName="readShardPadding", shortName="readShardPadding", doc = "Each read shard has this many bases of extra context on each side. Read shards must have as much or more padding than assembly regions.", optional = true)
@Argument(fullName="read-shard-padding", shortName="read-shard-padding", doc = "Each read shard has this many bases of extra context on each side. Read shards must have as much or more padding than assembly regions.", optional = true)
public int readShardPadding = DEFAULT_READSHARD_PADDING_SIZE;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public abstract class LocusWalkerSpark extends GATKSparkTool {
private static final long serialVersionUID = 1L;

@Argument(fullName = "maxDepthPerSample", shortName = "maxDepthPerSample", doc = "Maximum number of reads to retain per sample per locus. Reads above this threshold will be downsampled. Set to 0 to disable.", optional = true)
@Argument(fullName = LocusWalker.MAX_DEPTH_PER_SAMPLE_NAME, shortName = LocusWalker.MAX_DEPTH_PER_SAMPLE_NAME, doc = "Maximum number of reads to retain per sample per locus. Reads above this threshold will be downsampled. Set to 0 to disable.", optional = true)
protected int maxDepthPerSample = defaultMaxDepthPerSample();

/**
Expand All @@ -41,7 +41,7 @@ protected int defaultMaxDepthPerSample() {
return 0;
}

@Argument(fullName="readShardSize", shortName="readShardSize", doc = "Maximum size of each read shard, in bases.", optional = true)
@Argument(fullName="read-shard-size", shortName="read-shard-size", doc = "Maximum size of each read shard, in bases.", optional = true)
public int readShardSize = 10000;

@Argument(doc = "whether to use the shuffle implementation or overlaps partitioning (the default)", shortName = "shuffle", fullName = "shuffle", optional = true)
Expand All @@ -57,9 +57,7 @@ public boolean requiresReads() {
/** Returns the downsampling info using {@link #maxDepthPerSample} as target coverage. */
protected final LIBSDownsamplingInfo getDownsamplingInfo() {
if (maxDepthPerSample < 0) {
throw new CommandLineException.BadArgumentValue("maxDepthPerSample",
String.valueOf(maxDepthPerSample),
"should be a positive number");
throw new CommandLineException.BadArgumentValue(LocusWalker.MAX_DEPTH_PER_SAMPLE_NAME, String.valueOf(maxDepthPerSample), "should be a positive number");
}
return (maxDepthPerSample == 0) ? LocusIteratorByState.NO_DOWNSAMPLING : new LIBSDownsamplingInfo(true, maxDepthPerSample);
}
Expand Down