本文整理汇总了Java中htsjdk.variant.vcf.VCFHeaderLineType.String方法的典型用法代码示例。如果您正苦于以下问题:Java VCFHeaderLineType.String方法的具体用法?Java VCFHeaderLineType.String怎么用?Java VCFHeaderLineType.String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.variant.vcf.VCFHeaderLineType
的用法示例。
在下文中一共展示了VCFHeaderLineType.String方法的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: filterLine
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean filterLine(final T obj, String line) {
if(line.startsWith(BEGIN)) {
if(currentField != null) {
Map<String, VCFInfoHeaderLine> infoMap = (Map<String, VCFInfoHeaderLine>)obj;
infoMap.put(currentField, new VCFInfoHeaderLine(currentField, count, type, desc));
}
currentField = line.substring(1);
if(currentField.trim().equals("")) throw new IllegalArgumentException("Field name is empty, please check filed name starts with @");
desc = "";
count = VCFHeaderLineCount.UNBOUNDED;
type = VCFHeaderLineType.String;
return false;
} else if(line.equals("") || line.startsWith(COMMENT_LINE)) {
return false;
} else {
return true;
}
}
示例3: addHeaders
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
private void addHeaders(VCFHeader header, String prefix, String infix, String note) {
VCFInfoHeaderLine infoClinVarBasicInfo = new VCFInfoHeaderLine(prefix + infix + "BASIC_INFO",
VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.String,
"Annotation of basic info with the form 'allele | hgvs string | origin'" + note);
header.addMetaDataLine(infoClinVarBasicInfo);
VCFInfoHeaderLine infoClinVarVarInfo = new VCFInfoHeaderLine(prefix + infix + "VAR_INFO",
VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.String,
"Annotation of variant source information of the form 'allele | db name | id in db | origins'" + note);
header.addMetaDataLine(infoClinVarVarInfo);
VCFInfoHeaderLine infoClinVarDiseaseInfo = new VCFInfoHeaderLine(prefix + infix + "DISEASE_INFO",
VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.String,
"Annotation of disease information of the form 'allele | significance | disease db | id in disease db "
+ "| name in disease db | revision status | clinical accession'" + note);
header.addMetaDataLine(infoClinVarDiseaseInfo);
}
示例4: writeHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
@Override
public void writeHeader(final VCFHeader header) {
this.limitToThoseFilters =
CtxWriterFactory.this.onlyThoseFiltersTagStr.stream().flatMap(
S->Arrays.asList(S.split("[, ]")).stream()).
filter(S->!StringUtil.isBlank(S)).
collect(Collectors.toSet())
;
this.infoHeaderLine = new VCFInfoHeaderLine(
CtxWriterFactory.this.infoName.trim(),
VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String,
"Variant was previously FILTERed with the given values."
);
if(header.getInfoHeaderLine(infoHeaderLine.getID())!=null)
{
throw new JvarkitException.UserError("INFO["+this.infoHeaderLine.getID()+"] already exists in input VCF.");
}
final VCFHeader h2= new VCFHeader(header);
h2.addMetaDataLine(this.infoHeaderLine);
super.writeHeader(h2);
}
示例5: setBedHeaderInfo
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public void setBedHeaderInfo(String dbLabel) {
if(count == null) {
System.err.println("You should set number for field " + name + " of bed file " + dbLabel + ", or we will use 'number=.' instead. ");
count = VCFHeaderLineCount.UNBOUNDED;
}
if(type == null) {
System.err.println("You should set type for field " + name + " of bed file " + dbLabel + ", or we will use 'type=string' instead. ");
type = VCFHeaderLineType.String;
}
// if(count == null || type == null) throw new IllegalArgumentException("DB format is bed, please set number and type for field name " + name);
this.vcfInfo = new VCFInfoHeaderLine((outName != null) ? outName:getName() , count, type, description);
}
示例6: InfoItem
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public InfoItem(VCFInfoHeaderLine line) {
this.name = line.getID();
if (line.getCountType() != VCFHeaderLineCount.INTEGER) {
this.type = VCFHeaderLineType.String;
} else {
this.type = line.getType();
}
this.description = line.getDescription();
}
示例7: extendHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public void extendHeader(VCFHeader vcfHeader, String prefix) {
VCFInfoHeaderLine inheritanceLine = new VCFInfoHeaderLine(key(prefix), VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String, "Compatible inheritance modes (AD, AR, XD, XR, MT)");
vcfHeader.addMetaDataLine(inheritanceLine);
VCFInfoHeaderLine subInheritanceLine = new VCFInfoHeaderLine(keySub(prefix), VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String,
"Extra annotation for recessive inheritance sub type (AR_HOM_ALT, AR_COMP_HET, XR_HOM_ALT, XR_COMP_HET)");
vcfHeader.addMetaDataLine(subInheritanceLine);
}
示例8: extendHeaderFields
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/**
* Extend a {@link VCFHeader} with the given <code>fields</code>.
*
* @param header
* the {@link VCFHeader} to extend
* @return extended VCFHeader
*/
public static VCFHeader extendHeaderFields(VCFHeader header) {
// add INFO line for standardized ANN field
VCFInfoHeaderLine annLine = new VCFInfoHeaderLine("ANN", 1, VCFHeaderLineType.String,
Annotation.VCF_ANN_DESCRIPTION_STRING);
header.addMetaDataLine(annLine);
return header;
}
示例9: writeHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
@Override
public void writeHeader(final VCFHeader header) {
final File srcbedfile = this.tabixFile==null?this.treeMapFile:this.tabixFile;
this.vcfDict = header.getSequenceDictionary();
final VCFHeader h2=new VCFHeader(header);
this.infoHeader=
new VCFInfoHeaderLine(
this.infoName,
VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String,
"metadata added from "+ srcbedfile+
" . Format was "+this.formatPattern
);
this.filterOverlap =
(this.filterOverlapStr==null || this.filterNoOverlapStr.trim().isEmpty()?null:
new VCFFilterHeaderLine(this.filterOverlapStr, "Variant overlap with "+srcbedfile)
);
this.filterNoOverlap =
(this.filterNoOverlapStr==null || this.filterNoOverlapStr.trim().isEmpty()?null:
new VCFFilterHeaderLine(this.filterNoOverlapStr, "Variant having NO overlap with "+srcbedfile)
);
if(this.filterOverlap!=null) h2.addMetaDataLine(this.filterOverlap);
if(this.filterNoOverlap!=null) h2.addMetaDataLine(this.filterNoOverlap);
h2.addMetaDataLine(this.infoHeader);
//addMetaData(h2);
super.writeHeader(h2);
}
示例10: IgvReview
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public IgvReview()
{
this.preferences = Preferences.userNodeForPackage(IgvReview.class);
final String userName=System.getProperty("user.name", "user").replace(" ", "_");
this.reviewFormat = new VCFFormatHeaderLine(userName+"_REVIEW",1,VCFHeaderLineType.String,"Review genotypes by "+userName);
}
示例11: createDefaultParser
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** create a parser without the VCF header */
public AnnPredictionParser createDefaultParser()
{
final VCFHeader tmpheader=new VCFHeader();
final VCFInfoHeaderLine info=new VCFInfoHeaderLine(
AnnPredictionParser.getDefaultTag(),
VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String,
""
);
tmpheader.addMetaDataLine(info);
return new AnnPredictionParser(tmpheader, getTag());
}
示例12: initSnpEffParser
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
public void initSnpEffParser(final String definition)
{
failIf(definition==null || definition.trim().isEmpty(),"SnpEff definition is empty");
final VCFHeader header=new VCFHeader();
final VCFInfoHeaderLine info=new VCFInfoHeaderLine(
VepPredictionParser.getDefaultTag(),
VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String,
definition
);
header.addMetaDataLine(info);
this.vepPredictionParser=new VepPredictionParserFactory(header).get();
}
示例13: parseOtherGenotypeFields
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
private static boolean parseOtherGenotypeFields(String field, VariantContext vc,
ListValue.Builder lvBuilder, Genotype g, VCFHeader header) {
if (!g.hasAnyAttribute(field)) {
return false;
}
final VCFFormatHeaderLine metaData = header.getFormatHeaderLine(field);
if (metaData == null) {
logger.log(Level.WARNING, String.format("Could not find matching VCF header field for "
+ "genotype field %s", field));
return false;
}
VCFHeaderLineType type = metaData.getType();
Object value = g.getExtendedAttribute(field);
final int fieldCount = metaData.getCount(vc);
if (fieldCount == 1) {
lvBuilder.addValues(createTypedValue(type, value));
return true;
}
if (!(value instanceof String)) {
throw new IllegalStateException("received non-Flag genotype field as non-String type");
}
String[] valueArray = ((String) value).split(",");
if (valueArray.length == 1) {
throw new IllegalStateException(String.format("header indicating a count greater than 1 "
+ "with non-List type found for field %s",
field));
}
boolean allFalse = true;
for (int i = 0; i < valueArray.length; i++) {
VCFHeaderLineType thisType = VCFHeaderLineType.String;
if (!valueArray[i].equals(VCFConstants.MISSING_VALUE_v4)) {
thisType = type;
allFalse = false;
}
lvBuilder.addValues(createTypedValue(thisType, valueArray[i]));
}
// We only add the lvBuilder if there is at least one non-missing value
return !allFalse;
}
示例14: 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);
}
示例15: addPopmaxHeader
import htsjdk.variant.vcf.VCFHeaderLineType; //导入方法依赖的package包/类
/** Add POPMAX name */
private void addPopmaxHeader(VCFHeader header, String prefix, String idInfix, String noteInfix) {
VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "POPMAX", VCFHeaderLineCount.A,
VCFHeaderLineType.String, "Population with the max AF" + noteInfix);
header.addMetaDataLine(line);
}