private void validate() { if (type != VCFHeaderLineType.Flag && countType == VCFHeaderLineCount.INTEGER && count <= 0) throw new IllegalArgumentException(String.format("Invalid count number, with fixed count the number should be 1 or higher: key=%s name=%s type=%s desc=%s lineType=%s count=%s", getKey(), name, type, description, lineType, count)); if (name == null || type == null || description == null || lineType == null) throw new IllegalArgumentException(String.format("Invalid VCFCompoundHeaderLine: key=%s name=%s type=%s desc=%s lineType=%s", getKey(), name, type, description, lineType)); if (name.contains("<") || name.contains(">")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain angle brackets"); if (name.contains("=")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain an equals sign"); if (type == VCFHeaderLineType.Flag && count != 0) { count = 0; if (GeneralUtils.DEBUG_MODE_ENABLED) { System.err.println("FLAG fields must have a count value of 0, but saw " + count + " for header line " + getID() + ". Changing it to 0 inside the code"); } } }
private void validate() { if (type != VCFHeaderLineType.Flag && countType == VCFHeaderLineCount.INTEGER && count <= 0) throw new IllegalArgumentException(String.format("Invalid count number, with fixed count the number should be 1 or higher: key=%s name=%s type=%s desc=%s lineType=%s count=%s", getKey(), name, type, description, lineType, count)); if (name == null || type == null || description == null || lineType == null) throw new IllegalArgumentException(String.format("Invalid VCFCompoundHeaderLine: key=%s name=%s type=%s desc=%s lineType=%s", getKey(), name, type, description, lineType)); if (name.contains("<") || name.contains(">")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain angle brackets"); if (name.contains("=")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain an equals sign"); if (type == VCFHeaderLineType.Flag && count != 0) { count = 0; if (GeneralUtils.DEBUG_MODE_ENABLED) { System.err.println("FLAG fields must have a count value of 0, but saw " + count + " for header line " + getID() + ". Changing it to 0 inside the code"); } } }
public Configuration configure(VCFCompoundHeaderLine line) { this.otherFieldsMap.put(line.getKey(), Pair.of(line.getType(), line.getCountType())); return this; }
.setKey(vcfLine.getKey()) .setId(vcfLine.getID()) .setDescription(vcfLine.getDescription())