Java Code Examples for htsjdk.variant.variantcontext.VariantContext#isPolymorphicInSamples()
The following examples show how to use
htsjdk.variant.variantcontext.VariantContext#isPolymorphicInSamples() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TiTvVariantEvaluator.java From gatk with BSD 3-Clause "New" or "Revised" License | 6 votes |
public void updateTiTv(VariantContext vc, boolean updateStandard) { if (vc != null && vc.isSNP() && vc.isBiallelic() && vc.isPolymorphicInSamples()) { if ( GATKVariantContextUtils.isTransition(vc)) { if (updateStandard) nTiInComp++; else nTi++; } else { if (updateStandard) nTvInComp++; else nTv++; } if (vc.hasAttribute("ANCESTRALALLELE")) { final String aaStr = vc.getAttributeAsString("ANCESTRALALLELE", "null").toUpperCase(); if ( ! aaStr.equals(".") ) { switch ( BaseUtils.SNPSubstitutionType(aaStr.getBytes()[0], vc.getAlternateAllele(0).getBases()[0] ) ) { case TRANSITION: nTiDerived++; break; case TRANSVERSION: nTvDerived++; break; default: break; } } } } }
Example 2
Source File: CompOverlap.java From gatk with BSD 3-Clause "New" or "Revised" License | 5 votes |
public void update2(VariantContext eval, VariantContext comp, final ReferenceContext referenceContext, final ReadsContext readsContext, final FeatureContext featureContext) { boolean evalIsGood = eval != null && eval.isPolymorphicInSamples(); boolean compIsGood = comp != null && comp.isNotFiltered(); if (evalIsGood) nEvalVariants++; // count the number of eval events if (compIsGood && evalIsGood) { nVariantsAtComp++; if (!discordantP(eval, comp)) { // count whether we're concordant or not with the comp value nConcordant++; } } }
Example 3
Source File: VariantDataManager.java From gatk with BSD 3-Clause "New" or "Revised" License | 4 votes |
private boolean isValidVariant( final VariantContext evalVC, final VariantContext trainVC, final boolean TRUST_ALL_POLYMORPHIC) { return trainVC != null && trainVC.isNotFiltered() && trainVC.isVariant() && checkVariationClass( evalVC, trainVC ) && (TRUST_ALL_POLYMORPHIC || !trainVC.hasGenotypes() || trainVC.isPolymorphicInSamples()); }