void VcfAnnotateHomopolymersCommand::exec() { auto bedStream = _streams.openForReading(homopolymerBedFile_); auto vcfStream = _streams.openForReading(vcfFile_); // parse 1 additional field (past chr, start stop) in bed files. auto bedReader = TypedStreamFactory<BedParser>{1}(bedStream); auto vcfReader = openStream<Vcf::Entry>(vcfStream); std::ostream* outStream = _streams.get<std::ostream>(outputFile_); std::stringstream description; description << "short (maximum of " << maxLength_ << "bp) homopolymer indel"; Vcf::CustomType infoType(infoFieldName_, Vcf::CustomType::PER_ALLELE, 0, Vcf::CustomType::INTEGER, description.str()); Vcf::Header newHeader = vcfReader->header(); newHeader.addInfoType(infoType); *outStream << newHeader; DefaultPrinter out(*outStream); auto annotator = makeHomopolymerAnnotator(out, maxLength_, newHeader.infoType(infoFieldName_)); bool adjacentInsertions = true; auto intersector = makeFullIntersector(*bedReader, *vcfReader, annotator, adjacentInsertions); intersector.execute(); }
docstring InsetInfo::toolTip(BufferView const &, int, int) const { return bformat(_("Information regarding %1$s '%2$s'"), _(infoType()), from_utf8(name_)); }
void InsetInfo::write(ostream & os) const { os << "Info\ntype \"" << infoType() << "\"\narg " << Lexer::quoteString(name_); }
docstring InsetInfo::name() const { return from_ascii("Info:" + infoType()); }