本文整理汇总了C++中SamFile::setAttemptRecovery方法的典型用法代码示例。如果您正苦于以下问题:C++ SamFile::setAttemptRecovery方法的具体用法?C++ SamFile::setAttemptRecovery怎么用?C++ SamFile::setAttemptRecovery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SamFile
的用法示例。
在下文中一共展示了SamFile::setAttemptRecovery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
int Convert::execute(int argc, char **argv)
{
// Extract command line arguments.
String inFile = "";
String outFile = "";
String refFile = "";
bool lshift = false;
bool noeof = false;
bool params = false;
bool useBases = false;
bool useEquals = false;
bool useOrigSeq = false;
bool recover = false;
ParameterList inputParameters;
BEGIN_LONG_PARAMETERS(longParameterList)
LONG_STRINGPARAMETER("in", &inFile)
LONG_STRINGPARAMETER("out", &outFile)
LONG_STRINGPARAMETER("refFile", &refFile)
LONG_PARAMETER("lshift", &lshift)
LONG_PARAMETER("noeof", &noeof)
LONG_PARAMETER("recover", &recover)
LONG_PARAMETER("params", ¶ms)
LONG_PARAMETER_GROUP("SequenceConversion")
EXCLUSIVE_PARAMETER("useBases", &useBases)
EXCLUSIVE_PARAMETER("useEquals", &useEquals)
EXCLUSIVE_PARAMETER("useOrigSeq", &useOrigSeq)
LONG_PHONEHOME(VERSION)
END_LONG_PARAMETERS();
inputParameters.Add(new LongParameters ("Input Parameters",
longParameterList));
// parameters start at index 2 rather than 1.
inputParameters.Read(argc, argv, 2);
// If no eof block is required for a bgzf file, set the bgzf file type to
// not look for it.
if(noeof)
{
// Set that the eof block is not required.
BgzfFileType::setRequireEofBlock(false);
}
// Check to see if the in file was specified, if not, report an error.
if(inFile == "")
{
printUsage(std::cerr);
inputParameters.Status();
// In file was not specified but it is mandatory.
std::cerr << "--in is a mandatory argument, "
<< "but was not specified" << std::endl;
return(-1);
}
if(outFile == "")
{
printUsage(std::cerr);
inputParameters.Status();
// In file was not specified but it is mandatory.
std::cerr << "--out is a mandatory argument, "
<< "but was not specified" << std::endl;
return(-1);
}
// Check to see if the ref file was specified.
// Open the reference.
GenomeSequence* refPtr = NULL;
if(refFile != "")
{
refPtr = new GenomeSequence(refFile);
}
SamRecord::SequenceTranslation translation;
if((useBases) && (refPtr != NULL))
{
translation = SamRecord::BASES;
}
else if((useEquals) && (refPtr != NULL))
{
translation = SamRecord::EQUAL;
}
else
{
useOrigSeq = true;
translation = SamRecord::NONE;
}
if(params)
{
inputParameters.Status();
}
// Open the input file for reading.
SamFile samIn;
if(recover) samIn.setAttemptRecovery(true);
samIn.OpenForRead(inFile);
//.........这里部分代码省略.........