public class FingerprintChecker extends Object
Modifier and Type | Field | 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 | Description |
---|---|
FingerprintChecker(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 | 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.
|
List<FingerprintResults> |
checkFingerprints(List<File> samFiles,
List<File> genotypeFiles,
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.
|
List<FingerprintResults> |
checkFingerprints(List<File> observedGenotypeFiles,
List<File> expectedGenotypeFiles,
String observedSample,
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.
|
Map<htsjdk.samtools.SAMReadGroupRecord,Fingerprint> |
fingerprintSamFile(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.
|
Map<htsjdk.samtools.SAMReadGroupRecord,Fingerprint> |
fingerprintSamFiles(Collection<File> files,
int threads,
int waitTime,
TimeUnit waitTimeUnit) |
Fingerprints one or more SAM/BAM files at all available loci within the haplotype map, using multiple threads
to speed up the processing.
|
htsjdk.samtools.SAMFileHeader |
getHeader() |
|
htsjdk.samtools.util.IntervalList |
getLociToGenotype(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.
|
Map<String,Fingerprint> |
identifyContaminant(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.
|
Map<String,Fingerprint> |
loadFingerprints(File fingerprintFile,
String specificSample) |
Loads genotypes from the supplied file into one or more Fingerprint objects and returns them in a
Map of Sample->Fingerprint.
|
static SortedMap<String,Fingerprint> |
mergeFingerprintsBySample(Collection<Fingerprint> inputs) |
Takes a collection of fingerprints and, assuming that they are independent, merged the fingerprints
by samples and totals up the probabilities.
|
protected static <T> List<T> |
randomSublist(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) |
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(File haplotypeData)
public FingerprintChecker(HaplotypeMap haplotypes)
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
- public void setpLossofHet(double pLossofHet)
public Map<String,Fingerprint> loadFingerprints(File fingerprintFile, 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(Collection<Fingerprint> fingerprints)
public Map<htsjdk.samtools.SAMReadGroupRecord,Fingerprint> fingerprintSamFile(File samFile, htsjdk.samtools.util.IntervalList loci)
public Map<String,Fingerprint> identifyContaminant(File samFile, double contamination, int locusMaxReads)
protected static <T> List<T> randomSublist(List<T> list, int n)
list
- A list of elementsn
- a number of elements requested from listpublic Map<htsjdk.samtools.SAMReadGroupRecord,Fingerprint> fingerprintSamFiles(Collection<File> files, int threads, int waitTime, TimeUnit waitTimeUnit)
public static SortedMap<String,Fingerprint> mergeFingerprintsBySample(Collection<Fingerprint> inputs)
public List<FingerprintResults> checkFingerprints(List<File> samFiles, List<File> genotypeFiles, 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 List<FingerprintResults> checkFingerprints(List<File> observedGenotypeFiles, List<File> expectedGenotypeFiles, String observedSample, 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)