本文整理汇总了Java中htsjdk.variant.vcf.VCFHeaderLineCount类的典型用法代码示例。如果您正苦于以下问题:Java VCFHeaderLineCount类的具体用法?Java VCFHeaderLineCount怎么用?Java VCFHeaderLineCount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VCFHeaderLineCount类属于htsjdk.variant.vcf包,在下文中一共展示了VCFHeaderLineCount类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkCount
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
public static VCFHeaderLineCount checkCount(String count) {
count = trimAndLC(count);
if(count.equals("integer")) {
return VCFHeaderLineCount.INTEGER;
} else if(count.equals("a")) {
return VCFHeaderLineCount.A;
} else if(count.equals("r")) {
return VCFHeaderLineCount.R;
} else if(count.equals("g")) {
return VCFHeaderLineCount.G;
} else if(count.equals(".")) {
return VCFHeaderLineCount.UNBOUNDED;
} else {
throw new IllegalArgumentException(ErrorMsg.VU_NUM_ERR);
}
}
开发者ID:mulinlab,项目名称:vanno,代码行数:17,代码来源:VannoUtils.java
示例2: filterLine
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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;
}
}
开发者ID:mulinlab,项目名称:vanno,代码行数:23,代码来源:VcfInfoReadConfig.java
示例3: writeInfoString
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
private void writeInfoString(final Map<String, String> infoFields, final StringBuilder builder) {
if (infoFields.isEmpty()) {
builder.append(VCFConstants.EMPTY_INFO_FIELD);
return;
}
boolean isFirst = true;
for (final Map.Entry<String, String> entry : infoFields.entrySet()) {
if (isFirst) isFirst = false;
else builder.append(VCFConstants.INFO_FIELD_SEPARATOR);
builder.append(entry.getKey());
if (!entry.getValue().equals("")) {
final VCFInfoHeaderLine metaData = this.header.getInfoHeaderLine(entry.getKey());
if (metaData == null || metaData.getCountType() != VCFHeaderLineCount.INTEGER || metaData.getCount() != 0) {
builder.append("=");
builder.append(entry.getValue());
}
}
}
}
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:23,代码来源:VC2VcfRecordTransfer.java
示例4: addHeadersInfixes
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
/**
* Add INFO header lines.
*
* <p>
* In the case of annotating a TSV file with REF and ALT columns, annotate reference and
* alternative alleles. Otherwise, annotate with a list of values.
* </p>
*/
private void addHeadersInfixes(VCFHeader header, String prefix, String infix, String note) {
for (String colName : tsvOptions.getColumnNames()) {
final GenericTSVValueColumnDescription desc = tsvOptions.getValueColumnDescriptions()
.get(colName);
final VCFHeaderLineCount count;
if (tsvOptions.getAltAlleleColumnIndex() > 0 && tsvOptions.getRefAlleleColumnIndex() > 0
&& options.isReportOverlapping() && !options.isReportOverlappingAsMatching()) {
if (tsvOptions.isRefAlleleAnnotated()) {
count = VCFHeaderLineCount.R;
} else {
count = VCFHeaderLineCount.A;
}
} else {
count = VCFHeaderLineCount.UNBOUNDED;
}
final VCFInfoHeaderLine headerLine = new VCFInfoHeaderLine(
prefix + infix + desc.getFieldName(), count, desc.getValueType(),
desc.getFieldDescription() + note);
header.addMetaDataLine(headerLine);
}
}
开发者ID:charite,项目名称:jannovar,代码行数:31,代码来源:GenericTSVHeaderExtender.java
示例5: addHeaders
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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);
}
开发者ID:charite,项目名称:jannovar,代码行数:18,代码来源:ClinVarVCFHeaderExtender.java
示例6: writeHeader
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
@Override
public void writeHeader(final VCFHeader header) {
final VCFHeader header2=new VCFHeader(header);
header2.addMetaDataLine(
new VCFInfoHeaderLine(this.ATT,
VCFHeaderLineCount.UNBOUNDED,
VCFHeaderLineType.String,
"TRAP Score:((ALT|GENE|SCORE) in Trap Database http://trap-score.org/"
));
header2.addMetaDataLine(
new VCFInfoHeaderLine(this.ATT_MIN,
1,
VCFHeaderLineType.Float,
"Min Score in Trap Database http://trap-score.org/"
));
header2.addMetaDataLine(
new VCFInfoHeaderLine(this.ATT_MAX,
1,
VCFHeaderLineType.Float,
"Max Score in Trap Database http://trap-score.org/"
));
super.writeHeader(header2);
}
开发者ID:lindenb,项目名称:jvarkit,代码行数:24,代码来源:VcfTrap.java
示例7: writeHeader
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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);
}
开发者ID:lindenb,项目名称:jvarkit,代码行数:25,代码来源:VcfMoveFiltersToInfo.java
示例8: makeVCFInfoHeaderLine
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
VCFInfoHeaderLine makeVCFInfoHeaderLine()
{
if(!is_AC)
{
return new VCFInfoHeaderLine(
getOutputTag(),1,
this.lineType,
"Field "+this.tag+" extracted from Gnomad ("+ome.name()+")"
);
}
else
{
return new VCFInfoHeaderLine(
getOutputTag(),VCFHeaderLineCount.A,
this.lineType,
"Field "+this.tag+" extracted from Gnomad ("+ome.name()+")"
);
}
}
开发者ID:lindenb,项目名称:jvarkit,代码行数:20,代码来源:VcfGnomad.java
示例9: renameVCFInfoHeaderLine
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
public static VCFInfoHeaderLine renameVCFInfoHeaderLine(VCFInfoHeaderLine h,String name)
{
if(h.getCountType()==VCFHeaderLineCount.INTEGER)
{
return new VCFInfoHeaderLine(
name,
h.getCount(),
h.getType(),
h.getDescription()
);
}
else
{
return new VCFInfoHeaderLine(
name,
h.getCountType(),
h.getType(),
h.getDescription()
);
}
}
开发者ID:lindenb,项目名称:jvarkit,代码行数:22,代码来源:VCFUtils.java
示例10: renameVCFFormatHeaderLine
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
public static VCFFormatHeaderLine renameVCFFormatHeaderLine(VCFFormatHeaderLine h,String name)
{
if(h.getCountType()==VCFHeaderLineCount.INTEGER)
{
return new VCFFormatHeaderLine(
name,
h.getCount(),
h.getType(),
h.getDescription()
);
}
else
{
return new VCFFormatHeaderLine(
name,
h.getCountType(),
h.getType(),
h.getDescription()
);
}
}
开发者ID:lindenb,项目名称:jvarkit,代码行数:22,代码来源:VCFUtils.java
示例11: setBedHeaderInfo
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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);
}
开发者ID:mulinlab,项目名称:vanno,代码行数:13,代码来源:AnnoFieldBean_bak.java
示例12: FieldVal
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
public FieldVal(final String fieldName, final VCFInfoHeaderLine info, final FieldFormat format) {
super();
// this.fieldName = fieldName;
// this.info = info;
this.format = format;
count = info.getCountType();
if(count == VCFHeaderLineCount.INTEGER && info.getCount() == 0){
isFlag = true;
}
}
开发者ID:mulinlab,项目名称:vanno,代码行数:11,代码来源:FieldVal.java
示例13: getVCFHeaderInfo
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
public static Set<VCFHeaderLine> getVCFHeaderInfo() {
Set<VCFHeaderLine> headerInfo = new HashSet<VCFHeaderLine>();
headerInfo.add(new VCFFilterHeaderLine("REJECT", "Rejected as a confident somatic mutation"));
headerInfo.add(new VCFFilterHeaderLine("PASS", "Accept as a confident somatic mutation"));
// TODO: what fields do we need here
VCFStandardHeaderLines.addStandardInfoLines(headerInfo, true,
VCFConstants.MAPPING_QUALITY_ZERO_KEY,
VCFConstants.DBSNP_KEY,
VCFConstants.SOMATIC_KEY);
// TODO copy from TCGA spec..
headerInfo.add(new VCFInfoHeaderLine("VT", 1, VCFHeaderLineType.String, "Variant type, can be SNP, INS or DEL"));
VCFStandardHeaderLines.addStandardFormatLines(headerInfo, true,
VCFConstants.GENOTYPE_KEY,
VCFConstants.GENOTYPE_QUALITY_KEY,
VCFConstants.DEPTH_KEY,
VCFConstants.GENOTYPE_ALLELE_DEPTHS,
VCFConstants.GENOTYPE_PL_KEY);
// cancer-specific
// TODO: push to VCFConstants in GATK
headerInfo.add(new VCFFormatHeaderLine("FA", VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Allele fraction of the alternate allele with regard to reference"));
headerInfo.add(new VCFFormatHeaderLine("SS", 1, VCFHeaderLineType.Integer, "Variant status relative to non-adjacent Normal,0=wildtype,1=germline,2=somatic,3=LOH,4=post-transcriptional modification,5=unknown"));
headerInfo.add(new VCFFormatHeaderLine(VCFConstants.RMS_BASE_QUALITY_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Average base quality for reads supporting alleles"));
return headerInfo;
}
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:33,代码来源:VCFGenerator.java
示例14: generateOutputHeader
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
@NotNull
static VCFHeader generateOutputHeader(@NotNull final VCFHeader header, @NotNull final String sampleName) {
final VCFHeader outputVCFHeader = new VCFHeader(header.getMetaDataInInputOrder(), Sets.newHashSet(sampleName));
outputVCFHeader.addMetaDataLine(
new VCFFormatHeaderLine(VCFConstants.GENOTYPE_ALLELE_DEPTHS, VCFHeaderLineCount.R, VCFHeaderLineType.Integer,
"Allelic depths for the ref and alt alleles in the order listed"));
outputVCFHeader.addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_KEY, 1, VCFHeaderLineType.String, "Genotype"));
outputVCFHeader.addMetaDataLine(
new VCFHeaderLine("StrelkaGATKCompatibility", "Added GT fields to strelka calls for gatk compatibility."));
return outputVCFHeader;
}
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:12,代码来源:StrelkaPostProcessApplication.java
示例15: InfoItem
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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();
}
开发者ID:epam,项目名称:NGB,代码行数:10,代码来源:InfoItem.java
示例16: filterInfoByWhiteList
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
private Map<String, Object> filterInfoByWhiteList(VariantContext context,
VcfFilterInfo vcfFilterInfo, VCFHeader vcfHeader) {
Map<String, Object> permittedInfo = new HashMap<>();
Map<String, Object> info = context.getAttributes();
vcfFilterInfo.getInfoItems().forEach(key -> {
if (info.containsKey(key.getName()) && vcfHeader.getInfoHeaderLine(key.getName()) != null) {
int count = vcfHeader.getInfoHeaderLine(key.getName()).getCount(context);
VCFHeaderLineCount countType =
vcfHeader.getInfoHeaderLine(key.getName()).getCountType();
switch (key.getType()) {
case Integer:
addNumberInfo(permittedInfo, info, count, countType,
VCFHeaderLineType.Integer, key);
break;
case Float:
addNumberInfo(permittedInfo, info, count, countType,
VCFHeaderLineType.Float, key);
break;
case Flag:
permittedInfo
.put(key.getName(), parseFlagInfo(permittedInfo, info, count, key));
break;
default:
permittedInfo.put(key.getName(), info.get(key.getName()));
}
}
});
return permittedInfo;
}
开发者ID:epam,项目名称:NGB,代码行数:32,代码来源:FeatureIndexManager.java
示例17: addNumberInfo
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
private void addNumberInfo(Map<String, Object> permittedInfo, Map<String, Object> info,
int count, VCFHeaderLineCount countType, VCFHeaderLineType type, InfoItem key) {
Object value;
if (isVariableLength(countType)) {
value = info.get(key.getName()).toString();
} else if (count > 1) {
value = parseNumberArray(type, info.get(key.getName()));
if (value == null) {
LOGGER.error(MessageHelper.getMessage(
MessagesConstants.ERROR_FEATURE_INDEX_WRITING_WRONG_PARAMETER_TYPE,
key.getName(), key.getType(), info.get(key.getName()).toString()));
return;
}
permittedInfo.put("_" + key.getName() + "_v", info.get(key.getName()).toString());
} else {
String numberString = info.get(key.getName()).toString();
if (NumberUtils.isNumber(numberString)) {
value = parseNumber(type, info.get(key.getName()));
} else {
LOGGER.error(MessageHelper.getMessage(
MessagesConstants.ERROR_FEATURE_INDEX_WRITING_WRONG_PARAMETER_TYPE,
key.getName(), key.getType(), numberString));
return;
}
}
permittedInfo.put(key.getName(), value);
}
开发者ID:epam,项目名称:NGB,代码行数:32,代码来源:FeatureIndexManager.java
示例18: writeAllViolations
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的package包/类
private void writeAllViolations(final MendelianViolationDetector.Result result) {
if (VCF_DIR != null) {
LOG.info(String.format("Writing family violation VCFs to %s/", VCF_DIR.getAbsolutePath()));
final VariantContextComparator vcComparator = new VariantContextComparator(inputHeader.get().getContigLines());
final Set<VCFHeaderLine> headerLines = new LinkedHashSet<>(inputHeader.get().getMetaDataInInputOrder());
headerLines.add(new VCFInfoHeaderLine(MendelianViolationDetector.MENDELIAN_VIOLATION_KEY, 1, VCFHeaderLineType.String, "Type of mendelian violation."));
headerLines.add(new VCFInfoHeaderLine(MendelianViolationDetector.ORIGINAL_AC, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Original AC"));
headerLines.add(new VCFInfoHeaderLine(MendelianViolationDetector.ORIGINAL_AF, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Original AF"));
headerLines.add(new VCFInfoHeaderLine(MendelianViolationDetector.ORIGINAL_AN, 1, VCFHeaderLineType.Integer, "Original AN"));
for (final PedFile.PedTrio trio : pedFile.get().values()) {
final File outputFile = new File(VCF_DIR, IOUtil.makeFileNameSafe(trio.getFamilyId() + IOUtil.VCF_FILE_EXTENSION));
LOG.info(String.format("Writing %s violation VCF to %s", trio.getFamilyId(), outputFile.getAbsolutePath()));
final VariantContextWriter out = new VariantContextWriterBuilder()
.setOutputFile(outputFile)
.unsetOption(INDEX_ON_THE_FLY)
.build();
final VCFHeader newHeader = new VCFHeader(headerLines, CollectionUtil.makeList(trio.getMaternalId(), trio.getPaternalId(), trio.getIndividualId()));
final TreeSet<VariantContext> orderedViolations = new TreeSet<>(vcComparator);
orderedViolations.addAll(result.violations().get(trio.getFamilyId()));
out.writeHeader(newHeader);
orderedViolations.forEach(out::add);
out.close();
}
}
}
开发者ID:broadinstitute,项目名称:picard,代码行数:33,代码来源:FindMendelianViolations.java
示例19: addHeadersInfixes
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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
示例20: addAFHeader
import htsjdk.variant.vcf.VCFHeaderLineCount; //导入依赖的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);
}
开发者ID:charite,项目名称:jannovar,代码行数:12,代码来源:ExacVCFHeaderExtender.java
注:本文中的htsjdk.variant.vcf.VCFHeaderLineCount类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论