use of org.broadinstitute.gatk.utils.exceptions.UserException in project jvarkit by lindenb.
the class WindowVariants method initialize.
@Override
public void initialize() {
if (this.window_size <= 0) {
throw new UserException("Bad window size.");
}
if (this.window_shift <= 0) {
throw new UserException("Bad window shift.");
}
if (this.winName == null || this.winName.isEmpty()) {
throw new UserException("Bad INFO ID windowName");
}
final Map<String, String> exprMap = new HashMap<>();
for (final String expStr : this.selectExpressions) {
exprMap.put("expr" + (1 + exprMap.size()), expStr);
}
this.jexls = VariantContextUtils.initializeMatchExps(exprMap);
final VCFHeader header = new VCFHeader(super.getVcfHeader());
if (header.getInfoHeaderLine(this.winName) != null) {
throw new UserException("VCF header already contains the INFO header ID=" + this.winName);
}
header.addMetaDataLine(new VCFInfoHeaderLine(this.winName, VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.String, "Window : start|end|number-of-matching-variants|number-of-non-matching-variants"));
super.writer.writeHeader(header);
super.initialize();
}
Aggregations