本文整理汇总了C++中CConstRef::GetLength方法的典型用法代码示例。如果您正苦于以下问题:C++ CConstRef::GetLength方法的具体用法?C++ CConstRef::GetLength怎么用?C++ CConstRef::GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConstRef
的用法示例。
在下文中一共展示了CConstRef::GetLength方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: x_Select
void CSeqMap_CI::x_Select(const CConstRef<CSeqMap>& seqMap,
const SSeqMapSelector& selector,
TSeqPos pos)
{
m_Selector = selector;
if ( m_Selector.m_Length == kInvalidSeqPos ) {
TSeqPos len = seqMap->GetLength(GetScope());
len -= min(len, m_Selector.m_Position);
m_Selector.m_Length = len;
}
if ( pos < m_Selector.m_Position ) {
pos = m_Selector.m_Position;
}
else if ( pos > m_Selector.m_Position + m_Selector.m_Length ) {
pos = m_Selector.m_Position + m_Selector.m_Length;
}
x_Push(seqMap, m_Selector.m_TopTSE,
m_Selector.m_Position,
m_Selector.m_Length,
m_Selector.m_MinusStrand,
pos - m_Selector.m_Position);
while ( !x_Found() && GetPosition() < m_SearchEnd ) {
if ( !x_Push(pos - m_Selector.m_Position) ) {
x_SettleNext();
break;
}
}
}
示例2: make_pair
pair<double, bool> CScoreUniqSeqCoverage::MakeScore(CBioseq_Handle const& query_handle, vector<CSeq_align const*>::const_iterator begin, vector<CSeq_align const*>::const_iterator end)
{
CConstRef<CBioseq> bioseq = query_handle.GetCompleteBioseq();
unsigned int qlen = 0;
if ( !bioseq.Empty() && bioseq->IsSetLength()) {
qlen = bioseq->GetLength();
}
if ( !qlen ) {
return make_pair(0, false);
}
bool isDenDiag = ( (*begin)->GetSegs().Which() == CSeq_align::C_Segs::e_Dendiag) ?
true : false;
CRangeCollection<TSeqPos> subj_rng_coll((*begin)->GetSeqRange(1));
CRange<TSeqPos> q_rng((*begin)->GetSeqRange(0));
CRangeCollection<TSeqPos> query_rng_coll(s_FixMinusStrandRange(q_rng));
for( ++begin; begin != end; ++begin ) {
const CRange<TSeqPos> align_subj_rng((*begin)->GetSeqRange(1));
// subject range should always be on the positive strand
assert(align_subj_rng.GetTo() > align_subj_rng.GetFrom());
CRangeCollection<TSeqPos> coll(align_subj_rng);
coll.Subtract(subj_rng_coll);
if ( coll.empty() ) {
continue;
}
if(coll[0] == align_subj_rng) {
CRange<TSeqPos> query_rng ((*begin)->GetSeqRange(0));
query_rng_coll += s_FixMinusStrandRange(query_rng);
subj_rng_coll += align_subj_rng;
}
else {
ITERATE (CRangeCollection<TSeqPos>, uItr, coll) {
CRange<TSeqPos> query_rng;
const CRange<TSeqPos> & subj_rng = (*uItr);
CRef<CSeq_align> densegAln;
if ( isDenDiag) {
densegAln = CreateDensegFromDendiag(**begin);
}
CAlnMap map( (isDenDiag) ? densegAln->GetSegs().GetDenseg() : (*begin)->GetSegs().GetDenseg());
TSignedSeqPos subj_aln_start = map.GetAlnPosFromSeqPos(1,subj_rng.GetFrom());
TSignedSeqPos subj_aln_end = map.GetAlnPosFromSeqPos(1,subj_rng.GetTo());
query_rng.SetFrom(map.GetSeqPosFromAlnPos(0,subj_aln_start));
query_rng.SetTo(map.GetSeqPosFromAlnPos(0,subj_aln_end));
query_rng_coll += s_FixMinusStrandRange(query_rng);
subj_rng_coll += subj_rng;
}
}
}
示例3:
bool CLocation_constraint :: x_DoesLocationMatchDistanceConstraint(CConstRef <CBioseq> bioseq, const CSeq_loc& loc) const
{
if (!CanGetEnd5() && !CanGetEnd3()) {
return true;
}
unsigned pos = loc.GetStop(eExtreme_Positional);
int pos2;
if (bioseq.NotEmpty()) {
pos2 = (bioseq->IsSetLength() ? bioseq->GetLength() : 0) - pos - 1;
}
if (loc.GetStrand() == eNa_strand_minus) {
if (CanGetEnd5()) {
if (bioseq.Empty()) {
return false;
}
else {
if (!GetEnd5().Match(pos2)) {
return false;
}
}
}
if (CanGetEnd3()) {
return GetEnd3().Match(pos);
}
}
else
{
if (CanGetEnd5() && !GetEnd5().Match(pos)) {
return false;
}
if (CanGetEnd3()) {
if (bioseq.Empty()) {
return false;
}
return GetEnd3().Match(pos2);
}
}
return true;
};