ESeqMapSegmentEdge
66SSeqPos(
const CSeqMap_CI& iter, ESeqMapSegmentEdge edge)
67: id(iter.GetRefSeqid()),
68minus_strand(iter.GetRefMinusStrand())
71 if( !minus_strand ) {
79 if( !minus_strand ) {
90pos += minus_strand? -diff: diff;
95pos += minus_strand? diff: -diff;
102minus_strand = !minus_strand;
106 structSSeq_align_Info
128m_SegmentIds.
insert(seg_it.GetRefSeqid());
136 match.align.Reset(&align);
144m_SegmentIds.
find(
r1->m_Id) == m_SegmentIds.
end() ) {
148 match.range1.SetFrom(
r1->m_Start);
155m_SegmentIds.
find(
r2->m_Id)==m_SegmentIds.
end() ){
159 match.range2.SetFrom(
r2->m_Start);
160 match.range2.SetLength(s->m_Len);
161 match.same_strand =
r1->SameStrand(*
r2);
179 returnpos >= range.
GetFrom() && pos <= range.
GetTo();
184 if( pos.minus_strand ) {
185 returnpos.pos - range.
GetFrom() + 1;
188 returnrange.
GetTo() - pos.pos + 1;
201 booloperator!(
void)
const 206 bool operator<(
constSMatchInfo& m)
const 208 if( skip != m.skip )
210 returnm1+m2 < m.m1+m.m2;
214 typedefSMatchInfo TMatch;
221 if( pos.minus_strand ) {
230TMatch GetMatchOrdered(
constSSeqPos& pos1,
constSSeqPos& pos2)
const 233 if( same_strand != (pos1.minus_strand==pos2.minus_strand) ) {
249ret.m1 = ret.m2 = m1.
GetTo()+1;
258TMatch GetMatch(
constSSeqPos& pos1,
constSSeqPos& pos2)
const 260 if( pos1.id == id1 && pos2.id == id2 ) {
261 returnGetMatchOrdered(pos1, pos2);
263 if( pos2.id == id1 && pos1.id == id2 ) {
264TMatch ret = GetMatchOrdered(pos2, pos1);
265 swap(ret.m1, ret.m2);
271 typedefvector<SMatch> TMatches;
272 typedefpair<CSeq_id_Handle, CSeq_id_Handle> TKey;
290 returnmatch_map[GetKey(id1, id2)];
297pair<TSeqPos, TSeqPos>
298x_FindAlignMatch(SSeqPos pos1,
305pair<TSeqPos, TSeqPos>
306SSeq_align_Info::x_FindAlignMatch(SSeqPos pos1,
312pair<TSeqPos, TSeqPos> ret(0, 0);
317TMatchMap::const_iterator miter =
318match_map.find(GetKey(pos1.id, pos2.id));
319 if( miter != match_map.end() ) {
320 constTMatches& matches = miter->second;
321 ITERATE( TMatches, it, matches ) {
322SMatch::TMatch m = it->GetMatch(pos1, pos2);
331 if( !first_align ) {
332first_align = add.align;
348 if( skip1 || skip2 ) {
349diff[skip_pos].second += skip1;
350diff[skip_pos].first += skip2;
360ret.second = ret.first;
372SSeq_align_Info&
info,
383SSeqPos pos1(iter1, SSeqPos::eEnd);
384SSeqPos pos2(iter2, SSeqPos::eStart);
394pair<TSeqPos, TSeqPos> ext2 =
399pair<TSeqPos, TSeqPos> ext1 =
415 while( iter != diff.
end() &&
offset>= iter->first ) {
416 if(
offset- iter->first <= iter->second.second ) {
424ret.first += iter->second.first;
425ret.second += iter->second.second;
454 "switch point is not initialized");
458 "switch point is not in valid range");
474 returniter == diff->
end()? 0: iter->second.first;
502 "switch point is not initialized");
506 "switch point is not in valid range");
508 if( add > 0 && add >
GetInsert(pos) ) {
510 "adding more bases than available");
516 "invalid CSeqMapSwitchPoint");
521SSeqPos(right, SSeqPos::eStart).pos !=
m_RightPos) {
523 "invalid CSeqMapSwitchPoint");
529SSeqPos(left, SSeqPos::eEnd).pos !=
m_LeftPos) {
531 "invalid CSeqMapSwitchPoint");
574 "switch point is not initialized");
579 "adding more bases than available");
588SSeq_align_Info
info(seq, align);
589 if(
info.match_map.size() != 1 ) {
591 "Seq-align dimension is not 2");
599 "Sequence is not segmented");
604 for( ; iter2; ++iter1, ++iter2 ) {
609 returnx_GetSwitchPoint(seq,
info, iter1, iter2);
615 "Seq-align doesn't refer to segments");
627 "Sequence is not segmented");
632SSeq_align_Info
info(seq);
637 for( ; iter2; ++iter1, ++iter2 ) {
640pp.push_back(x_GetSwitchPoint(seq,
info, iter1, iter2));
ENa_strand Reverse(ENa_strand s)
User-defined methods of the data storage class.
Storage for multiple mapping ranges.
Base class for all object manager exceptions.
SeqMap related exceptions.
list< SAlignment_Segment > TSegments
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
bool operator<(const CEquivRange &A, const CEquivRange &B)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const TInst_Hist & GetInst_Hist(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeqMap & GetSeqMap(void) const
Get sequence map.
TSeqPos GetEndPosition(void) const
return end position of current segment in sequence (exclusive)
TSeqPos GetRefPosition(void) const
bool GetRefMinusStrand(void) const
CSeqMap::ESegmentType GetType(void) const
CSeq_id_Handle GetRefSeqid(void) const
The following function makes sense only when the segment is a reference to another seq.
TSeqPos GetRefEndPosition(void) const
TSeqPos GetPosition(void) const
return position of current segment in sequence
TSeqPos GetLength(void) const
return length of current segment
void SetSegmentRef(const CSeqMap_CI &seg, TSeqPos length, const CSeq_id_Handle &ref_id, TSeqPos ref_pos, bool ref_minus_strand)
vector< CRef< CSeqMapSwitchPoint > > TSeqMapSwitchPoints
CRange< TSeqPos > m_MasterRange
pair< TSeqPos, TSeqPos > TInsertDelete
const_iterator begin(CScope *scope) const
STL style methods.
TSeqPos GetInsert(TSeqPos pos) const
CConstRef< CSeq_align > m_FirstAlign
TInsertDelete GetDifferences(TSeqPos new_pos, TSeqPos add=0) const
TSeqMapSwitchPoints GetAllSwitchPoints(const CBioseq_Handle &seq, const TSeqMapSwitchAligns &aligns)
TDifferences m_RightDifferences
TSeqPos GetLeftInPlaceInsert(void) const
TSeqPos GetRightInPlaceInsert(void) const
void InsertInPlace(TSeqPos add_left, TSeqPos add_right)
CSeqMap_CI FindSegment(TSeqPos pos, CScope *scope) const
Find segment containing the position.
list< CRef< CSeq_align > > TSeqMapSwitchAligns
TDifferences m_LeftDifferences
CRef< CSeqMapSwitchPoint > GetSwitchPoint(const CBioseq_Handle &seq, const CSeq_align &align)
CRange< TSeqPos > m_ExactMasterRange
void ChangeSwitchPoint(TSeqPos pos, TSeqPos add)
int GetLengthDifference(TSeqPos new_pos, TSeqPos add=0) const
@ eSeqRef
reference to Bioseq
position_type GetLength(void) const
TThisType & SetLength(position_type length)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TAssembly & GetAssembly(void) const
Get the Assembly member data.
CNcbiMatrix< T > & operator+=(CNcbiMatrix< T > &, const CNcbiMatrix< U > &)
global addition: matrix += matrix
CNcbiMatrix< T > & operator-=(CNcbiMatrix< T > &, const CNcbiMatrix< U > &)
global subtraction: matrix -= matrix
const struct ncbi::grid::netcache::search::fields::KEY key
static bool Contains(const CSeq_loc &a, const CSeq_loc &b, CScope *scope)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
static const sljit_gpr r1
static const sljit_gpr r2
vector< SAlignment_Row > TRows
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4