public class FingerprintChecker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_GENOTYPING_ERROR_RATE |
static int |
DEFAULT_MAXIMAL_PL_DIFFERENCE |
static int |
DEFAULT_MINIMUM_BASE_QUALITY |
static int |
DEFAULT_MINIMUM_MAPPING_QUALITY |
Constructor and Description |
---|
FingerprintChecker(java.io.File haplotypeData)
Creates a fingerprint checker that will work with the set of haplotypes stored in
the supplied file.
|
FingerprintChecker(HaplotypeMap haplotypes)
Creates a fingerprint checker that will work with the set of haplotyped provided.
|
Modifier and Type | Method and Description |
---|---|
static MatchResults |
calculateMatchResults(Fingerprint observedFp,
Fingerprint expectedFp)
Compares two fingerprints and calculates a MatchResults object which contains detailed
information about the match (or mismatch) between fingerprints including the LOD score
for whether or not the two are likely from the same sample.
|
static MatchResults |
calculateMatchResults(Fingerprint observedFp,
Fingerprint expectedFp,
double minPExpected,
double pLoH)
Compares two fingerprints and calculates a MatchResults object which contains detailed
information about the match (or mismatch) between fingerprints including the LOD score
for whether or not the two are likely from the same sample.
|
java.util.List<FingerprintResults> |
checkFingerprints(java.util.List<java.io.File> samFiles,
java.util.List<java.io.File> genotypeFiles,
java.lang.String specificSample,
boolean ignoreReadGroups)
Top level method to take a set of one or more SAM files and one or more Genotype files and compare
each read group in each SAM file to each set of fingerprint genotypes.
|
java.util.List<FingerprintResults> |
checkFingerprints(java.util.List<java.io.File> observedGenotypeFiles,
java.util.List<java.io.File> expectedGenotypeFiles,
java.lang.String observedSample,
java.lang.String expectedSample)
Top level method to take a set of one or more observed genotype (VCF) files and one or more expected genotype (VCF) files and compare
one or more sample in the observed genotype file with one or more in the expected file and generate results for each set.
|
java.util.Map<FingerprintIdDetails,Fingerprint> |
fingerprintFiles(java.util.Collection<java.io.File> files,
int threads,
int waitTime,
java.util.concurrent.TimeUnit waitTimeUnit)
Fingerprints one or more SAM/BAM/VCF files at all available loci within the haplotype map, using multiple threads
to speed up the processing.
|
java.util.Map<FingerprintIdDetails,Fingerprint> |
fingerprintSamFile(java.io.File samFile,
htsjdk.samtools.util.IntervalList loci)
Generates a Fingerprint per read group in the supplied SAM file using the loci provided in
the interval list.
|
java.util.Map<FingerprintIdDetails,Fingerprint> |
fingerprintVcf(java.io.File vcfFile) |
htsjdk.samtools.SAMFileHeader |
getHeader() |
htsjdk.samtools.util.IntervalList |
getLociToGenotype(java.util.Collection<Fingerprint> fingerprints)
Takes a set of fingerprints and returns an IntervalList containing all the loci that
can be productively examined in sequencing data to compare to one or more of the
fingerprints.
|
htsjdk.samtools.ValidationStringency |
getValidationStringency() |
java.util.Map<java.lang.String,Fingerprint> |
identifyContaminant(java.io.File samFile,
double contamination,
int locusMaxReads)
Generates a per-sample Fingerprint for the contaminant in the supplied SAM file.
|
static boolean |
isUsableSnp(htsjdk.variant.variantcontext.VariantContext ctx)
Quick method to check and see if the variant context represents a usable SNP variant.
|
java.util.Map<java.lang.String,Fingerprint> |
loadFingerprints(java.io.File fingerprintFile,
java.lang.String specificSample)
Loads genotypes from the supplied file into one or more Fingerprint objects and returns them in a
Map of Sample->Fingerprint.
|
java.util.Map<java.lang.String,Fingerprint> |
loadFingerprintsFromIndexedVcf(java.io.File fingerprintFile,
java.lang.String specificSample)
Loads genotypes from the supplied file into one or more Fingerprint objects and returns them in a
Map of Sample->Fingerprint.
|
java.util.Map<java.lang.String,Fingerprint> |
loadFingerprintsFromNonIndexedVcf(java.io.File fingerprintFile,
java.lang.String specificSample)
Loads genotypes from the supplied file into one or more Fingerprint objects and returns them in a
Map of Sample->Fingerprint.
|
protected static <T> java.util.List<T> |
randomSublist(java.util.List<T> list,
int n)
A small utility function to choose n random elements (un-shuffled) from a list
|
void |
setAllowDuplicateReads(boolean allowDuplicateReads)
Sets whether duplicate reads should be allowed when calling genotypes from SAM files.
|
void |
setGenotypingErrorRate(double genotypingErrorRate)
Sets the assumed genotyping error rate used when accurate error rates are not available.
|
void |
setmaximalPLDifference(int maximalPLDifference)
Sets the maximal difference in PL scores considered when reading PLs from a VCF.
|
void |
setMinimumBaseQuality(int minimumBaseQuality)
Sets the minimum base quality for bases used when computing a fingerprint from sequence data.
|
void |
setMinimumMappingQuality(int minimumMappingQuality)
Sets the minimum mapping quality for reads used when computing fingerprints from sequence data.
|
void |
setpLossofHet(double pLossofHet) |
void |
setValidationStringency(htsjdk.samtools.ValidationStringency validationStringency) |
public static final double DEFAULT_GENOTYPING_ERROR_RATE
public static final int DEFAULT_MINIMUM_MAPPING_QUALITY
public static final int DEFAULT_MINIMUM_BASE_QUALITY
public static final int DEFAULT_MAXIMAL_PL_DIFFERENCE
public FingerprintChecker(java.io.File haplotypeData)
public FingerprintChecker(HaplotypeMap haplotypes)
public htsjdk.samtools.ValidationStringency getValidationStringency()
public void setValidationStringency(htsjdk.samtools.ValidationStringency validationStringency)
public void setMinimumBaseQuality(int minimumBaseQuality)
public void setMinimumMappingQuality(int minimumMappingQuality)
public void setGenotypingErrorRate(double genotypingErrorRate)
public void setmaximalPLDifference(int maximalPLDifference)
public htsjdk.samtools.SAMFileHeader getHeader()
public void setAllowDuplicateReads(boolean allowDuplicateReads)
allowDuplicateReads
- should fingerprinting use duplicate reads?public void setpLossofHet(double pLossofHet)
public java.util.Map<java.lang.String,Fingerprint> loadFingerprints(java.io.File fingerprintFile, java.lang.String specificSample)
fingerprintFile
- - VCF file containing genotypes for one or more samplesspecificSample
- - null to load genotypes for all samples contained in the file or the name
of an individual sample to load (and exclude all others).public java.util.Map<java.lang.String,Fingerprint> loadFingerprintsFromNonIndexedVcf(java.io.File fingerprintFile, java.lang.String specificSample)
fingerprintFile
- - VCF file containing genotypes for one or more samplesspecificSample
- - null to load genotypes for all samples contained in the file or the name
of an individual sample to load (and exclude all others).public java.util.Map<java.lang.String,Fingerprint> loadFingerprintsFromIndexedVcf(java.io.File fingerprintFile, java.lang.String specificSample)
fingerprintFile
- - VCF file containing genotypes for one or more samplesspecificSample
- - null to load genotypes for all samples contained in the file or the name
of an individual sample to load (and exclude all others).public static boolean isUsableSnp(htsjdk.variant.variantcontext.VariantContext ctx)
public htsjdk.samtools.util.IntervalList getLociToGenotype(java.util.Collection<Fingerprint> fingerprints)
public java.util.Map<FingerprintIdDetails,Fingerprint> fingerprintVcf(java.io.File vcfFile)
public java.util.Map<FingerprintIdDetails,Fingerprint> fingerprintSamFile(java.io.File samFile, htsjdk.samtools.util.IntervalList loci)
public java.util.Map<java.lang.String,Fingerprint> identifyContaminant(java.io.File samFile, double contamination, int locusMaxReads)
protected static <T> java.util.List<T> randomSublist(java.util.List<T> list, int n)
list
- A list of elementsn
- a number of elements requested from listpublic java.util.Map<FingerprintIdDetails,Fingerprint> fingerprintFiles(java.util.Collection<java.io.File> files, int threads, int waitTime, java.util.concurrent.TimeUnit waitTimeUnit)
public java.util.List<FingerprintResults> checkFingerprints(java.util.List<java.io.File> samFiles, java.util.List<java.io.File> genotypeFiles, java.lang.String specificSample, boolean ignoreReadGroups)
samFiles
- the list of SAM files to fingerprintgenotypeFiles
- the list of genotype files from which to pull fingerprint genotypesspecificSample
- an optional single sample who's genotypes to load from the supplied filesignoreReadGroups
- aggregate data into one fingerprint per file, instead of splitting by RGpublic java.util.List<FingerprintResults> checkFingerprints(java.util.List<java.io.File> observedGenotypeFiles, java.util.List<java.io.File> expectedGenotypeFiles, java.lang.String observedSample, java.lang.String expectedSample)
observedGenotypeFiles
- The list of genotype files containing observed calls, from which to pull fingerprint genotypesexpectedGenotypeFiles
- The list of genotype files containing expected calls, from which to pull fingerprint genotypesobservedSample
- an optional single sample whose genotypes to load from the observed genotype file (if null, use all)expectedSample
- an optional single sample whose genotypes to load from the expected genotype file (if null, use all)public static MatchResults calculateMatchResults(Fingerprint observedFp, Fingerprint expectedFp, double minPExpected, double pLoH)
public static MatchResults calculateMatchResults(Fingerprint observedFp, Fingerprint expectedFp)