Reverting

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2792 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
rpoplin 2010-02-05 15:57:09 +00:00
parent af8c47fc2f
commit be33d1852c
2 changed files with 17 additions and 31 deletions

View File

@ -2,7 +2,6 @@ package org.broadinstitute.sting.gatk.walkers.varianteval;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.RodVCF;
import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.genotype.Variation;
@ -20,7 +19,6 @@ import java.util.List;
*/
public class TransitionTranversionAnalysis extends BasicVariantAnalysis implements GenotypeAnalysis, PopulationAnalysis {
long nTransitions = 0, nTransversions = 0;
long novelTransitions = 0, novelTransversions = 0;
public TransitionTranversionAnalysis() {
super("transitions_transversions");
@ -28,16 +26,12 @@ public class TransitionTranversionAnalysis extends BasicVariantAnalysis implemen
public String update(Variation eval, RefMetaDataTracker tracker, char ref, AlignmentContext context) {
if (eval != null && eval.isSNP()) {
boolean isNovel = false;
if( eval instanceof RodVCF && ((RodVCF)eval).isNovel() ) { isNovel = true; }
final char altBase = eval.getAlternativeBaseForSNP();
final BaseUtils.BaseSubstitutionType subType = BaseUtils.SNPSubstitutionType((byte)ref, (byte)altBase);
char altBase = eval.getAlternativeBaseForSNP();
BaseUtils.BaseSubstitutionType subType = BaseUtils.SNPSubstitutionType((byte)ref, (byte)altBase);
if (subType == BaseUtils.BaseSubstitutionType.TRANSITION) {
nTransitions++;
if( isNovel ) { novelTransitions++; }
} else {
nTransversions++;
if( isNovel ) { novelTransversions++; }
}
}
return null;
@ -45,15 +39,9 @@ public class TransitionTranversionAnalysis extends BasicVariantAnalysis implemen
public List<String> done() {
List<String> s = new ArrayList<String>();
s.add(String.format("transitions %d", nTransitions));
s.add(String.format("transversions %d", nTransversions));
if( novelTransitions != 0 || novelTransversions != 0 ) {
s.add(String.format("overall ratio %.2f", nTransitions / (1.0 * nTransversions)));
s.add(String.format("known var ratio %.2f", (nTransitions-novelTransitions) / (1.0 * (nTransversions-novelTransversions))));
s.add(String.format("novel var ratio %.2f", novelTransitions / (1.0 * novelTransversions)));
} else {
s.add(String.format("ratio %.2f", nTransitions / (1.0 * nTransversions)));
}
s.add(String.format("transitions %d", nTransitions));
s.add(String.format("transversions %d", nTransversions));
s.add(String.format("ratio %.2f", nTransitions / (1.0 * nTransversions)));
return s;
}
}

View File

@ -18,8 +18,8 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
@Test
public void testEvalVariantROD() {
HashMap<String, String> md5 = new HashMap<String, String>();
md5.put("", "fc7ac42cc7d8ca69ef74cb1b5b22c936");
md5.put("-A", "3b40fc03f37959930a6a5ff071c930d0");
md5.put("", "9cfda40f521d75a3e8bafc44a663c14a");
md5.put("-A", "8fea7cc25f551ce170636fc35c5ae0fe");
/**
* the above MD5 was calculated from running the following command:
@ -52,7 +52,7 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
@Test
public void testEvalVariantRODConfSix() {
List<String> md5 = new ArrayList<String>();
md5.add("384bc435181169db3bcd10d6167c26ce");
md5.add("11d636d105f902680c46b9f2e330d922");
/**
* the above MD5 was calculated from running the following command:
@ -84,7 +84,7 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
@Test
public void testEvalVariantRODOutputViolations() {
List<String> md5 = new ArrayList<String>();
md5.add("e5387aa7e0f2ef384c80c6c06f00bc2f");
md5.add("12ecd457d62329e9d4e593de904a457d");
/**
* the above MD5 was calculated from running the following command:
@ -116,7 +116,7 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
@Test
public void testEvalGenotypeROD() {
List<String> md5 = new ArrayList<String>();
md5.add("47818d5fd4f70c2cd230efca9e904cca");
md5.add("cbe45debc69e83d2b90988ee72042074");
/**
* the above MD5 was calculated after running the following command:
*
@ -150,7 +150,7 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
@Test
public void testEvalMarksGenotypingExample() {
List<String> md5 = new ArrayList<String>();
md5.add("21f5e7cde49bbe89b1cb3b77a26248c2");
md5.add("2694cf3eb73a9fecdda8cf5b76d0135d");
/**
* Run with the following commands:
*
@ -174,11 +174,10 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
List<File> result = executeTest("testEvalMarksGenotypingExample", spec).getFirst();
}
/*
@Test
public void testEvalRuntimeWithLotsOfIntervals() {
List<String> md5 = new ArrayList<String>();
md5.add("80035193b8808364d3943b5324b88cdd");
md5.add("6a90341517fc3c5026529301d9970c7b");
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-T VariantEval -R " + oneKGLocation + "reference/human_b36_both.fasta " +
"-B eval,Variants," + validationDataLocation + "NA12878.pilot_3.all.geli.calls " +
@ -190,16 +189,15 @@ public class VariantEvalWalkerIntegrationTest extends WalkerTest {
md5);
List<File> result = executeTest("testEvalRuntimeWithLotsOfIntervals", spec).getFirst();
}
*/
@Test
public void testVCFVariantEvals() {
HashMap<String, String> md5 = new HashMap<String, String>();
md5.put("", "f9886ce74db761bf56ca64751bef1c96");
md5.put("-A", "ff19b75bd3ff1abf1d39b453a239f2a4");
md5.put("-A --includeFilteredRecords", "b45a50277d883092b01ea4659a4e37a5");
md5.put("-A --sampleName NA12878", "f099222b13cd45105df477a734bd02f0");
md5.put("-A -vcfInfoSelector AF=0.50", "29af280d8d0905c2393a82acb638e59b");
md5.put("", "a1c5c8e9b185108969528e8c9fbef15e");
md5.put("-A", "2ae1456de2375502689c4af8f40b8693");
md5.put("-A --includeFilteredRecords", "9b2f446f0f42ab10d9d27f5221748f5e");
md5.put("-A --sampleName NA12878", "38deda8ab3816f083f0aeb97ccf8c347");
md5.put("-A -vcfInfoSelector AF=0.50", "715ea2da250f58aa35004386a890f5ba");
for ( Map.Entry<String, String> e : md5.entrySet() ) {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(