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

Display warning when using large interval lists with GenomicsDBImport. #5102

Merged
merged 1 commit into from
Aug 14, 2018
Merged
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 @@ -146,6 +146,7 @@ public final class GenomicsDBImport extends GATKTool {
public static final String VALIDATE_SAMPLE_MAP_LONG_NAME = "validate-sample-name-map";
public static final String VCF_INITIALIZER_THREADS_LONG_NAME = "reader-threads";
public static final String MAX_NUM_INTERVALS_TO_IMPORT_IN_PARALLEL = "max-num-intervals-to-import-in-parallel";
public static final int INTERVAL_LIST_SIZE_WARNING_THRESHOLD = 100;

@Argument(fullName = WORKSPACE_ARG_LONG_NAME,
doc = "Workspace for GenomicsDB. Must be a POSIX file system path, but can be a relative path." +
Expand Down Expand Up @@ -703,6 +704,14 @@ private void initializeIntervals() {

intervals = new ArrayList<>();
final List<SimpleInterval> simpleIntervalList = intervalArgumentCollection.getIntervals(intervalDictionary);
if (simpleIntervalList.size() > INTERVAL_LIST_SIZE_WARNING_THRESHOLD) {
logger.warn(String.format(
"A large number of intervals were specified. " +
"Using more than %d intervals in a single import is not recommended and can cause performance to suffer. " +
"It is recommended that intervals be aggregated together.",
INTERVAL_LIST_SIZE_WARNING_THRESHOLD)
);
}
simpleIntervalList.forEach(interval -> intervals.add(new ChromosomeInterval(interval.getContig(),
interval.getStart(), interval.getEnd())));
} else {
Expand Down