public final class CopyNumberArgumentValidationUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addTrailingSlashIfNecessary(java.lang.String outputDir) |
static java.lang.String |
getCanonicalPath(java.io.File file)
File paths that are passed to
PythonScriptExecutor must be canonical (rather than absolute). |
static java.lang.String |
getCanonicalPath(java.lang.String filename)
File paths that are passed to
PythonScriptExecutor must be canonical (rather than absolute). |
static boolean |
isSameDictionary(htsjdk.samtools.SAMSequenceDictionary dictionary1,
htsjdk.samtools.SAMSequenceDictionary dictionary2)
Compares two non-null sequence dictionaries using sequence index, name, and length only.
|
static SimpleIntervalCollection |
resolveIntervals(java.io.File readCountFile,
IntervalArgumentCollection intervalArgumentCollection,
org.apache.logging.log4j.Logger logger)
Resolve intervals from an
IntervalArgumentCollection and a read-count file. |
static void |
validateAndPrepareOutputDirectories(java.io.File... outputDirectories)
Validate that output directories are writeable.
|
static AnnotatedIntervalCollection |
validateAnnotatedIntervals(java.io.File annotatedIntervalsFile,
AbstractLocatableCollection<?,?> locatableCollection,
org.apache.logging.log4j.Logger logger)
Checks equality of the sequence dictionary and intervals contained in an
locatableCollection
against those contained in an AnnotatedIntervalCollection represented by annotatedIntervalsFile . |
static AnnotatedIntervalCollection |
validateAnnotatedIntervalsSubset(java.io.File annotatedIntervalsFile,
AbstractLocatableCollection<?,?> locatableCollection,
org.apache.logging.log4j.Logger logger)
Same as
validateAnnotatedIntervals(java.io.File, org.broadinstitute.hellbender.tools.copynumber.formats.collections.AbstractLocatableCollection<?, ?>, org.apache.logging.log4j.Logger) , except we only require that annotatedIntervalsFile
contains as a subset all the intervals contained in locatableCollection along with equality of the sequence dictionaries. |
static void |
validateInputs(java.io.File... inputs)
Validate that input files and/or directories are readable if they are not
null (i.e., optional inputs). |
static void |
validateIntervalArgumentCollection(IntervalArgumentCollection intervalArgumentCollection)
Validate that the interval-argument collection parameters minimally modify the input intervals.
|
static <T extends htsjdk.samtools.util.Locatable> |
validateIntervals(java.util.List<T> intervals,
htsjdk.samtools.SAMSequenceDictionary sequenceDictionary)
Validate that a list of locatables is valid and sorted according to a sequence dictionary and contains no duplicates or overlaps.
|
static void |
validateOutputFiles(java.io.File... outputFiles)
Validate that output files are writeable, whether or not they already exist.
|
public static void validateIntervalArgumentCollection(IntervalArgumentCollection intervalArgumentCollection)
public static <T extends htsjdk.samtools.util.Locatable> void validateIntervals(java.util.List<T> intervals, htsjdk.samtools.SAMSequenceDictionary sequenceDictionary)
public static boolean isSameDictionary(htsjdk.samtools.SAMSequenceDictionary dictionary1, htsjdk.samtools.SAMSequenceDictionary dictionary2)
SAMSequenceDictionary.isSameDictionary(htsjdk.samtools.SAMSequenceDictionary)
.public static SimpleIntervalCollection resolveIntervals(java.io.File readCountFile, IntervalArgumentCollection intervalArgumentCollection, org.apache.logging.log4j.Logger logger)
IntervalArgumentCollection
and a read-count file.
If intervals are not specified in the IntervalArgumentCollection
, they are taken from the
read-count file. The sequence dictionary is taken from the read-count file. A SimpleIntervalCollection
constructed using these intervals and sequence dictionary is returned and can be used for further validation.public static AnnotatedIntervalCollection validateAnnotatedIntervals(java.io.File annotatedIntervalsFile, AbstractLocatableCollection<?,?> locatableCollection, org.apache.logging.log4j.Logger logger)
locatableCollection
against those contained in an AnnotatedIntervalCollection
represented by annotatedIntervalsFile
.
If the latter is null
, then null
is returned; otherwise,
the AnnotatedIntervalCollection
represented by inputAnnotatedIntervalsFile
is returned
if the intervals are equal, and an exception is thrown if they are not.public static AnnotatedIntervalCollection validateAnnotatedIntervalsSubset(java.io.File annotatedIntervalsFile, AbstractLocatableCollection<?,?> locatableCollection, org.apache.logging.log4j.Logger logger)
validateAnnotatedIntervals(java.io.File, org.broadinstitute.hellbender.tools.copynumber.formats.collections.AbstractLocatableCollection<?, ?>, org.apache.logging.log4j.Logger)
, except we only require that annotatedIntervalsFile
contains as a subset all the intervals contained in locatableCollection
along with equality of the sequence dictionaries.
The corresponding subset of annotated intervals is returned if appropriate.public static void validateInputs(java.io.File... inputs)
null
(i.e., optional inputs).public static void validateOutputFiles(java.io.File... outputFiles)
public static void validateAndPrepareOutputDirectories(java.io.File... outputDirectories)
public static java.lang.String getCanonicalPath(java.io.File file)
PythonScriptExecutor
must be canonical (rather than absolute).
See https://github.com/broadinstitute/gatk/issues/4724.public static java.lang.String getCanonicalPath(java.lang.String filename)
PythonScriptExecutor
must be canonical (rather than absolute).
See https://github.com/broadinstitute/gatk/issues/4724.public static java.lang.String addTrailingSlashIfNecessary(java.lang.String outputDir)