Skip to content

Commit

Permalink
Threshold updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasoifer committed Jun 6, 2024
1 parent 3e94754 commit b852ec7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,19 @@
*/

public abstract class AlleleFiltering {

final protected static Logger logger = LogManager.getLogger(AlleleFiltering.class);
final protected AssemblyBasedCallerArgumentCollection assemblyArgs;
final private OutputStreamWriter assemblyDebugOutStream;
final private SAMSequenceDictionary sequenceDictionary;

AlleleFiltering(final AssemblyBasedCallerArgumentCollection assemblyArgs,
final OutputStreamWriter assemblyDebugOutStream,
final SAMFileHeader header){
this.assemblyArgs = assemblyArgs;
this.assemblyDebugOutStream = assemblyDebugOutStream;
this.sequenceDictionary = header.getSequenceDictionary();
}
protected abstract double getStringentQuality();

/**
* Finds alleles that are likely not contributing much to explaining the data and remove the haplotypes
Expand Down Expand Up @@ -204,8 +205,7 @@ private AlleleLikelihoods<GATKRead, Haplotype> subsetHaplotypesByAlleles(final A
// the very weak quality is hardcoded
final List<Event> filteringCandidatesStringent = identifyBadAlleles(collectedRPLs,
collectedSORs,
activeAlleles,
1,
activeAlleles, getStringentQuality(),
Integer.MAX_VALUE);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public AlleleFilteringHC(HaplotypeCallerArgumentCollection _hcargs, OutputStream
afCalc = AlleleFrequencyCalculator.makeCalculator(config);
}

protected double getStringentQuality() { return 1; }
/**
* Calculate genotype likelihood of requirement of an allele. Specifically, calculates the likelihood
* of the data given that allele versus the likelihood of the data when all haplotypes containing the allele are removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,7 @@ public AlleleFilteringMutect(M2ArgumentCollection _m2args,
normalSamples = _normalSamples;
}

private AlleleLikelihoods<GATKRead, Allele> getAlleleLikelihoodMatrix(final AlleleLikelihoods<GATKRead, Haplotype> readLikelihoods,
final Event allele,
final Map<Haplotype, Collection<Event>> haplotypeAlleleMap,
final Set<Haplotype> enabledHaplotypes
){

final Map<Allele,List<Haplotype>> alleleHaplotypeMap = new CollectionUtil.DefaultingMap<>((k) -> new ArrayList<>(), true);


final Allele notAllele= InverseAllele.of(allele.altAllele(), true);
readLikelihoods.alleles().stream().filter(enabledHaplotypes::contains)
.filter(h->haplotypeAlleleMap.get(h).contains(allele))
.forEach(alleleHaplotypeMap.get(allele.altAllele())::add);
readLikelihoods.alleles().stream().filter(enabledHaplotypes::contains)
.filter(h -> !haplotypeAlleleMap.get(h).contains(allele))
.forEach(alleleHaplotypeMap.get(notAllele)::add);

final AlleleLikelihoods<GATKRead, Allele> alleleLikelihoods = readLikelihoods.marginalize(alleleHaplotypeMap);

logger.debug(() -> String.format("GALM: %s %d %d", allele, alleleHaplotypeMap.get(allele.altAllele()).size(), alleleHaplotypeMap.get(notAllele).size()));
return alleleLikelihoods;
}
protected double getStringentQuality() { return -50; }

/**
* Calculate calculate genotype likelihood of requirement of an allele. Specifically, calculates the likelihood
Expand Down

0 comments on commit b852ec7

Please sign in to comment.