本文整理汇总了C++中bam_record::is_paired方法的典型用法代码示例。如果您正苦于以下问题:C++ bam_record::is_paired方法的具体用法?C++ bam_record::is_paired怎么用?C++ bam_record::is_paired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bam_record
的用法示例。
在下文中一共展示了bam_record::is_paired方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fragSource
static
void
getSingleReadSVCandidates(
const ReadScannerOptions& opt,
const ReadScannerDerivOptions& dopt,
const bam_record& localRead,
const SimpleAlignment& localAlign,
const chromMap_t& chromToIndex,
const reference_contig_segment& refSeq,
std::vector<SVObservation>& candidates)
{
using namespace illumina::common;
const bool isRead2(localRead.is_paired() && (localRead.read_no() == 2));
const FRAGSOURCE::index_t fragSource(isRead2 ? FRAGSOURCE::READ2 : FRAGSOURCE::READ1);
// - process any large indels in the localRead:
getSVCandidatesFromReadIndels(opt, dopt, localAlign, fragSource, candidates);
#ifdef DEBUG_SCANNER
log_os << __FUNCTION__ << ": post-indels candidate_size: " << candidates.size() << "\n";
#endif
// a read can provide SA split evidence or semi-aligned/soft-clip, but not both.
// this prevents split reads from triggering spurious local assembles. It is
// possible for a read to genuinely contain evidence of both, but this should
// be very rare.
if (localRead.isSASplit())
{
getSACandidatesFromRead(opt, dopt, localRead, localAlign, fragSource, chromToIndex,
candidates);
#ifdef DEBUG_SCANNER
log_os << __FUNCTION__ << ": post-split read candidate_size: " << candidates.size() << "\n";
#endif
}
else
{
if (dopt.isSmallCandidates)
{
getSVCandidatesFromSemiAligned(opt, dopt, localRead, localAlign, fragSource, refSeq,
candidates);
}
#ifdef DEBUG_SCANNER
log_os << __FUNCTION__ << ": post-semialigned candidate_size: " << candidates.size() << "\n";
#endif
}
}
示例2: minSize
bool
isMateInsertionEvidenceCandidate(
const bam_record& bamRead,
const unsigned minMapq)
{
if (! bamRead.is_paired()) return false;
if (bamRead.isNonStrictSupplement()) return false;
if (bamRead.is_unmapped() || bamRead.is_mate_unmapped()) return false;
if (bamRead.map_qual() < minMapq) return false;
if (bamRead.target_id() < 0) return false;
if (bamRead.mate_target_id() < 0) return false;
if (bamRead.target_id() != bamRead.mate_target_id()) return true;
/// TODO: better candidate definition based on fragment size distro:
static const int minSize(10000);
return (std::abs(bamRead.pos()-bamRead.mate_pos()) >= minSize);
}
示例3: logtag
static
bool
isGoodShadow(
const bam_record& bamRead,
const std::string& lastQname)
{
#ifdef DEBUG_IS_SHADOW
static const std::string logtag("isGoodShadow");
#endif
if (! bamRead.is_paired()) return false;
if (bamRead.isNonStrictSupplement()) return false;
// sanity check that this is a shadow read:
if (!bamRead.is_unmapped()) return false;
if (bamRead.is_mate_unmapped()) return false;
static const unsigned minAvgQualShadow = 25;
if (get_avg_quality(bamRead) < minAvgQualShadow)
{
return false;
}
if (strcmp(bamRead.qname(),lastQname.c_str()) != 0)
{
// something went wrong here, shadows should have their singleton partner
// preceding them in the BAM file.
#ifdef DEBUG_IS_SHADOW
log_os << logtag << " ERROR: Shadow without matching singleton : " << bamRead.qname() << " vs " << lastQname << std::endl;
#endif
return false;
}
#ifdef DEBUG_IS_SHADOW
log_os << logtag << " Found shadow!\n";
<< logtag << " this mapq = " << ((unsigned int)bamRead.map_qual()) << std::endl;
示例4: isRemote
/// get SV candidates from anomalous read pairs
static
void
getSVCandidatesFromPair(
const ReadScannerOptions& opt,
const ReadScannerDerivOptions& dopt,
const SVLocusScanner::CachedReadGroupStats& rstats,
const bam_record& localRead,
const SimpleAlignment& localAlign,
const bam_record* remoteReadPtr,
std::vector<SVObservation>& candidates)
{
if (! localRead.is_paired()) return;
// don't count paired end evidence from SA-split reads twice:
if (localRead.isNonStrictSupplement()) return;
if (localRead.is_unmapped() || localRead.is_mate_unmapped()) return;
// special case typically used for RNA-Seq analysis:
if (opt.isIgnoreAnomProperPair && localRead.is_proper_pair()) return;
// abstract remote alignment to SimpleAlignment object:
const bool isRemote(nullptr != remoteReadPtr);
const SimpleAlignment remoteAlign(isRemote ? getAlignment(*remoteReadPtr) : getFakeMateAlignment(localRead));
AlignmentPairAnalyzer pairInspector(opt, dopt, rstats);
pairInspector.reset(localAlign, remoteAlign, isRemote, localRead.is_first());
if (! pairInspector.computeLargeEventRegionScale()) return;
candidates.emplace_back();
pairInspector.getSVObservation(candidates.back());
#ifdef DEBUG_SCANNER
log_os << __FUNCTION__ << " evaluating pair sv for inclusion: " << candidates.back() << "\n";
#endif
}