Package htsjdk.variant.vcf

Examples of htsjdk.variant.vcf.VCFHeader


    }

    @Test(enabled = true)
    public void testSites() {
        VCFCodec codec = new VCFCodec();
        VCFHeader evalHeader = (VCFHeader)codec.readActualHeader(codec.makeSourceFromStream(new PositionalBufferedStream(new StringBufferInputStream(TEST_2_HEADER))));
        VCFHeader compHeader = (VCFHeader)codec.readActualHeader(codec.makeSourceFromStream(new PositionalBufferedStream(new StringBufferInputStream(TEST_2_HEADER))));
        ConcordanceMetrics metrics = new ConcordanceMetrics(evalHeader,compHeader,null);

        List<Pair<VariantContext,VariantContext>> data = getData7();

        int idx = 0;
View Full Code Here


        final Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
        hInfo.addAll(GATKVCFUtils.getHeaderFields(getToolkit(), Arrays.asList(trackName)));
        hInfo.addAll(UnifiedGenotyper.getHeaderInfo(UAC, null, null));

        vcfWriter.writeHeader(new VCFHeader(hInfo, sampleNameSet));
    }
View Full Code Here

    }

    @Test
    public void testHeaderWriting() {
        final GVCFWriter writer = new GVCFWriter(mockWriter, standardPartition, HomoSapiensConstants.DEFAULT_PLOIDY);
        writer.writeHeader(new VCFHeader());
        Assert.assertTrue(mockWriter.headerWritten);
    }
View Full Code Here

        Set<VCFHeaderLine> headerLines = new HashSet<VCFHeaderLine>();
        if ( SET_KEY != null )
            headerLines.add(new VCFInfoHeaderLine(SET_KEY, 1, VCFHeaderLineType.String, "Source VCF for the merged record"));
        if ( STATUS_KEY != null )
            headerLines.add(new VCFInfoHeaderLine(STATUS_KEY, 1, VCFHeaderLineType.String, "Extent to which records match"));
        final VCFHeader vcfHeader = new VCFHeader(headerLines, Collections.<String>emptySet());
        baseWriter.writeHeader(vcfHeader);
        writer = VariantContextWriterFactory.sortOnTheFly(baseWriter, ACTIVE_WINDOW);
    }
View Full Code Here

    public void writeHeader(VCFHeader header) {
        if (useSingleSample != null) { // only want to output context for one sample
            Set<String> singSampSet = new TreeSet<String>();
            singSampSet.add(useSingleSample);
            header = new VCFHeader(header.getMetaDataInSortedOrder(), singSampSet);
        }

        innerWriter.writeHeader(header);
    }
View Full Code Here

        }

        Set<VCFHeaderLine> headerLines = new HashSet<VCFHeaderLine>();
        headerLines.add(new VCFHeaderLine("source", "ValidationSiteSelector"));
        vcfWriter.writeHeader(new VCFHeader(headerLines));

    }
View Full Code Here

    }

    public static Set<String> getSampleList(Map<String, VCFHeader> headers, GATKVariantContextUtils.GenotypeMergeType mergeOption) {
        Set<String> samples = new TreeSet<String>();
        for ( Map.Entry<String, VCFHeader> val : headers.entrySet() ) {
            VCFHeader header = val.getValue();
            for ( String sample : header.getGenotypeSamples() ) {
                samples.add(GATKVariantContextUtils.mergedSampleName(val.getKey(), sample, mergeOption == GATKVariantContextUtils.GenotypeMergeType.UNIQUIFY));
            }
        }

        return samples;
View Full Code Here

     * @return false if there are names duplication between the samples names in the VCF headers
     */
    public static boolean verifyUniqueSamplesNames(Map<String, VCFHeader> VCF_Headers) {
        Set<String> samples = new HashSet<String>();
        for ( Map.Entry<String, VCFHeader> val : VCF_Headers.entrySet() ) {
            VCFHeader header = val.getValue();
            for ( String sample : header.getGenotypeSamples() ) {
                if (samples.contains(sample)){

                    return false;
                }
                samples.add(sample);
View Full Code Here

                + " -o %s -L 20:61098",
                1, Arrays.asList(""));
        spec.disableShadowBCF();
        final File vcf = executeTest("testGATKVersionInVCF", spec).first.get(0);
        final VCFCodec codec = new VCFCodec();
        final VCFHeader header = (VCFHeader) codec.readActualHeader(codec.makeSourceFromStream(new FileInputStream(vcf)));
        final VCFHeaderLine versionLine = header.getMetaDataLine(GATKVCFUtils.GATK_COMMAND_LINE_KEY);
        Assert.assertNotNull(versionLine);
        Assert.assertTrue(versionLine.toString().contains("SelectVariants"));
    }
View Full Code Here

                + " -o %s",
                1, Arrays.asList(""));
        spec.disableShadowBCF();
        final File vcf = executeTest("testMultipleGATKVersionsInVCF", spec).first.get(0);
        final VCFCodec codec = new VCFCodec();
        final VCFHeader header = (VCFHeader) codec.readActualHeader(codec.makeSourceFromStream(new FileInputStream(vcf)));

        boolean foundHC = false;
        boolean foundSV = false;
        for ( final VCFHeaderLine line : header.getMetaDataInInputOrder() ) {
            if ( line.getKey().equals(GATKVCFUtils.GATK_COMMAND_LINE_KEY) ) {
                if ( line.toString().contains("HaplotypeCaller") ) {
                    Assert.assertFalse(foundHC);
                    foundHC = true;
                }
View Full Code Here

TOP

Related Classes of htsjdk.variant.vcf.VCFHeader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.