Support for no qual fields in VCF; better support for Mendelian violation calculations
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2893 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
246fa28386
commit
9a6b384adb
|
|
@ -100,7 +100,7 @@ final class InferredGeneticContext {
|
|||
// ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
public boolean hasNegLog10PError() {
|
||||
return getNegLog10PError() == NO_NEG_LOG_10PERROR;
|
||||
return getNegLog10PError() != NO_NEG_LOG_10PERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -176,7 +176,8 @@ public class VariantContextAdaptors {
|
|||
genotypes.put(g.getSampleName(), g);
|
||||
}
|
||||
|
||||
VariantContext vc = new VariantContext(name, vcf.getLocation(), alleles, genotypes, vcf.getNegLog10PError(), filters, attributes);
|
||||
double qual = vcf.getQual() == -1 ? VariantContext.NO_NEG_LOG_10PERROR : vcf.getNegLog10PError();
|
||||
VariantContext vc = new VariantContext(name, vcf.getLocation(), alleles, genotypes, qual, filters, attributes);
|
||||
vc.validate();
|
||||
return vc;
|
||||
} else
|
||||
|
|
@ -207,7 +208,8 @@ public class VariantContextAdaptors {
|
|||
String contig = vc.getLocation().getContig();
|
||||
long position = vc.getLocation().getStart();
|
||||
String ID = vc.hasAttribute("ID") ? vc.getAttributeAsString("ID") : ".";
|
||||
double qual = vc.getPhredScaledQual();
|
||||
double qual = vc.hasNegLog10PError() ? vc.getPhredScaledQual() : -1;
|
||||
|
||||
String filters = vc.isFiltered() ? Utils.join(";", Utils.sorted(vc.getFilters())) : VCFRecord.PASSES_FILTERS;
|
||||
|
||||
Map<Allele, VCFGenotypeEncoding> alleleMap = new HashMap<Allele, VCFGenotypeEncoding>();
|
||||
|
|
|
|||
|
|
@ -94,16 +94,16 @@ public class MendelianViolationEvaluator extends VariantEvaluator {
|
|||
|
||||
public String update1(VariantContext vc, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
|
||||
if ( vc.isBiallelic() && vc.hasGenotypes() ) { // todo -- currently limited to biallelic loci
|
||||
nVariants++;
|
||||
|
||||
Genotype momG = vc.getGenotype(trio.mom);
|
||||
Genotype dadG = vc.getGenotype(trio.dad);
|
||||
Genotype childG = vc.getGenotype(trio.child);
|
||||
|
||||
if ( momG == null || dadG == null || childG == null )
|
||||
throw new IllegalArgumentException(String.format("VariantContext didn't contain genotypes for expected trio members: mom=%s dad=%s child=%s", trio.mom, trio.dad, trio.child));
|
||||
|
||||
if ( includeGenotype(momG) && includeGenotype(dadG) && includeGenotype(childG) ) {
|
||||
nVariants++;
|
||||
|
||||
if ( momG == null || dadG == null || childG == null )
|
||||
throw new IllegalArgumentException(String.format("VariantContext didn't contain genotypes for expected trio members: mom=%s dad=%s child=%s", trio.mom, trio.dad, trio.child));
|
||||
|
||||
// all genotypes are good, so let's see if child is a violation
|
||||
|
||||
if ( isViolation(vc, momG, dadG, childG) ) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
package org.broadinstitute.sting.gatk.contexts.variantcontext;
|
||||
|
||||
import org.broadinstitute.sting.WalkerTest;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class VariantEval2IntegrationTest extends WalkerTest {
|
|||
public void testVE2Simple() {
|
||||
HashMap<String, String> expectations = new HashMap<String, String>();
|
||||
expectations.put("-L 1:1-10,000,000", "d58a2a22e5fb3a3d8d90ba02de37f62b");
|
||||
expectations.put("-L 1:1-10,000,000 -family NA19238+NA19239=NA19240 -MVQ 0", "8a928c8ad99428445e53b0b83f8ccdfa");
|
||||
expectations.put("-L 1:1-10,000,000 -family NA19238+NA19239=NA19240 -MVQ 0", "03cddae2afbe0d1a8f5e3490aebc7c9c");
|
||||
|
||||
for ( Map.Entry<String, String> entry : expectations.entrySet() ) {
|
||||
String extraArgs = entry.getKey();
|
||||
|
|
@ -41,10 +41,10 @@ public class VariantEval2IntegrationTest extends WalkerTest {
|
|||
" -B dbsnp_130,dbSNP," + GATKDataLocation + "dbsnp_130_b36.rod" +
|
||||
" -B comp_hapmap,VCF," + validationDataLocation + "CEU_hapmap_nogt_23.vcf";
|
||||
|
||||
String eqMD5s = "380e082222111c7bf962095d9afca8da"; // next two examples should be the same!
|
||||
String eqMD5s = "1606e285d9bd586dc6662b1ace0a3a0e"; // next two examples should be the same!
|
||||
expectations.put("", eqMD5s);
|
||||
expectations.put(" -known comp_hapmap -known dbsnp", eqMD5s);
|
||||
expectations.put(" -known comp_hapmap", "90d7d4d0ff370e9457978b2869782aa0");
|
||||
expectations.put(" -known comp_hapmap", "44773a96d1c5904a57e0e983836768e4");
|
||||
|
||||
for ( Map.Entry<String, String> entry : expectations.entrySet() ) {
|
||||
String extraArgs2 = entry.getKey();
|
||||
|
|
@ -62,7 +62,7 @@ public class VariantEval2IntegrationTest extends WalkerTest {
|
|||
String extraArgs = "-L 1:1-10,000,000 -family NA19238+NA19239=NA19240 -MVQ 30";
|
||||
WalkerTestSpec spec = new WalkerTestSpec( root + " " + extraArgs + " -o %s -outputVCF %s",
|
||||
2,
|
||||
Arrays.asList("b7d52d13e6eb3d593395a644583e449a", "9ec81f7389c0971e44e4b8d2d4af3008"));
|
||||
Arrays.asList("1f2e04f8af061b7190758679a7840f12", "9ec81f7389c0971e44e4b8d2d4af3008"));
|
||||
executeTest("testVE2WriteVCF", spec);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue