本文整理汇总了Java中htsjdk.variant.vcf.VCFHeaderLineType.Float方法的典型用法代码示例。如果您正苦于以下问题:Java VCFHeaderLineType.Float方法的具体用法?Java VCFHeaderLineType.Float怎么用?Java VCFHeaderLineType.Float使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.variant.vcf.VCFHeaderLineType
的用法示例。
在下文中一共展示了VCFHeaderLineType.Float方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: addAFHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with allele frequency */
private void addAFHeader(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 + "AF_" + pop, VCFHeaderLineCount.A,
VCFHeaderLineType.Float, "Frequency observed in ExAC data set in " + popName + noteInfix);
header.addMetaDataLine(line);
}
示例6: addAFHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header with allele frequency */
private void addAFHeader(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 + "AF_" + pop, VCFHeaderLineCount.A,
VCFHeaderLineType.Float, "Frequency observed in ExAC data set in " + popName + noteInfix);
header.addMetaDataLine(line);
}
示例7: FamilyInfo
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
FamilyInfo(final Pedigree.Family pedFamily)
{
this.pedFamily=pedFamily;
final String prefix=
(
StringUtil.isBlank(CtxWriterFactory.this.prefix)?
CtxWriterFactory.this.prefix+"_":""
)+
this.pedFamily.getId()
;
this.ac = new VCFInfoHeaderLine(
prefix+"_AC",
VCFHeaderLineCount.A,
VCFHeaderLineType.Integer,
"Number of alleles carrying the variant allele for the family "+this.pedFamily.getId()
);
this.an = new VCFInfoHeaderLine(
prefix+"_AN",
1,
VCFHeaderLineType.Integer,
"Number of alleles for the family "+this.pedFamily.getId()
);
this.af = new VCFInfoHeaderLine(
prefix+"_AF",
VCFHeaderLineCount.A,
VCFHeaderLineType.Float,
"Allele Frequency for the family "+this.pedFamily.getId()
);
}
示例8: addHeadersInfixes
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public void addHeadersInfixes(VCFHeader header, String prefix, String infix, String note) {
VCFInfoHeaderLine infoDBSNPCommon = new VCFInfoHeaderLine(prefix + infix + "COMMON", VCFHeaderLineCount.A,
VCFHeaderLineType.Integer,
"Flagged as common in dbSNP" + note + ". Original description: RS is a common SNP. A common SNP is "
+ "one that has at least one 1000Genomes population with a minor allele "
+ "of frequency >= 1% and for which 2 or more founders contribute to that minor allele "
+ "frequency.");
header.addMetaDataLine(infoDBSNPCommon);
VCFInfoHeaderLine infoDBSNPFreqs = new VCFInfoHeaderLine(prefix + infix + "CAF", VCFHeaderLineCount.R,
VCFHeaderLineType.Float,
"Allele frequencies from dbSNP" + note + ". Original description: An ordered, comma delimited list "
+ "of allele frequencies based on 1000Genomes, starting with the reference allele "
+ "followed by alternate alleles as ordered in the ALT column. Where a 1000Genomes "
+ "alternate allele is not in the dbSNPs alternate allele set, the allele is added "
+ "to the ALT column. The minor allele is the second largest value in the list, "
+ "and was previuosly reported in VCF as the GMAF. This is the GMAF reported on "
+ "the RefSNP and EntrezSNP pages and VariationReporter");
header.addMetaDataLine(infoDBSNPFreqs);
VCFInfoHeaderLine infoG5 = new VCFInfoHeaderLine(prefix + infix + "G5", VCFHeaderLineCount.A,
VCFHeaderLineType.Integer, "Allele frequency >5% in all populations from dbSNP (yes: 1, no: 0)" + note
+ ". Original description: >5% minor allele frequency in 1+ populations");
header.addMetaDataLine(infoG5);
VCFInfoHeaderLine infoG5A = new VCFInfoHeaderLine(prefix + infix + "G5A", VCFHeaderLineCount.A,
VCFHeaderLineType.Integer, "Allele frequency >5% in all populations from dbSNP (yes: 1, no: 0)" + note
+ ". Original description: >5% minor allele frequency in each and all populations");
header.addMetaDataLine(infoG5A);
if ("OVL_".equals(infix)) {
VCFInfoHeaderLine overlappingRS = new VCFInfoHeaderLine(prefix + "OVL_IDS", VCFHeaderLineCount.A,
VCFHeaderLineType.String, "dbSNP cluster identifiers with overlapping alternative positions, "
+ "not necessarily matching alleles, for each alternative allele, separated '|'");
header.addMetaDataLine(overlappingRS);
} else {
VCFInfoHeaderLine matchingRS = new VCFInfoHeaderLine(prefix + "IDS", VCFHeaderLineCount.A,
VCFHeaderLineType.String,
"dbSNP cluster identifiers with matching alternative positions and alleles, for each "
+ "alternative alleles, separated by '|'");
header.addMetaDataLine(matchingRS);
}
VCFInfoHeaderLine infoOrigin = new VCFInfoHeaderLine(prefix + infix + "SAO", VCFHeaderLineCount.A,
VCFHeaderLineType.String, "Variant allele origin (UNSPECIFIED, GERMLINE, SOMATIC, BOTH)");
header.addMetaDataLine(infoOrigin);
}
示例9: addBestAFHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add header for highest allele frequency */
private void addBestAFHeader(VCFHeader header, String prefix, String idInfix, String noteInfix) {
VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AF_POPMAX", VCFHeaderLineCount.A,
VCFHeaderLineType.Float, "Highest allele frequency seen in any population" + noteInfix);
header.addMetaDataLine(line);
}
示例10: writeHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
@Override
public void writeHeader(final VCFHeader header)
{
final VCFHeader h2= new VCFHeader(header);
this.filter = new VCFFilterHeaderLine("BurdenExac",
"Freq:"+CtxWriterFactory.this.maxFreq+" Pop:"+CtxWriterFactory.this.exacPopulationStr);
h2.addMetaDataLine(this.filter);
this.freqExacInfoHeader = new VCFInfoHeaderLine(
"FreqExac",
VCFHeaderLineCount.A,
VCFHeaderLineType.Float,
"Freq in Exac AC/AN"
);
h2.addMetaDataLine(freqExacInfoHeader);
for(final String pop:exacPopulations)
{
if(pop.isEmpty()) continue;
final VCFInfoHeaderLine ac = exacHeader.getInfoHeaderLine("AC_"+pop);
if(ac==null)
{
throw new JvarkitException.FileFormatError("Cannot find AC_"+pop+" in "+CtxWriterFactory.this.exacFile+" header");
}
if(ac.getCountType()!=VCFHeaderLineCount.A)
{
throw new JvarkitException.FileFormatError("expected VCFHeaderLineCount.A for "+ac );
}
h2.addMetaDataLine(ac);
final VCFInfoHeaderLine an = exacHeader.getInfoHeaderLine("AN_"+pop);
if(an==null)
{
throw new JvarkitException.FileFormatError("Cannot find AN_"+pop+" in "+CtxWriterFactory.this.exacFile+" header");
}
if(an.getCount()!=1)
{
throw new JvarkitException.FileFormatError("expected getCount==1 for "+an );
}
h2.addMetaDataLine(an);
}
super.writeHeader(h2);
}
示例11: KeyAndType
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
KeyAndType(final String key)
{
this(key,VCFHeaderLineCount.A,VCFHeaderLineType.Float);
}