本文整理汇总了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);
}
}
示例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;
}
}
}
示例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();
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}