当前位置: 首页>>代码示例>>Java>>正文


Java VCFSimpleHeaderLine类代码示例

本文整理汇总了Java中htsjdk.variant.vcf.VCFSimpleHeaderLine的典型用法代码示例。如果您正苦于以下问题:Java VCFSimpleHeaderLine类的具体用法?Java VCFSimpleHeaderLine怎么用?Java VCFSimpleHeaderLine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VCFSimpleHeaderLine类属于htsjdk.variant.vcf包,在下文中一共展示了VCFSimpleHeaderLine类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFiltersInfo

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
private VcfFilterInfo getFiltersInfo(FeatureReader<VariantContext> reader) throws IOException {
    VcfFilterInfo filterInfo = new VcfFilterInfo();

    VCFHeader header = (VCFHeader) reader.getHeader();
    Collection<VCFInfoHeaderLine> headerLines = header.getInfoHeaderLines();
    Map<String, InfoItem> infoItems = headerLines.stream()
                            .filter(l -> !isExtendedInfoLine(l.getDescription()))    // Exclude ANN from fields,
                            .map(InfoItem::new)                                 // we don't need it in the index
                            .collect(Collectors.toMap(InfoItem::getName, i -> i));
    filterInfo.setAvailableFilters(header.getFilterLines().stream().map(VCFSimpleHeaderLine::getID)
                                .collect(Collectors.toSet()));

    List<String> filtersWhiteList = getFilterWhiteList();
    if (!filtersWhiteList.isEmpty()) {
        infoItems = scourFilterList(infoItems, filtersWhiteList);
    }

    filterInfo.setInfoItemMap(infoItems);

    return filterInfo;
}
 
开发者ID:epam,项目名称:NGB,代码行数:22,代码来源:VcfManager.java

示例2: getVCFHeaderLines

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
/**
 * Get the VCF header lines to include when emitting reference confidence values via calculateRefConfidence
 * @return a non-null set of VCFHeaderLines
 */
public Set<VCFHeaderLine> getVCFHeaderLines() {
    final Set<VCFHeaderLine> headerLines = new LinkedHashSet<>();
    // TODO - do we need a new kind of VCF Header subclass for specifying arbitrary alternate alleles?
    headerLines.add(new VCFSimpleHeaderLine(ALTERNATE_ALLELE_STRING, GATKVariantContextUtils.NON_REF_SYMBOLIC_ALLELE_NAME, "Represents any possible alternative allele at this location"));
    //headerLines.add(new VCFFormatHeaderLine(INDEL_INFORMATIVE_DEPTH, 1, VCFHeaderLineType.Integer, "Number of reads at locus that are informative about an indel of size <= " + indelInformativeDepthIndelSize));
    return headerLines;
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:12,代码来源:ReferenceConfidenceModel.java

示例3: getDefaultToolVCFHeaderLines

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
/**
 * @return If addOutputVCFCommandLine is true, a set of VCF header lines containing the tool name, version,
 * date and command line, otherwise an empty set.
 */
protected Set<VCFHeaderLine> getDefaultToolVCFHeaderLines() {
    final Set<VCFHeaderLine> gatkToolHeaderLines = new HashSet<>();
    if (addOutputVCFCommandLine) {
        final Map<String, String> simpleHeaderLineMap = new HashMap<>(4);
        simpleHeaderLineMap.put("ID", this.getClass().getSimpleName());
        simpleHeaderLineMap.put("Version", getVersion());
        simpleHeaderLineMap.put("Date", Utils.getDateTimeForDisplay((ZonedDateTime.now())));
        simpleHeaderLineMap.put("CommandLine", getCommandLine());
        gatkToolHeaderLines.add(new VCFHeaderLine("source", this.getClass().getSimpleName()));
        gatkToolHeaderLines.add(new VCFSimpleHeaderLine(String.format("%sCommandLine", getToolkitShortName()), simpleHeaderLineMap));
    }
    return gatkToolHeaderLines;
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:18,代码来源:GATKTool.java

示例4: openOutputFile

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
private VariantContextWriter openOutputFile() {
	VariantContextWriterBuilder builder = new VariantContextWriterBuilder()
			.setReferenceDictionary(fasta.getSequenceDictionary()).setOutputFile(options.getPathOutputVCF());
	if (options.getPathOutputVCF().endsWith(".gz") || options.getPathOutputVCF().endsWith(".bcf"))
		builder.setOption(Options.INDEX_ON_THE_FLY);
	else
		builder.unsetOption(Options.INDEX_ON_THE_FLY);
	VariantContextWriter writer = builder.build();

	VCFHeader header = new VCFHeader();
	int i = 0;
	for (SAMSequenceRecord record : fasta.getSequenceDictionary().getSequences()) {
		Map<String, String> mapping = new TreeMap<String, String>();
		mapping.put("ID", record.getSequenceName());
		mapping.put("length", Integer.toString(record.getSequenceLength()));
		header.addMetaDataLine(new VCFContigHeaderLine(mapping, i++));
	}

	header.addMetaDataLine(new VCFSimpleHeaderLine("ALT", "ERROR", "Error in conversion"));
	header.addMetaDataLine(new VCFFilterHeaderLine("PARSE_ERROR",
			"Problem in parsing original HGVS variant string, written out as variant at 1:g.1N>N"));
	header.addMetaDataLine(new VCFInfoHeaderLine("ERROR_MESSAGE", 1, VCFHeaderLineType.String, "Error message"));
	header.addMetaDataLine(new VCFInfoHeaderLine("ORIG_VAR", 1, VCFHeaderLineType.String,
			"Original HGVS variant string from input file to hgvs-to-vcf"));

	writer.writeHeader(header);

	return writer;
}
 
开发者ID:charite,项目名称:jannovar,代码行数:30,代码来源:ProjectTranscriptToChromosome.java

示例5: addHeaderLinesTo

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
/**
 * Adds the alternative allele ALT meta-data lines to a vcf-header.
 * @param header the header to add the lines to.
 * @throws IllegalArgumentException if {@code header} is {@code null}.
 */
public static void addHeaderLinesTo(final VCFHeader header) {
    Utils.nonNull(header);
    header.addMetaDataLine(new VCFSimpleHeaderLine(ALT_KEY, DEL.getBaseString(), Utils.nonNull(DEL_VCF_DESCRIPTION)));
    header.addMetaDataLine(new VCFSimpleHeaderLine(ALT_KEY, DUP.getBaseString(), Utils.nonNull(DUP_VCF_DESCRIPTION)));
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:11,代码来源:CopyNumberTriStateAllele.java

示例6: getVCFHeaderLines

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
/**
 * Get the VCF header lines to include when emitting reference confidence values via {@link #calculateRefConfidence}.
 * @return a non-null set of VCFHeaderLines
 */
public Set<VCFHeaderLine> getVCFHeaderLines() {
    final Set<VCFHeaderLine> headerLines = new LinkedHashSet<>();
    headerLines.add(new VCFSimpleHeaderLine(GATKVCFConstants.SYMBOLIC_ALLELE_DEFINITION_HEADER_TAG, GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE_NAME, "Represents any possible alternative allele at this location"));
    return headerLines;
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:10,代码来源:ReferenceConfidenceModel.java

示例7: testGetHeaderLines

import htsjdk.variant.vcf.VCFSimpleHeaderLine; //导入依赖的package包/类
@Test
public void testGetHeaderLines() throws Exception {
    final Set<VCFHeaderLine> vcfHeaderLines = model.getVCFHeaderLines();
    Assert.assertEquals(vcfHeaderLines.size(), 1);
    Assert.assertEquals(vcfHeaderLines.iterator().next(), new VCFSimpleHeaderLine(GATKVCFConstants.SYMBOLIC_ALLELE_DEFINITION_HEADER_TAG, GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE_NAME, "Represents any possible alternative allele at this location"));
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:7,代码来源:ReferenceConfidenceModelUnitTest.java


注:本文中的htsjdk.variant.vcf.VCFSimpleHeaderLine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。