本文整理汇总了C++中SamRecord::rmTags方法的典型用法代码示例。如果您正苦于以下问题:C++ SamRecord::rmTags方法的具体用法?C++ SamRecord::rmTags怎么用?C++ SamRecord::rmTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SamRecord
的用法示例。
在下文中一共展示了SamRecord::rmTags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
int Revert::execute(int argc, char **argv)
{
// Extract command line arguments.
String inFile = "";
String outFile = "";
bool cigar = false;
bool qual = false;
bool noeof = false;
bool params = false;
bool rmBQ = false;
String rmTags = "";
myKeepTags = false;
ParameterList inputParameters;
BEGIN_LONG_PARAMETERS(longParameterList)
LONG_STRINGPARAMETER("in", &inFile)
LONG_STRINGPARAMETER("out", &outFile)
LONG_PARAMETER("cigar", &cigar)
LONG_PARAMETER("qual", &qual)
LONG_PARAMETER("keepTags", &myKeepTags)
LONG_PARAMETER("rmBQ", &rmBQ)
LONG_STRINGPARAMETER("rmTags", &rmTags)
LONG_PARAMETER("noeof", &noeof)
LONG_PARAMETER("params", ¶ms)
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 == "")
{
usage();
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 == "")
{
usage();
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);
}
if(params)
{
inputParameters.Status();
}
// Open the input file for reading.
SamFile samIn;
samIn.OpenForRead(inFile);
// Open the output file for writing.
SamFile samOut;
samOut.OpenForWrite(outFile);
// Read the sam header.
SamFileHeader samHeader;
samIn.ReadHeader(samHeader);
// Write the sam header.
samOut.WriteHeader(samHeader);
SamRecord samRecord;
// Set returnStatus to success. It will be changed to the
// failure reason if any of the writes or updates fail.
SamStatus::Status returnStatus = SamStatus::SUCCESS;
// Keep reading records until ReadRecord returns false.
while(samIn.ReadRecord(samHeader, samRecord))
{
// Update the cigar & position.
if(cigar)
{
if(!updateCigar(samRecord))
{
// Failed to update the cigar & position.
fprintf(stderr, "%s\n", samIn.GetStatusMessage());
returnStatus = samIn.GetStatus();
}
//.........这里部分代码省略.........