Heads up everyone:

For consistency, these tools should be writing to the walker's output stream and no longer use the -vcf argument.



git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3140 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-04-09 05:37:25 +00:00
parent e286623f6f
commit fba48b515a
5 changed files with 10 additions and 16 deletions

View File

@ -21,7 +21,6 @@ import org.broadinstitute.sting.utils.genotype.vcf.VCFHeaderLine;
import org.broadinstitute.sting.utils.genotype.vcf.VCFUtils;
import org.broadinstitute.sting.utils.genotype.vcf.VCFWriter;
import java.io.File;
import java.util.*;
@ -33,8 +32,6 @@ import java.util.*;
@Reference(window=@Window(start=-50,stop=50))
@By(DataSource.REFERENCE)
public class VariantAnnotator extends LocusWalker<Integer, Integer> {
@Argument(fullName="vcfOutput", shortName="vcf", doc="VCF file to which all variants should be written with annotations", required=true)
protected File VCF_OUT;
@Argument(fullName="sampleName", shortName="sample", doc="The sample (NA-ID) corresponding to the variant input (for non-VCF input only)", required=false)
protected String sampleName = null;
@ -111,7 +108,7 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
hInfo.add(new VCFHeaderLine("annotatorReference", getToolkit().getArguments().referenceFile.getName()));
hInfo.addAll(engine.getVCFAnnotationDescriptions());
vcfWriter = new VCFWriter(VCF_OUT);
vcfWriter = new VCFWriter(out);
VCFHeader vcfHeader = new VCFHeader(hInfo, samples);
vcfWriter.writeHeader(vcfHeader);
}
@ -154,7 +151,7 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
return 0;
// if the reference base is not ambiguous, we can annotate
Collection<VariantContext> annotatedVCs = Arrays.asList( new VariantContext[] { vc } );
Collection<VariantContext> annotatedVCs = Arrays.asList(vc);
if ( BaseUtils.simpleBaseToBaseIndex(ref.getBase()) != -1 ) {
Map<String, StratifiedAlignmentContext> stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(context.getBasePileup());
if ( stratifiedContexts != null ) {
@ -188,8 +185,7 @@ public class VariantAnnotator extends LocusWalker<Integer, Integer> {
* @param result the number of loci seen.
*/
public void onTraversalDone(Integer result) {
out.printf("Processed %d loci.\n", result);
logger.info("Processed " + result + " loci.\n");
vcfWriter.close();
}
}

View File

@ -28,8 +28,6 @@ import java.util.*;
*/
@Reference(window=@Window(start=0,stop=40))
public class SequenomValidationConverter extends RodWalker<VCFRecord,Integer> {
@Argument(fullName="outputVCF", shortName="vcf", doc="The VCF file to write results", required=true)
protected File vcfFile = null;
@Argument(fullName="maxHardy", doc="Maximum phred-scaled Hardy-Weinberg violation pvalue to consider an assay valid [default:20]", required=false)
protected double maxHardy = 20.0;
@Argument(fullName="maxNoCall", doc="Maximum no-call rate (as a fraction) to consider an assay valid [default:0.05]", required=false)
@ -106,7 +104,7 @@ public class SequenomValidationConverter extends RodWalker<VCFRecord,Integer> {
if ( sampleNames == null )
sampleNames = new TreeSet<String>();
VCFWriter vcfWriter = new VCFWriter(vcfFile);
VCFWriter vcfWriter = new VCFWriter(out);
// set up the info and filter headers
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();

View File

@ -33,7 +33,7 @@ public class SecondBaseSkewIntegrationTest extends WalkerTest {
+"-R " + seqLocation + "references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta "
+"-I " + validationDataLocation + "FHSP_pool3_2bannot.bam "
+"-B variant,Variants," + validationDataLocation + "FHS_pilot_pool3_raw_calls.geli "
+"-vcf %s -sample variant -L " + validationDataLocation + "FHS_test_intervals.interval_list";
+"-o %s -sample variant -L " + validationDataLocation + "FHS_test_intervals.interval_list";
String md5_for_this_test = "c1116b3196cc9f553ae2442a4063bc5e";
@ -49,7 +49,7 @@ public class SecondBaseSkewIntegrationTest extends WalkerTest {
+"-R " + seqLocation + "references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta "
+"-I " + validationDataLocation + "FHSP_pool3_test.bam "
+"-B variant,Variants," + validationDataLocation + "FHS_pilot_pool3_raw_calls.geli "
+"-vcf %s -sample variant -L " + validationDataLocation + "FHS_test_intervals.interval_list";
+"-o %s -sample variant -L " + validationDataLocation + "FHS_test_intervals.interval_list";
String md5_for_this_test = "a297259694ac88f769a45bce96a08e51";
@ -62,7 +62,7 @@ public class SecondBaseSkewIntegrationTest extends WalkerTest {
String test_args = "-T VariantAnnotator -I " + validationDataLocation + "FHS_Pileup_Test.bam"
+ " -R " + seqLocation + "references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta -A SecondBaseSkew"
+ " -sample variant -B variant,VCF," + validationDataLocation + "FHS_pileup_test_chr15.vcf"
+ " -vcf %s -L chr15:46347148";
+ " -o %s -L chr15:46347148";
String expected_md5 = "465f92e689110afeb308c201cb6e8c5a";
WalkerTestSpec spec = new WalkerTestSpec(test_args,1,Arrays.asList(expected_md5));
executeTest("Testing on locus with many indels", spec);

View File

@ -41,7 +41,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest {
}
public static String baseTestString() {
return "-T VariantAnnotator -R " + oneKGLocation + "reference/human_b36_both.fasta -vcf %s";
return "-T VariantAnnotator -R " + oneKGLocation + "reference/human_b36_both.fasta -o %s";
}

View File

@ -9,7 +9,7 @@ public class SequenomValidationConverterIntegrationTest extends WalkerTest {
@Test
public void testSNPs() {
String testPedFile = validationDataLocation + "Sequenom_Test_File.txt";
String testArgs = "-R "+oneKGLocation+"reference/human_b36_both.fasta -T SequenomValidationConverter -B input,Plink,"+testPedFile+" -vcf %s";
String testArgs = "-R "+oneKGLocation+"reference/human_b36_both.fasta -T SequenomValidationConverter -B input,Plink,"+testPedFile+" -o %s";
WalkerTest.WalkerTestSpec spec = new WalkerTestSpec(testArgs, 1,
Arrays.asList("d19f28fdbe3e731522a52c5329777a9f"));
executeTest("Test SNPs", spec);
@ -18,7 +18,7 @@ public class SequenomValidationConverterIntegrationTest extends WalkerTest {
@Test
public void testIndels() {
String testPedFile = validationDataLocation + "pilot2_indel_validation.renamed.ped";
String testArgs = "-R "+oneKGLocation+"reference/human_b36_both.fasta -T SequenomValidationConverter -B input,Plink,"+testPedFile+" -vcf %s";
String testArgs = "-R "+oneKGLocation+"reference/human_b36_both.fasta -T SequenomValidationConverter -B input,Plink,"+testPedFile+" -o %s";
WalkerTest.WalkerTestSpec spec = new WalkerTestSpec(testArgs, 1,
Arrays.asList("257fcd5e345f2853813e37b88fbc707c"));
executeTest("Test Indels", spec);