本文整理汇总了C++中Alignment::IsReverseStrand方法的典型用法代码示例。如果您正苦于以下问题:C++ Alignment::IsReverseStrand方法的具体用法?C++ Alignment::IsReverseStrand怎么用?C++ Alignment::IsReverseStrand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alignment
的用法示例。
在下文中一共展示了Alignment::IsReverseStrand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makePair
void makePair(Alignment& a, Alignment& b, Alignment& x, Alignment& y)
{
initMate(a, x);
initMate(b, y);
Feature spacer;
getSpacer(a, b, spacer);
int insert = a.Length + spacer.getLength() + b.Length;
// Add in mate pair info
x.MateRefID = b.RefID;
x.matePosition(b.position());
x.InsertSize = insert;
y.MateRefID = a.RefID;
y.matePosition(a.position());
y.InsertSize = -1 * insert;
// Update Mapping information appropriately
x.SetIsReverseStrand(a.IsReverseStrand());
x.SetIsMateReverseStrand(b.IsReverseStrand());
y.SetIsReverseStrand(b.IsReverseStrand());
y.SetIsMateReverseStrand(a.IsReverseStrand());
}
示例2: isValidPair
bool isValidPair(Alignment& a, Alignment& b)
{
Feature spacer;
getSpacer(a, b, spacer);
int gap = spacer.getLength();
// Calculate the correct size of the insert
// REMEMBER: negative gaps mean our values overlap
// pair must be oriented correctly
// (5'--------->3' 3'<---------5')
return gap >= MIN_GAP && gap <= MAX_GAP
&& !a.IsReverseStrand() && b.IsReverseStrand();
}
示例3: main
int main (int argc, char * argv[])
{
vector<string> inputFilenames;
string combinedOutFilename, alignmentsOutFilename;
try
{
TCLAP::CmdLine cmd("Program description", ' ', VERSION);
TCLAP::ValueArg<string> combinedOutputArg("o", "out",
"Combined output filename (BAM format)", true, "", "combined.bam", cmd);
TCLAP::ValueArg<int> minInsertArg("n", "min-insert",
"Minimum insert size", false, DEFAULT_MIN_GAP, "min insert size", cmd);
TCLAP::ValueArg<int> maxInsertArg("x", "max-insert",
"Maximum insert size", false, DEFAULT_MAX_GAP, "max insert size", cmd);
TCLAP::MultiArg<string> inputArgs("b", "bam",
"Input BAM file", true,
"input.bam", cmd);
cmd.parse(argc, argv);
combinedOutFilename = combinedOutputArg.getValue();
MIN_GAP = minInsertArg.getValue();
MAX_GAP = maxInsertArg.getValue();
inputFilenames = inputArgs.getValue();
} catch (TCLAP::ArgException &e) {
cerr << "Error: " << e.error() << " " << e.argId() << endl;
}
// TODO require that alignments are sorted by name
BamMultiReader reader;
reader.Open(inputFilenames);
if (!ValidOut.Open(combinedOutFilename, reader.GetHeader(),
reader.GetReferenceData()))
{
cerr << ValidOut.GetErrorString() << endl;
return 1;
}
string current, prev;
char mateID;
Group group;
set<string> references;
Alignment a;
while (reader.GetNextAlignment(a))
{
parseID(a.Name, current, mateID);
if (current.compare(prev) && prev.size() > 0)
{
processGroup(group, references);
group.clear();
references.clear();
}
references.insert(a.RefName);
GroupKey key;
key.refID = a.RefName;
key.mateID = mateID;
key.rev = a.IsReverseStrand();
group.insert( std::make_pair( key, a ) );
prev = current;
}
processGroup(group, references);
}