Modified PowerBelowFrequency to ignore reads below a user-defined mapping quality. Request from Jason Flannick.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1813 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
ec68ae3bc5
commit
ecbb11e017
|
|
@ -41,6 +41,9 @@ public class PowerBelowFrequencyWalker extends LocusWalker<Integer,Integer> {
|
|||
@Argument(fullName="useMeanProb", doc="Use the mean probability as the \"average quality\" rather than median Q-score")
|
||||
boolean useMean = false;
|
||||
|
||||
@Argument(fullName="minimumMappingQuality", shortName="mmq", doc="Only use reads above this mapping quality in the power calculation", required=false)
|
||||
int minMappingQuality = -1;
|
||||
|
||||
public void initialize() {
|
||||
if ( alleleFreq < 1 ) {
|
||||
String err = "Allele frequency (-af) must be greater than or equal to one.";
|
||||
|
|
@ -67,6 +70,11 @@ public class PowerBelowFrequencyWalker extends LocusWalker<Integer,Integer> {
|
|||
context = new AlignmentContext(context.getLocation(), thresh.getFirst(), thresh.getSecond());
|
||||
}
|
||||
|
||||
if ( minMappingQuality > -1 ) {
|
||||
Pair<List<SAMRecord>,List<Integer>> goodMaps = PoolUtils.thresholdReadsByMappingQuality(context.getReads(),context.getOffsets(),minMappingQuality);
|
||||
context = new AlignmentContext(context.getLocation(), goodMaps.getFirst(), goodMaps.getSecond());
|
||||
}
|
||||
|
||||
// calculate powers and put into output string
|
||||
|
||||
for ( int i = 1; i <= alleleFreq; i ++ ) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue