Package htsjdk.samtools
Class SamFileValidator
java.lang.Object
htsjdk.samtools.SamFileValidator
Validates SAM files as follows:
- checks sam file header for sequence dictionary
- checks sam file header for read groups
- for each sam record
- reports error detected by SAMRecord.isValid()
- validates NM (nucleotide differences) exists and matches reality
- validates mate fields agree with data in the mate record
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Number of errors during SAM file validationint
Number of warnings during SAM file validationboolean
boolean
void
setBisulfiteSequenced
(boolean bisulfiteSequenced) void
Sets one or more error types that should not be reported on.void
setIgnoreWarnings
(boolean ignoreWarnings) void
setSkipMateValidation
(boolean skipMateValidation) Sets whether or not we should run mate validation beyond the mate cigar check, which is useful in extreme edge cases that would require a lot of memory to do the validation.setValidateIndex
(boolean validateIndex) Deprecated.void
setVerbose
(boolean verbose, int maxVerboseOutput) Control verbosityvoid
validateBamFileTermination
(File inputFile) void
validateBamFileTermination
(Path inputFile) boolean
validateSamFileSummary
(SamReader samReader, ReferenceSequenceFile reference) Outputs validation summary report to out.boolean
validateSamFileVerbose
(SamReader samReader, ReferenceSequenceFile reference) Outputs validation error details to out.
-
Field Details
-
MAX_QUALITY_NOT_STORED_ERRORS
public static final int MAX_QUALITY_NOT_STORED_ERRORS- See Also:
-
-
Constructor Details
-
SamFileValidator
-
-
Method Details
-
setErrorsToIgnore
Sets one or more error types that should not be reported on. -
setIgnoreWarnings
public void setIgnoreWarnings(boolean ignoreWarnings) -
setSkipMateValidation
public void setSkipMateValidation(boolean skipMateValidation) Sets whether or not we should run mate validation beyond the mate cigar check, which is useful in extreme edge cases that would require a lot of memory to do the validation.- Parameters:
skipMateValidation
- should this tool skip mate validation
-
getSkipMateValidation
public boolean getSkipMateValidation()- Returns:
- true if the validator will skip mate validation, otherwise false
-
validateSamFileSummary
Outputs validation summary report to out.- Parameters:
samReader
- records to validatereference
- if null, NM tag validation is skipped- Returns:
- boolean true if there are no validation errors, otherwise false
-
validateSamFileVerbose
Outputs validation error details to out.- Parameters:
samReader
- records to validatereference
- if null, NM tag validation is skipped processing will stop after this threshold has been reached- Returns:
- boolean true if there are no validation errors, otherwise false
-
validateBamFileTermination
-
validateBamFileTermination
-
getNumWarnings
public int getNumWarnings()Number of warnings during SAM file validation- Returns:
- number of warnings
-
getNumErrors
public int getNumErrors()Number of errors during SAM file validation- Returns:
- number of errors
-
setVerbose
public void setVerbose(boolean verbose, int maxVerboseOutput) Control verbosity- Parameters:
verbose
- True in order to emit a message per error or warning.maxVerboseOutput
- If verbose, emit no more than this many messages. Ignored if !verbose.
-
isBisulfiteSequenced
public boolean isBisulfiteSequenced() -
setBisulfiteSequenced
public void setBisulfiteSequenced(boolean bisulfiteSequenced) -
setValidateIndex
Deprecated. -
setIndexValidationStringency
public SamFileValidator setIndexValidationStringency(BamIndexValidator.IndexValidationStringency stringency)
-
setIndexValidationStringency(htsjdk.samtools.BamIndexValidator.IndexValidationStringency)
instead