本文整理汇总了C++中libmaus2::util::ArgInfo::getValueUnsignedNumeric方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgInfo::getValueUnsignedNumeric方法的具体用法?C++ ArgInfo::getValueUnsignedNumeric怎么用?C++ ArgInfo::getValueUnsignedNumeric使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libmaus2::util::ArgInfo
的用法示例。
在下文中一共展示了ArgInfo::getValueUnsignedNumeric方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bamexplode
int bamexplode(libmaus2::util::ArgInfo const & arginfo)
{
libmaus2::bambam::BamAlignmentDecoderWrapper::unique_ptr_type Preader(libmaus2::bambam::BamMultiAlignmentDecoderFactory::construct(arginfo));
libmaus2::bambam::BamBlockWriterBase::unique_ptr_type Pwriter;
libmaus2::bambam::BamAlignmentDecoder & decoder = Preader->getDecoder();
libmaus2::bambam::BamHeader const & header = decoder.getHeader();
libmaus2::bambam::BamAlignment const & algn = decoder.getAlignment();
uint64_t nextfn = 0;
uint64_t written = std::numeric_limits<uint64_t>::max();
int32_t prevrefid = std::numeric_limits<int32_t>::max();
std::string const outputformat = arginfo.getUnparsedValue("outputformat",libmaus2::bambam::BamBlockWriterBaseFactory::getDefaultOutputFormat());
std::string const prefix = arginfo.getUnparsedValue("prefix",getDefaultPrefix());
uint64_t const thres = arginfo.getValueUnsignedNumeric("sizethres",getDefaultSizeThres());
while ( decoder.readAlignment() )
{
int32_t const refid = algn.getRefID();
if ( refid != prevrefid && written > thres )
{
Pwriter.reset();
libmaus2::util::ArgInfo argcopy(arginfo);
std::ostringstream fnostr;
fnostr << prefix << std::setw(6) << std::setfill('0') << nextfn++ << std::setw(0) << "." << outputformat;
argcopy.replaceKey("O",fnostr.str());
libmaus2::bambam::BamBlockWriterBase::unique_ptr_type Twriter(libmaus2::bambam::BamBlockWriterBaseFactory::construct(header,argcopy));
Pwriter = UNIQUE_PTR_MOVE(Twriter);
written = 0;
}
Pwriter->writeAlignment(algn);
prevrefid = refid;
written ++;
}
Pwriter.reset();
return EXIT_SUCCESS;
}