- 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:
ebanks 2010-03-05 01:43:01 +00:00
parent 7104a3a96c
commit 9f7ebe1e1c
2 changed files with 9 additions and 4 deletions

View File

@ -249,6 +249,8 @@ public class VariantContextUtils {
public static double computeHardyWeinbergPvalue(VariantContext vc) {
if ( vc.getChromosomeCount() == 0 )
return 0.0;
return HardyWeinbergCalculation.hwCalculate(vc.getHomRefCount(), vc.getHetCount(), vc.getHomVarCount());
}

View File

@ -158,12 +158,12 @@ public class PlinkToVCF extends RodWalker<VCFRecord,Integer> {
double hetProp = (double)vContext.getHetCount() / (double)vContext.getNSamples();
double homVarProp = (double)vContext.getHomVarCount() / (double)vContext.getNSamples();
if ( hwScore > maxHardy ) {
record.setFilterString("HardyWeinbergViolation");
numHWViolations++;
} else if ( noCallProp > maxNoCall ) {
if ( noCallProp > maxNoCall ) {
record.setFilterString("HighNoCallRate");
numNoCallViolations++;
} else if ( hwScore > maxHardy ) {
record.setFilterString("HardyWeinbergViolation");
numHWViolations++;
} else if ( homVarProp > maxHomNonref) {
record.setFilterString("TooManyHomVars");
numHomVarViolations++;
@ -183,6 +183,9 @@ public class PlinkToVCF extends RodWalker<VCFRecord,Integer> {
infoMap.put(VCFRecord.ALLELE_NUMBER_KEY, String.format("%d", vContext.getChromosomeCount()));
record.addInfoFields(infoMap);
// add the id
record.setID(plinkRod.getVariantName());
return record;
}