Package picard.vcf
Class GenotypeConcordanceCounts
- java.lang.Object
-
- picard.vcf.GenotypeConcordanceCounts
-
public class GenotypeConcordanceCounts extends Object
A class to store the counts for various truth and call state classifications relative to a reference. With these counts and a provided scheme, summary metrics can be returned.
-
-
Constructor Summary
Constructors Constructor Description GenotypeConcordanceCounts()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalculateGenotypeConcordance(GenotypeConcordanceScheme scheme, boolean missingSitesFlag)Genotype Concordance is the number of times the truth and call states match exactly / all truth and call combinations made If the GA4GH scheme is being used, any MISSING sites in truth OR call will not be included in the discordance calculations.doublecalculateNonRefGenotypeConcordance(GenotypeConcordanceScheme scheme, boolean missingSitesFlag)Non Ref Genotype Concordance is the number of times the truth and call states match exactly for *vars only* / all truth and call *var* combinations made If the GA4GH scheme is being used, any MISSING sites in truth OR call will not be included in the discordance calculations.Map<GenotypeConcordanceStates.ContingencyState,Long>getContingencyStateCounts(GenotypeConcordanceScheme scheme)Returns the total number of times each contingency state is encountered, summed across all truth/call state pairs.longgetCount(GenotypeConcordanceStates.TruthAndCallStates truthAndCallStates)Returns the count defined by the truth state set and call state set.longgetCount(GenotypeConcordanceStates.TruthState truthState, GenotypeConcordanceStates.CallState callState)Returns the count defined by the truth state set and call state set.doublegetCounterSize()doublegetSensitivity(GenotypeConcordanceScheme scheme, GenotypeConcordanceStates.TruthState[] truthStateArray)Returns the sensitivity defined by the scheme across the subset of truth states.doublegetSpecificity(GenotypeConcordanceScheme scheme, GenotypeConcordanceStates.TruthState[] truthStateArray)Returns the specificity defined by the scheme across the subset of truth states.longgetSum()Returns the sum of all pairs of tuples defined by the truth state set and call state set.longgetSum(Set<GenotypeConcordanceStates.TruthState> truthStateSet, Set<GenotypeConcordanceStates.CallState> callStateSet)Returns the sum of all pairs of tuples defined by the truth state set and call state set.voidincrement(GenotypeConcordanceStates.TruthAndCallStates truthAndCallStates)Increments a count for the truth/call state tuple.voidincrement(GenotypeConcordanceStates.TruthAndCallStates truthAndCallStates, double count)booleanisMissing(GenotypeConcordanceStates.TruthState truthState, GenotypeConcordanceStates.CallState callState)Returns true if EITHER the truth or call state is MISSING.booleanisVar(GenotypeConcordanceStates.TruthState truthState, GenotypeConcordanceStates.CallState callState)Returns true if EITHER the truth or call state is a VAR.doublePpv(GenotypeConcordanceScheme scheme, GenotypeConcordanceStates.CallState[] callStateList)Returns the PPV defined by the scheme across the subset of call states.voidvalidateCountsAgainstScheme(GenotypeConcordanceScheme scheme)Validates that there are no counts for NA states in the underlying scheme
-
-
-
Method Detail
-
increment
public void increment(GenotypeConcordanceStates.TruthAndCallStates truthAndCallStates)
Increments a count for the truth/call state tuple.- Parameters:
truthAndCallStates-
-
increment
public void increment(GenotypeConcordanceStates.TruthAndCallStates truthAndCallStates, double count)
-
getCounterSize
public double getCounterSize()
-
validateCountsAgainstScheme
public void validateCountsAgainstScheme(GenotypeConcordanceScheme scheme)
Validates that there are no counts for NA states in the underlying scheme
-
calculateGenotypeConcordance
public double calculateGenotypeConcordance(GenotypeConcordanceScheme scheme, boolean missingSitesFlag)
Genotype Concordance is the number of times the truth and call states match exactly / all truth and call combinations made If the GA4GH scheme is being used, any MISSING sites in truth OR call will not be included in the discordance calculations.
-
calculateNonRefGenotypeConcordance
public double calculateNonRefGenotypeConcordance(GenotypeConcordanceScheme scheme, boolean missingSitesFlag)
Non Ref Genotype Concordance is the number of times the truth and call states match exactly for *vars only* / all truth and call *var* combinations made If the GA4GH scheme is being used, any MISSING sites in truth OR call will not be included in the discordance calculations.
-
getSensitivity
public double getSensitivity(GenotypeConcordanceScheme scheme, GenotypeConcordanceStates.TruthState[] truthStateArray)
Returns the sensitivity defined by the scheme across the subset of truth states.
-
Ppv
public double Ppv(GenotypeConcordanceScheme scheme, GenotypeConcordanceStates.CallState[] callStateList)
Returns the PPV defined by the scheme across the subset of call states.
-
getSpecificity
public double getSpecificity(GenotypeConcordanceScheme scheme, GenotypeConcordanceStates.TruthState[] truthStateArray)
Returns the specificity defined by the scheme across the subset of truth states.
-
getCount
public long getCount(GenotypeConcordanceStates.TruthState truthState, GenotypeConcordanceStates.CallState callState)
Returns the count defined by the truth state set and call state set.
-
getCount
public long getCount(GenotypeConcordanceStates.TruthAndCallStates truthAndCallStates)
Returns the count defined by the truth state set and call state set.
-
isVar
public boolean isVar(GenotypeConcordanceStates.TruthState truthState, GenotypeConcordanceStates.CallState callState)
Returns true if EITHER the truth or call state is a VAR. Used for calculating non ref genotype concordance.
-
isMissing
public boolean isMissing(GenotypeConcordanceStates.TruthState truthState, GenotypeConcordanceStates.CallState callState)
Returns true if EITHER the truth or call state is MISSING. Used for calculating genotype concordance and non-ref genotype concordance when the GA4GH scheme is used.
-
getSum
public long getSum(Set<GenotypeConcordanceStates.TruthState> truthStateSet, Set<GenotypeConcordanceStates.CallState> callStateSet)
Returns the sum of all pairs of tuples defined by the truth state set and call state set.
-
getSum
public long getSum()
Returns the sum of all pairs of tuples defined by the truth state set and call state set.
-
getContingencyStateCounts
public Map<GenotypeConcordanceStates.ContingencyState,Long> getContingencyStateCounts(GenotypeConcordanceScheme scheme)
Returns the total number of times each contingency state is encountered, summed across all truth/call state pairs.
-
-