The SNP genotype concordance module is now more comprehensive.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2330 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-12-11 18:34:33 +00:00
parent 590aeee7d2
commit 2ea7632b76
2 changed files with 36 additions and 27 deletions

View File

@ -34,12 +34,19 @@ public class SNPGenotypeConcordance implements ConcordanceType {
Genotype call1 = samplesToRecords.get(sample1); Genotype call1 = samplesToRecords.get(sample1);
Genotype call2 = samplesToRecords.get(sample2); Genotype call2 = samplesToRecords.get(sample2);
// the only reason they would be null is a lack of coverage
if ( call1 == null || call2 == null ) { if ( call1 == null || call2 == null ) {
if ( call1 != null && call1.isPointGenotype() && (10.0 * call1.getNegLog10PError()) >= Qscore ) if ( call1 != null && call1.isPointGenotype() ) {
return "set1ConfidentVariantSet2NoCoverage"; if ( 10.0 * call1.getNegLog10PError() >= Qscore )
else if ( call2 != null && call2.isPointGenotype() && (10.0 * call2.getNegLog10PError()) >= Qscore ) return "set1ConfidentSet2NoCall";
return "set1NoCoverageSet2ConfidentVariant"; else
return "set2NoCall";
}
else if ( call2 != null && call2.isPointGenotype() ) {
if (10.0 * call2.getNegLog10PError() >= Qscore )
return "set1NoCallSet2Confident";
else
return "set1NoCall";
}
return null; return null;
} }
@ -51,30 +58,32 @@ public class SNPGenotypeConcordance implements ConcordanceType {
// are they both variant SNPs? // are they both variant SNPs?
if ( call1.isPointGenotype() && call2.isPointGenotype() ) { if ( call1.isPointGenotype() && call2.isPointGenotype() ) {
// are they both confident calls? // are they confident calls?
if ( confidence1 >= Qscore && confidence2 >= Qscore ) { boolean conf1 = confidence1 >= Qscore;
// same genotype boolean conf2 = confidence2 >= Qscore;
if ( genotype1.equals(genotype2) ) boolean confCombo = !conf1 && !conf2 && confidence1 + confidence2 >= Qscore;
return "sameConfidentVariant";
// same allele, different genotype StringBuffer result = new StringBuffer("");
else if ( sameVariantAllele(genotype1, genotype2, ref.getBase()) ) if ( conf1 && conf2 )
return "sameVariantAlleleDifferentGenotype"; result.append("bothConfident");
else if ( confCombo )
result.append("confidentWhenCombined");
else if ( conf1 ||conf2 )
result.append("onlyOneConfident");
else
result.append("neitherConfident");
// different variant allele result.append("_");
else
return "differentVariantAllele";
}
// confident only when combined // are they the same genotype
else if ( confidence1 < Qscore && confidence2 < Qscore && confidence1 + confidence2 >= Qscore ) { if ( genotype1.equals(genotype2) )
return "confidentVariantWhenCombined"; result.append("sameGenotype");
} else if ( sameVariantAllele(genotype1, genotype2, ref.getBase()) )
result.append("differentGenotypeSameVariantAllele");
else
result.append("differentVariantAllele");
// only one is confident variant return result.toString();
else if ( (confidence1 < Qscore && confidence2 >= Qscore) || (confidence1 >= Qscore && confidence2 < Qscore) ) {
return "bothVariantOnlyOneIsConfident";
}
} }
// one is variant and the other is ref // one is variant and the other is ref

View File

@ -22,7 +22,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
public void testSNPConcordance() { public void testSNPConcordance() {
WalkerTestSpec spec = new WalkerTestSpec( WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B set1,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example1.vcf -B set2,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example2.vcf -CT SNPGenotypeConcordance:qscore=5", 1, baseTestString() + " -B set1,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example1.vcf -B set2,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example2.vcf -CT SNPGenotypeConcordance:qscore=5", 1,
Arrays.asList("c21d59fc3194c39c662d2e74b53dcf9c")); Arrays.asList("8a17c93572a2c498feeaf8ba172d40d6"));
executeTest("testSNPConcordance", spec); executeTest("testSNPConcordance", spec);
} }
@ -38,7 +38,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
public void testMulti() { public void testMulti() {
WalkerTestSpec spec = new WalkerTestSpec( WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B set1,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example1.vcf -B set2,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example2.vcf -CT SimpleVenn -CT NWayVenn -CT SNPGenotypeConcordance:qscore=5", 1, baseTestString() + " -B set1,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example1.vcf -B set2,VCF,/humgen/gsa-scr1/GATK_Data/Validation_Data/NA12878.example2.vcf -CT SimpleVenn -CT NWayVenn -CT SNPGenotypeConcordance:qscore=5", 1,
Arrays.asList("9bcc83aadac00a160cef20e7126368ee")); Arrays.asList("4e0f768389028dbd09266ee1802ccd3b"));
executeTest("testMulti", spec); executeTest("testMulti", spec);
} }
} }