Search in sources :

Example 1 with EigenInfoAnnotator

use of com.github.lindenb.jvarkit.tools.vcfeigen.EigenInfoAnnotator in project jvarkit by lindenb.

the class EigenVariants method initialize.

@Override
public void initialize() {
    logger.info("opening eigen directory :" + eigenDir);
    IOUtil.assertDirectoryIsReadable(eigenDir);
    this.annotator = new EigenInfoAnnotator(this.eigenDir);
    if (this.tabixPrefix != null) {
        logger.info("changing eigen file prefix from  :" + this.annotator.getTabixPrefix() + " to " + this.tabixPrefix);
        this.annotator.setTabixFilePrefix(this.tabixPrefix);
    }
    final VCFHeader header1 = super.getVcfHeader();
    final VCFHeader h2 = new VCFHeader(header1);
    for (final VCFInfoHeaderLine vihl : this.annotator.getInfoHeaderLines()) {
        if (h2.getInfoHeaderLine(vihl.getID()) != null) {
            throw new UserException.MalformedVCFHeader("VCF INFO " + vihl.getID() + " already defined in input VCF.");
        }
        h2.addMetaDataLine(vihl);
    }
    super.writer.writeHeader(h2);
    super.initialize();
}
Also used : EigenInfoAnnotator(com.github.lindenb.jvarkit.tools.vcfeigen.EigenInfoAnnotator) VCFHeader(htsjdk.variant.vcf.VCFHeader) VCFInfoHeaderLine(htsjdk.variant.vcf.VCFInfoHeaderLine)

Aggregations

EigenInfoAnnotator (com.github.lindenb.jvarkit.tools.vcfeigen.EigenInfoAnnotator)1 VCFHeader (htsjdk.variant.vcf.VCFHeader)1 VCFInfoHeaderLine (htsjdk.variant.vcf.VCFInfoHeaderLine)1