- add name to vcf od field
- don't do HW calculation if everything is a no-call git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2936 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
7104a3a96c
commit
9f7ebe1e1c
|
|
@ -249,6 +249,8 @@ public class VariantContextUtils {
|
||||||
|
|
||||||
|
|
||||||
public static double computeHardyWeinbergPvalue(VariantContext vc) {
|
public static double computeHardyWeinbergPvalue(VariantContext vc) {
|
||||||
|
if ( vc.getChromosomeCount() == 0 )
|
||||||
|
return 0.0;
|
||||||
return HardyWeinbergCalculation.hwCalculate(vc.getHomRefCount(), vc.getHetCount(), vc.getHomVarCount());
|
return HardyWeinbergCalculation.hwCalculate(vc.getHomRefCount(), vc.getHetCount(), vc.getHomVarCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,12 +158,12 @@ public class PlinkToVCF extends RodWalker<VCFRecord,Integer> {
|
||||||
double hetProp = (double)vContext.getHetCount() / (double)vContext.getNSamples();
|
double hetProp = (double)vContext.getHetCount() / (double)vContext.getNSamples();
|
||||||
double homVarProp = (double)vContext.getHomVarCount() / (double)vContext.getNSamples();
|
double homVarProp = (double)vContext.getHomVarCount() / (double)vContext.getNSamples();
|
||||||
|
|
||||||
if ( hwScore > maxHardy ) {
|
if ( noCallProp > maxNoCall ) {
|
||||||
record.setFilterString("HardyWeinbergViolation");
|
|
||||||
numHWViolations++;
|
|
||||||
} else if ( noCallProp > maxNoCall ) {
|
|
||||||
record.setFilterString("HighNoCallRate");
|
record.setFilterString("HighNoCallRate");
|
||||||
numNoCallViolations++;
|
numNoCallViolations++;
|
||||||
|
} else if ( hwScore > maxHardy ) {
|
||||||
|
record.setFilterString("HardyWeinbergViolation");
|
||||||
|
numHWViolations++;
|
||||||
} else if ( homVarProp > maxHomNonref) {
|
} else if ( homVarProp > maxHomNonref) {
|
||||||
record.setFilterString("TooManyHomVars");
|
record.setFilterString("TooManyHomVars");
|
||||||
numHomVarViolations++;
|
numHomVarViolations++;
|
||||||
|
|
@ -183,6 +183,9 @@ public class PlinkToVCF extends RodWalker<VCFRecord,Integer> {
|
||||||
infoMap.put(VCFRecord.ALLELE_NUMBER_KEY, String.format("%d", vContext.getChromosomeCount()));
|
infoMap.put(VCFRecord.ALLELE_NUMBER_KEY, String.format("%d", vContext.getChromosomeCount()));
|
||||||
record.addInfoFields(infoMap);
|
record.addInfoFields(infoMap);
|
||||||
|
|
||||||
|
// add the id
|
||||||
|
record.setID(plinkRod.getVariantName());
|
||||||
|
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue