The solution to James's bug was just to clean up the code and simplify it. What happened was that functionality that got put into UGCalcLikelihoods was then generalized into the UG engine but then never removed from UGCalcLikelihoods. This knowingly breaks the batch merger, but Chris said he'll take care of it.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5647 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
798178b167
commit
7e9051ea25
|
|
@ -74,7 +74,7 @@ public class SNPGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoodsC
|
|||
bestAlternateAllele = alternateAlleleToUse.getBases()[0];
|
||||
} else if ( useAlleleFromVCF ) {
|
||||
final VariantContext vcInput = tracker.getVariantContext(ref, "alleles", null, ref.getLocus(), true);
|
||||
if ( vcInput == null || vcInput.isFiltered() )
|
||||
if ( vcInput == null || vcInput.isFiltered() || !vcInput.isSNP() )
|
||||
return null;
|
||||
if ( !vcInput.isSNP() ) {
|
||||
logger.info("Record at position " + ref.getLocus() + " is not a SNP; skipping...");
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ import java.util.*;
|
|||
* the name 'allele' so we know which alternate allele to use at each site.
|
||||
*/
|
||||
@BAQMode(QualityMode = BAQ.QualityMode.ADD_TAG, ApplicationTime = BAQ.ApplicationTime.ON_INPUT)
|
||||
@Requires(value={},referenceMetaData=@RMD(name="allele", type= VariantContext.class))
|
||||
@Requires(value={},referenceMetaData=@RMD(name="alleles", type= VariantContext.class))
|
||||
@Reference(window=@Window(start=-200,stop=200))
|
||||
@By(DataSource.READS)
|
||||
@Downsample(by=DownsampleType.BY_SAMPLE, toCoverage=250)
|
||||
|
|
@ -90,20 +90,7 @@ public class UGCalcLikelihoods extends LocusWalker<VariantCallContext, Integer>
|
|||
}
|
||||
|
||||
public VariantCallContext map(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext) {
|
||||
Collection<VariantContext> VCs = tracker.getVariantContexts(refContext, "allele", null, rawContext.getLocation(), true, false);
|
||||
if ( VCs.size() == 0 )
|
||||
return null;
|
||||
if ( VCs.size() > 1 ) {
|
||||
logger.warn("Multiple records seen in the 'allele' ROD at position " + rawContext.getLocation() + "; skipping...");
|
||||
return null;
|
||||
}
|
||||
VariantContext vc = VCs.iterator().next();
|
||||
if ( !vc.isBiallelic() ) {
|
||||
logger.warn("The record in the 'allele' ROD at position " + rawContext.getLocation() + " is not biallelic; skipping...");
|
||||
return null;
|
||||
}
|
||||
|
||||
VariantContext call = UG_engine.calculateLikelihoods(tracker, refContext, rawContext, vc.getAlternateAllele(0), true);
|
||||
VariantContext call = UG_engine.calculateLikelihoods(tracker, refContext, rawContext);
|
||||
return call == null ? null : new VariantCallContext(call, refContext.getBase(), true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,12 +139,6 @@ public class UnifiedGenotyperEngine {
|
|||
if ( UAC.COVERAGE_AT_WHICH_TO_ABORT > 0 && rawContext.size() > UAC.COVERAGE_AT_WHICH_TO_ABORT )
|
||||
return null;
|
||||
|
||||
// special case handling - avoid extended event pileups when calling indels if we're genotyping given alleles
|
||||
// TODO - is this the right solution? otherwise we trigger twice and we get duplicate entries
|
||||
/* if ( UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.DINDEL && rawContext.hasExtendedEventPileup()
|
||||
&& UAC.GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES)
|
||||
return null;
|
||||
*/
|
||||
final GenotypeLikelihoodsCalculationModel.Model model = getCurrentGLModel( rawContext );
|
||||
if( model == null ) {
|
||||
return null;
|
||||
|
|
@ -169,11 +163,9 @@ public class UnifiedGenotyperEngine {
|
|||
* @param tracker the meta data tracker
|
||||
* @param refContext the reference base
|
||||
* @param rawContext contextual information around the locus
|
||||
* @param alternateAlleleToUse the alternate allele to use, null if not set
|
||||
* @param useBAQedPileup should we use the BAQed pileup?
|
||||
* @return the VariantContext object
|
||||
*/
|
||||
public VariantContext calculateLikelihoods(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext, Allele alternateAlleleToUse, boolean useBAQedPileup) {
|
||||
public VariantContext calculateLikelihoods(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext) {
|
||||
final GenotypeLikelihoodsCalculationModel.Model model = getCurrentGLModel( rawContext );
|
||||
if( model == null )
|
||||
return null;
|
||||
|
|
@ -182,7 +174,7 @@ public class UnifiedGenotyperEngine {
|
|||
if ( stratifiedContexts == null )
|
||||
return null;
|
||||
|
||||
return calculateLikelihoods(tracker, refContext, stratifiedContexts, AlignmentContextUtils.ReadOrientation.COMPLETE, alternateAlleleToUse, useBAQedPileup, model);
|
||||
return calculateLikelihoods(tracker, refContext, stratifiedContexts, AlignmentContextUtils.ReadOrientation.COMPLETE, null, true, model);
|
||||
}
|
||||
|
||||
// private method called by both UnifiedGenotyper and UGCalcLikelihoods entry points into the engine
|
||||
|
|
|
|||
Loading…
Reference in New Issue