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:
parent
cea544871d
commit
076481f786
|
|
@ -337,10 +337,10 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod,
|
||||||
return mCurrentRecord.isFiltered();
|
return mCurrentRecord.isFiltered();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFilteringCodes() {
|
// public boolean hasFilteringCodes() {
|
||||||
assertNotNull();
|
// assertNotNull();
|
||||||
return mCurrentRecord.hasFilteringCodes();
|
// return mCurrentRecord.hasFilteringCodes();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getFilterString() {
|
public String getFilterString() {
|
||||||
assertNotNull();
|
assertNotNull();
|
||||||
|
|
|
||||||
|
|
@ -350,9 +350,9 @@ public class VCFRecord implements Variation, VariantBackedByGenotype {
|
||||||
return !codes[0].equals(UNFILTERED) && !codes[0].equals(PASSES_FILTERS);
|
return !codes[0].equals(UNFILTERED) && !codes[0].equals(PASSES_FILTERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFilteringCodes() {
|
// public boolean hasFilteringCodes() {
|
||||||
return mFilterString != null;
|
// return mFilterString != null;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getFilterString() {
|
public String getFilterString() {
|
||||||
return mFilterString;
|
return mFilterString;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
||||||
import org.broadinstitute.sting.gatk.refdata.RodVCF;
|
import org.broadinstitute.sting.gatk.refdata.RodVCF;
|
||||||
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
||||||
import org.broadinstitute.sting.utils.Pair;
|
import org.broadinstitute.sting.utils.Pair;
|
||||||
|
import org.broadinstitute.sting.utils.Utils;
|
||||||
import org.broadinstitute.sting.utils.genotype.*;
|
import org.broadinstitute.sting.utils.genotype.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -140,7 +141,7 @@ public class VCFUtils {
|
||||||
double totalFreq = 0.0;
|
double totalFreq = 0.0;
|
||||||
int freqsSeen = 0;
|
int freqsSeen = 0;
|
||||||
String id = null;
|
String id = null;
|
||||||
String filter = null;
|
List<String> filters = new ArrayList<String>();
|
||||||
|
|
||||||
for ( RodVCF rod : rods ) {
|
for ( RodVCF rod : rods ) {
|
||||||
List<VCFGenotypeRecord> myGenotypes = rod.getVCFGenotypeRecords();
|
List<VCFGenotypeRecord> myGenotypes = rod.getVCFGenotypeRecords();
|
||||||
|
|
@ -173,8 +174,8 @@ public class VCFUtils {
|
||||||
if ( rod.getID() != null )
|
if ( rod.getID() != null )
|
||||||
id = rod.getID();
|
id = rod.getID();
|
||||||
|
|
||||||
if ( rod.hasFilteringCodes() )
|
if ( rod.isFiltered() )
|
||||||
filter = rod.getFilterString();
|
filters.add(rod.getFilterString());
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> infoFields = new HashMap<String, String>();
|
Map<String, String> infoFields = new HashMap<String, String>();
|
||||||
|
|
@ -193,7 +194,7 @@ public class VCFUtils {
|
||||||
(id != null ? id : "."),
|
(id != null ? id : "."),
|
||||||
params.getAlternateBases(),
|
params.getAlternateBases(),
|
||||||
maxConfidence,
|
maxConfidence,
|
||||||
(filter != null ? filter : "."),
|
filters.size() == 0 ? "0" : Utils.join(";", filters),
|
||||||
infoFields,
|
infoFields,
|
||||||
params.getFormatString(),
|
params.getFormatString(),
|
||||||
params.getGenotypesRecords());
|
params.getGenotypesRecords());
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
|
||||||
public void testSimpleVenn() {
|
public void testSimpleVenn() {
|
||||||
WalkerTestSpec spec = new WalkerTestSpec(
|
WalkerTestSpec spec = new WalkerTestSpec(
|
||||||
baseTestString() + " -B set1,VCF," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -CT SimpleVenn", 1,
|
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);
|
executeTest("testSimpleVenn", spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -CT SNPGenotypeConcordance:qscore=5", 1,
|
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);
|
executeTest("testSNPConcordance", spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class CallsetConcordanceIntegrationTest extends WalkerTest {
|
||||||
public void testNWayVenn() {
|
public void testNWayVenn() {
|
||||||
WalkerTestSpec spec = new WalkerTestSpec(
|
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,
|
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);
|
executeTest("testNWayVenn", 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," + validationDataLocation + "NA12878.example1.vcf -B set2,VCF," + validationDataLocation + "NA12878.example2.vcf -CT SimpleVenn -CT NWayVenn -CT SNPGenotypeConcordance:qscore=5", 1,
|
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);
|
executeTest("testMulti", spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue