All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.broadinstitute.hellbender.cmdline.argumentcollections.RequiredIntervalArgumentCollection Maven / Gradle / Ivy

The newest version!
package org.broadinstitute.hellbender.cmdline.argumentcollections;


import org.broadinstitute.barclay.argparser.Argument;
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions;
import org.broadinstitute.hellbender.utils.Utils;

import java.util.ArrayList;
import java.util.List;


/**
 * An ArgumentCollection that requires one or more intervals be specified with -L at the command line
 */
public final class RequiredIntervalArgumentCollection extends IntervalArgumentCollection {
    private static final long serialVersionUID = 1L;

    // Interval list files such as Picard interval lists are structured and require specialized parsing that
    // is handled by IntervalUtils, so use suppressFileExpansion to bypass command line parser auto-expansion.
    @Argument(fullName = StandardArgumentDefinitions.INTERVALS_LONG_NAME, shortName = StandardArgumentDefinitions.INTERVALS_SHORT_NAME, suppressFileExpansion = true, doc = "One or more genomic intervals over which to operate", optional = false)
    protected final List intervalStrings = new ArrayList<>();

    @Override
    protected List getIntervalStrings() {
        return intervalStrings;
    }

    @Override
    protected void addToIntervalStrings(String newInterval) {
        Utils.validate(traversalParameters == null, "addToIntervalStrings() cannot be called after interval parsing is complete");
        intervalStrings.add(newInterval);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy