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


Java VCFHeaderLineType.Integer方法代码示例

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


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

示例1: checkType

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public static VCFHeaderLineType checkType(String type) {
	type = type.trim().toLowerCase();
	if(type.equals("integer")) {
		return VCFHeaderLineType.Integer;
	} else if(type.equals("float")) {
		return VCFHeaderLineType.Float;
	} else if(type.equals("string")) {
		return VCFHeaderLineType.String;
	} else if(type.equals("character")) {
		return VCFHeaderLineType.Character;
	} else if(type.equals("flag")) {
		return VCFHeaderLineType.Flag;
	} else {
		throw new IllegalArgumentException(ErrorMsg.VU_LINE_TYPE_ERR);
	}
}
 
开发者ID:mulinlab,项目名称:vanno,代码行数:17,代码来源:VannoUtils.java

示例2: getGroupByField

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
private String getGroupByField(List<VcfFile> files, String groupBy) throws IOException {
    IndexSortField sortField = IndexSortField.getByName(groupBy);
    if (sortField == null) {
        VcfFilterInfo info = vcfManager.getFiltersInfo(
            files.stream().map(BaseEntity::getId).collect(Collectors.toList()));

        InfoItem infoItem = info.getInfoItemMap().get(groupBy);
        Assert.notNull(infoItem, "Unknown sort field: " + groupBy);

        if (infoItem.getType() == VCFHeaderLineType.Integer || infoItem.getType() == VCFHeaderLineType.Float) {
            return FeatureIndexFields.getGroupName(infoItem.getName().toLowerCase());
        } else {
            return infoItem.getName().toLowerCase();
        }
    } else {
        if (sortField.getType() == SortField.Type.INT || sortField.getType() == SortField.Type.FLOAT) {
            return sortField.getField().getGroupName();
        } else {
            return sortField.getField().fieldName;
        }
    }
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:23,代码来源:FeatureIndexDao.java

示例3: createTypedValue

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
private static Value createTypedValue(VCFHeaderLineType type, Object value) {
  if (type == VCFHeaderLineType.Flag) {
    return Value.newBuilder().setBoolValue((Boolean) value).build();
  }

  // Booleans are given as Boolean objects. Strangely, Floats and Integers
  // are given as String objects by HTSJDK.
  if (!(value instanceof String)) {
    throw new IllegalStateException("Received non-Boolean, non-List type in non-String format. "
        + "This is most likely due to a change in htsjdk's library.");
  }

  String stringValue = (String) value;
  boolean isNumeric = stringValue.matches("[-+]?\\d+(\\.\\d+)?");

  if (type == VCFHeaderLineType.Integer && isNumeric) {
    return Value.newBuilder().setNumberValue(Integer.parseInt(stringValue)).build();
  }

  if (type == VCFHeaderLineType.Float && isNumeric) {
    return Value.newBuilder().setNumberValue(Double.parseDouble(stringValue)).build();
  }


  return Value.newBuilder().setStringValue(stringValue).build();
}
 
开发者ID:verilylifesciences,项目名称:genomewarp,代码行数:27,代码来源:VcfToVariant.java

示例4: getGroupByField

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
private String getGroupByField(List<VcfFile> files, String groupBy) throws IOException {
    IndexSortField sortField = IndexSortField.getByName(groupBy);
    if (sortField == null) {
        VcfFilterInfo info = vcfManager.getFiltersInfo(
                files.stream().map(BaseEntity::getId).collect(Collectors.toList()));

        InfoItem infoItem = info.getInfoItemMap().get(groupBy);
        Assert.notNull(infoItem, "Unknown sort field: " + groupBy);

        if (infoItem.getType() == VCFHeaderLineType.Integer || infoItem.getType() == VCFHeaderLineType.Float) {
            return FeatureIndexFields.getGroupName(infoItem.getName().toLowerCase());
        } else {
            return infoItem.getName().toLowerCase();
        }
    } else {
        if (sortField.getType() == SortField.Type.INT || sortField.getType() == SortField.Type.FLOAT) {
            return sortField.getField().getGroupName();
        } else {
            return sortField.getField().fieldName;
        }
    }
}
 
开发者ID:epam,项目名称:NGB,代码行数:23,代码来源:FeatureIndexDao.java

示例5: addHeadersInfixes

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public void addHeadersInfixes(VCFHeader header, String prefix, String infix, String note) {
	VCFInfoHeaderLine anLine = new VCFInfoHeaderLine(prefix + infix + "AN", 1, VCFHeaderLineType.Integer,
			"Number of chromosomes with coverage in UK10K genomes" + note);
	header.addMetaDataLine(anLine);

	VCFInfoHeaderLine acLine = new VCFInfoHeaderLine(prefix + infix + "AC", VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Number of chromosomes showing the given allele in UK10K genomes" + note);
	header.addMetaDataLine(acLine);

	VCFInfoHeaderLine afLine = new VCFInfoHeaderLine(prefix + infix + "AF", VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Allele frequency in UK10K genomes" + note);
	header.addMetaDataLine(afLine);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:14,代码来源:UK10KVCFHeaderExtender.java

示例6: addANHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with chromosome count */
private void addANHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) {
	// TODO: change counts to 1 for AN?
	String popName;
	if (pop == ExacPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AN_" + pop, 1, VCFHeaderLineType.Integer,
			"Overall number of positions/chromosomes with coverage in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:13,代码来源:ExacVCFHeaderExtender.java

示例7: addACHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with allele counts */
private void addACHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) {
	String popName;
	if (pop == ExacPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AC_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:12,代码来源:ExacVCFHeaderExtender.java

示例8: addACHetHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with het allele counts */
private void addACHetHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) {
	String popName;
	if (pop != ExacPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HET_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed heterozygous alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:12,代码来源:ExacVCFHeaderExtender.java

示例9: addACHomHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with hom allele counts */
private void addACHomHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) {
	String popName;
	if (pop == ExacPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HOM_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed homozygous alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:12,代码来源:ExacVCFHeaderExtender.java

示例10: addACHemiHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with hemi allele counts */
private void addACHemiHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) {
	String popName;
	if (pop == ExacPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HEMI_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed hemizygous alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:12,代码来源:ExacVCFHeaderExtender.java

示例11: addANHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with chromosome count */
private void addANHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) {
	// TODO: change counts to 1 for AN?
	String popName;
	if (pop == GnomadPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AN_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer,
			"Overall number of positions/chromosomes with coverage in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:14,代码来源:GnomadVCFHeaderExtender.java

示例12: addACHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with allele counts */
private void addACHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) {
	String popName;
	if (pop == GnomadPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AC_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:12,代码来源:GnomadVCFHeaderExtender.java

示例13: addACHetHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with het allele counts */
private void addACHetHeader(VCFHeader header, String prefix, String idInfix, String noteInfix,
		GnomadPopulation pop) {
	String popName;
	if (pop != GnomadPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HET_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed heterozygous alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:13,代码来源:GnomadVCFHeaderExtender.java

示例14: addACHomHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with hom allele counts */
private void addACHomHeader(VCFHeader header, String prefix, String idInfix, String noteInfix,
		GnomadPopulation pop) {
	String popName;
	if (pop == GnomadPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HOM_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed homozygous alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:13,代码来源:GnomadVCFHeaderExtender.java

示例15: addACHemiHeader

import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with hemi allele counts */
private void addACHemiHeader(VCFHeader header, String prefix, String idInfix, String noteInfix,
		GnomadPopulation pop) {
	String popName;
	if (pop == GnomadPopulation.ALL)
		popName = "all populations";
	else
		popName = pop + " / " + pop.getLabel() + " population";
	VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HEMI_" + pop, VCFHeaderLineCount.A,
			VCFHeaderLineType.Integer, "Overall number of observed hemizygous alleles in " + popName + noteInfix);
	header.addMetaDataLine(line);
}
 
开发者ID:charite,项目名称:jannovar,代码行数:13,代码来源:GnomadVCFHeaderExtender.java


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