Fixes to mergeVCF -- now correctly supports merging of filter fields. Also removed incorrect hasFilteringCodes() function. Updated intergration tests

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2535 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2010-01-07 14:50:13 +00:00
parent cea544871d
commit 076481f786
5 changed files with 17 additions and 16 deletions

View File

@ -337,10 +337,10 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod,
return mCurrentRecord.isFiltered();
}
public boolean hasFilteringCodes() {
assertNotNull();
return mCurrentRecord.hasFilteringCodes();
}
// public boolean hasFilteringCodes() {
// assertNotNull();
// return mCurrentRecord.hasFilteringCodes();
// }
public String getFilterString() {
assertNotNull();

View File

@ -26,7 +26,7 @@ public class SimpleVenn implements ConcordanceType {
sample2 = iter.next();
}
public String computeConcordance(Map<String, Genotype> samplesToRecords, ReferenceContext ref) {
public String computeConcordance(Map<String, Genotype> samplesToRecords, ReferenceContext ref ) {
Genotype call1 = samplesToRecords.get(sample1);
if ( call1 != null && call1.isNoCall() )

View File

@ -350,9 +350,9 @@ public class VCFRecord implements Variation, VariantBackedByGenotype {
return !codes[0].equals(UNFILTERED) && !codes[0].equals(PASSES_FILTERS);
}
public boolean hasFilteringCodes() {
return mFilterString != null;
}
// public boolean hasFilteringCodes() {
// return mFilterString != null;
// }
public String getFilterString() {
return mFilterString;

View File

@ -5,6 +5,7 @@ import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
import org.broadinstitute.sting.gatk.refdata.RodVCF;
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
import org.broadinstitute.sting.utils.Pair;
import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.genotype.*;
import java.util.*;
@ -140,7 +141,7 @@ public class VCFUtils {
double totalFreq = 0.0;
int freqsSeen = 0;
String id = null;
String filter = null;
List<String> filters = new ArrayList<String>();
for ( RodVCF rod : rods ) {
List<VCFGenotypeRecord> myGenotypes = rod.getVCFGenotypeRecords();
@ -173,8 +174,8 @@ public class VCFUtils {
if ( rod.getID() != null )
id = rod.getID();
if ( rod.hasFilteringCodes() )
filter = rod.getFilterString();
if ( rod.isFiltered() )
filters.add(rod.getFilterString());
}
Map<String, String> infoFields = new HashMap<String, String>();
@ -193,7 +194,7 @@ public class VCFUtils {
(id != null ? id : "."),
params.getAlternateBases(),
maxConfidence,
(filter != null ? filter : "."),
filters.size() == 0 ? "0" : Utils.join(";", filters),
infoFields,
params.getFormatString(),
params.getGenotypesRecords());

View File

@ -14,7 +14,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
public void testSimpleVenn() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B set1,VCF," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -CT SimpleVenn", 1,
Arrays.asList("f4c4b7430f0e293c27ce38cb89b9338b"));
Arrays.asList("c0376dcd60f1741eac2917f10b4bb7a4"));
executeTest("testSimpleVenn", spec);
}
@ -22,7 +22,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
public void testSNPConcordance() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B set1,VCF," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -CT SNPGenotypeConcordance:qscore=5", 1,
Arrays.asList("f754e046bc0fa3a4b3430061e412ef0d"));
Arrays.asList("ffc13b79f6a18158f63cc9a8ee968f32"));
executeTest("testSNPConcordance", spec);
}
@ -30,7 +30,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
public void testNWayVenn() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B set1,VCF," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -B set3,VCF," + validationDataLocation + "CEU.sample.vcf -CT NWayVenn", 1,
Arrays.asList("86d2342fabc8c0916a6d42a29f750ea2"));
Arrays.asList("39717fb57526e54540e803a1f9c5d31b"));
executeTest("testNWayVenn", spec);
}
@ -38,7 +38,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
public void testMulti() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B set1,VCF," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -CT SimpleVenn -CT NWayVenn -CT SNPGenotypeConcordance:qscore=5", 1,
Arrays.asList("6fbe00cb68d2cdc59dfcb79024fd9893"));
Arrays.asList("0b5b0c9ce7e21d1d2c38ebaad7765017"));
executeTest("testMulti", spec);
}