start = 0,
len= 0;
87 "CAlnVec::SetAnchor(): " 98 intstart = 0,
len= 0, aln_seg = -1,
offset= 0;
118 "CAlnVec::SetAnchor(): " 119 "Invalid Dense-seg: No sequence on the anchor row");
128 TNumsegl_seg, r_seg, l_index, r_index, index;
129 TNumsegl_anchor_index, r_anchor_index, anchor_index;
130 TSeqPoscont_next_start = 0, cont_prev_stop = 0;
131 TSeqPosanchor_cont_next_start = 0, anchor_cont_prev_stop = 0;
146cont_prev_stop = start;
152anchor_start =
m_Starts[anchor_index];
153 if(anchor_start >= 0) {
156anchor_cont_prev_stop = anchor_start;
168 if((start =
m_Starts[r_index]) >= 0) {
172start +
x_GetLen(
row, r_seg) != cont_prev_stop)) {
184 if((anchor_start =
m_Starts[r_anchor_index]) >= 0) {
200 while(--l_seg >= 0) {
203 if((start =
m_Starts[l_index]) >= 0) {
206start +
x_GetLen(
row, l_seg) != cont_prev_stop :
217 while(--l_seg >= 0) {
219 if((anchor_start =
m_Starts[l_anchor_index]) >= 0) {
271 intleft_seq_pos = -1;
272 for(idx = l_idx, seg = 0;
284 if(left_seq_pos < 0) {
296 if(left_seq_pos > 0) {
298start > left_seq_pos :
316 intright_seq_pos = -1;
331 if(right_seq_pos < 0) {
343 if(right_seq_pos > 0) {
346start > right_seq_pos) {
385mid = (top + btm) / 2;
404 TNumsegbtm, top, mid, cur,
last, cur_top, cur_btm;
405btm = cur_btm = 0; cur = top =
last= cur_top =
m_NumSegs- 1;
460cur = mid = (top + btm) / 2;
467 if(cur <= top && start >= 0) {
468 if(sseq_pos >= start &&
472 if(sseq_pos > start) {
488 if(cur >= btm && start >= 0) {
489 if(sseq_pos >= start
493 if(sseq_pos > start) {
508 return(
plus? cur_btm :
last- cur_btm);
510 return(
plus? cur_top :
last- cur_top);
518 return(
plus? cur_btm :
last- cur_btm);
520 return(
plus? cur_top :
last- cur_top);
529 booltry_reverse_dir)
const 552 if((
plus? seq_pos < start : seq_pos > stop)) {
555 if((
plus? seq_pos > stop : seq_pos < start)) {
568}
else if(try_reverse_dir) {
582}
else if(try_reverse_dir) {
601 booltry_reverse_dir)
const 609 boolreverse_pass =
false;
614 while(--seg >=0 && pos == -1) {
624 while(--seg >=0 && pos == -1) {
633 if(!try_reverse_dir) {
638}
else if(reverse_pass) {
639 string msg=
"Invalid Dense-seg: Row "+
641 " contains gaps only.";
645reverse_pass =
true;
651dir =
eLeft;
break;
666 booltry_reverse_dir)
const 680}
else if(dir !=
eNone) {
691 booltry_reverse_dir)
const 729 stringerr_msg =
"CAlnVec::x_GetSeqLeftSeg(): " 731 " contains gaps only.";
750 stringerr_msg =
"CAlnVec::x_GetSeqRightSeg(): " 752 " contains gaps only.";
760vector<TSignedSeqPos>&
result,
770 TSeqPosaln_pos = 0, next_aln_pos, l_len = 0, r_len = 0, l_delta, r_delta;
773 TSeqPosl_pos0, r_pos0, l_pos1, r_pos1;
778next_aln_pos = aln_pos + l_len;
780aln_start >= aln_pos && aln_start < next_aln_pos) {
784aln_pos = next_aln_pos;
793 _ASSERT(aln_start >= aln_pos);
794l_delta = aln_start - aln_pos;
811 if(aln_stop > aln_pos) {
816next_aln_pos = aln_pos - r_len;
818aln_stop > next_aln_pos && aln_stop <= aln_pos) {
822aln_pos = next_aln_pos;
831r_delta = aln_pos - aln_stop;
845 TSeqPos size= (plus0 ? r_pos0 - l_pos0 : l_pos0 - r_pos0) + 1;
849 TSeqPospos0 = plus0 ? 0 : l_pos0 - r_pos0;
850 TSeqPospos1 = plus1 ? 0 : l_pos1 - r_pos1;
854 TSeqPosnext_l_pos0 = plus0 ? l_pos0 + l_len : l_pos0 - l_len;
855 TSeqPosnext_l_pos1 = plus1 ? l_pos1 + l_len : l_pos1 - l_len;
868next_l_pos0 =
m_Starts[l_idx0] + l_len;
871next_l_pos0 =
m_Starts[l_idx0] - 1;
880}
else if(
delta< 0) {
882 stringerrstr =
string(
"CAlnMap::GetResidueIndexMap():")
883+
" Starts are not consistent!" 896next_l_pos1 =
m_Starts[l_idx1] + l_len;
899next_l_pos1 =
m_Starts[l_idx1] - 1;
908}
else if(
delta< 0) {
910 stringerrstr =
string(
"CAlnMap::GetResidueIndexMap():")
911+
" Starts are not consistent!" 954}
else if(seg == r_seg) {
962rng0.
SetFrom(plus0 ? l_pos0 : r_pos0);
963rng0.
SetTo(plus0 ? r_pos0 : l_pos0);
964rng1.
SetFrom(plus1 ? l_pos1 : r_pos1);
965rng1.
SetTo(plus1 ? r_pos1 : l_pos1);
1008 if(range.
GetTo() < 0
1014 TNumsegleft_seg, right_seg, aln_seg;
1117 if(
flags& fChunkSameAsSeg) {
1121 if((left_type & fSeq) != (right_type & fSeq)) {
1124 if(!(
flags& fIgnoreUnaligned) &&
1125(left_type & fUnalignedOnRight || right_type & fUnalignedOnLeft ||
1126left_type & fUnalignedOnRightOnAnchor || right_type & fUnalignedOnLeftOnAnchor)) {
1129 if((left_type & fNotAlignedToSeqOnAnchor) ==
1130(right_type & fNotAlignedToSeqOnAnchor)) {
1133 if(left_type & fSeq) {
1134 if(!(
flags& fInsertSameAsSeq)) {
1138 if(!(
flags& fDeletionSameAsGap)) {
1152 _ASSERT(left_seg <= right_seg);
1153 if(left_seg > right_seg) {
1156 "Invalid segments range");
1162 for(
TNumsegseg = left_seg; seg <= right_seg; seg++, hint_idx +=
m_NumRows) {
1167 if(seg == left_seg) {
1169}
else if(seg == right_seg) {
1179 inttest_hint_idx =
int(hint_idx);
1180 while(test_seg < right_seg) {
1186hint_idx = test_hint_idx;
1217 if(start_seg > stop_seg) {
1239 if(
type&
fSeq&& l_from == -1) {
1250 if(l_from != - 1) {
1262 if(
type&
fSeq&& r_from == -1) {
1265 if(aln_from != -1) {
1273 if(r_from != - 1) {
1280chunk->SetRange().Set(l_to + 1, r_from - 1);
1282chunk->SetRange().Set(r_to + 1, l_from - 1);
1284chunk->SetAlnRange().Set(aln_from, aln_to);
1299chunk->SetRange().Set(from, to);
1314chunk->SetRange().Set(chunk->GetRange().GetFrom(),
1315chunk->GetRange().GetTo()
1318chunk->SetRange().Set(chunk->GetRange().GetFrom()
1320chunk->GetRange().GetTo());
1324chunk->SetType(chunk->GetType() |
type);
1360chunk->SetAlnRange().Set(from, to);
1366 if(!chunk->IsGap()) {
1368chunk->SetRange().Set
1369(chunk->GetRange().GetFrom()
1371chunk->GetRange().GetTo());
1373chunk->SetRange().Set(chunk->GetRange().GetFrom(),
1374chunk->GetRange().GetTo()
1383 if(!chunk->IsGap()) {
1385chunk->SetRange().Set
1386(chunk->GetRange().GetFrom(),
1387chunk->GetRange().GetTo()
1390chunk->SetRange().Set
1391(chunk->GetRange().GetFrom()
1393chunk->GetRange().GetTo());
1405 constvector<TNumrow>& selected_rows,
1414 boolhave_strands = !
m_Strands.empty();
1415 boolhave_widths = !
m_Widths.empty();
1418 size_tdim = selected_rows.size();
1421ds.
SetIds().resize(dim);
1422 if( have_widths ) {
1425 for(
size_t i= 0;
i< dim;
i++) {
1429 if( have_widths ) {
1446 for(
TNumsegseg = from_seg; seg <= to_seg; seg++) {
1452 if(seg == from_seg &&
TSeqPos(aln_from) > aln_seg_from) {
1457from_trim = aln_from - aln_seg_from;
1462 if(seg == to_seg) {
1464 if(aln_seg_to >
TSeqPos(aln_to)) {
1469 len-= aln_seg_to - aln_to;
1477 if(row_start >= 0) {
1478row_start += from_trim;
1480starts.push_back(row_start);
1481 if( have_strands ) {
CConstRef< CAlnChunk > operator[](TNumchunk i) const
vector< TNumseg > m_StartSegs
vector< TNumseg > m_StopSegs
TNumchunk size(void) const
TNumseg GetAlnSeg(void) const
int GetOffset(void) const
void x_GetChunks(CAlnChunkVec *vec, TNumrow row, TNumseg left_seg, TNumseg right_seg, TGetChunkFlags flags) const
TRawSegTypes * m_RawSegTypes
void GetResidueIndexMap(TNumrow row0, TNumrow row1, TRange aln_rng, vector< TSignedSeqPos > &result, TRange &rng0, TRange &rng1) const
bool IsSetAnchor(void) const
CRef< CSeq_align > CreateAlignFromRange(const vector< TNumrow > &selected_rows, TSignedSeqPos aln_from, TSignedSeqPos aln_to, ESegmentTrimFlag seg_flag=eSegment_Trim)
int GetWidth(TNumrow row) const
TSignedSeqPos x_FindClosestSeqPos(TNumrow row, TNumseg seg, ESearchDirection dir, bool try_reverse_dir) const
CRef< CAlnChunkVec > GetSeqChunks(TNumrow row, const TSignedRange &range, TGetChunkFlags flags=fAlnSegsOnly) const
const TNumseg & x_GetSeqLeftSeg(TNumrow row) const
bool x_SkipType(TSegTypeFlags type, TGetChunkFlags flags) const
const CDense_seg::TStarts & m_Starts
CNumSegWithOffset x_GetSegFromRawSeg(TNumseg seg) const
TSeqPos x_GetLen(TNumrow row, TNumseg seg) const
TNumseg GetRawSeg(TNumrow row, TSeqPos seq_pos, ESearchDirection dir=eNone, bool try_reverse_dir=true) const
TSignedSeqPos GetStart(TNumrow row, TNumseg seg, int offset=0) const
TSignedSeqPos GetAlnPosFromSeqPos(TNumrow row, TSeqPos seq_pos, ESearchDirection dir=eNone, bool try_reverse_dir=true) const
bool IsPositiveStrand(TNumrow row) const
TSignedSeqPos GetSeqPosFromAlnPos(TNumrow for_row, TSeqPos aln_pos, ESearchDirection dir=eNone, bool try_reverse_dir=true) const
const CDense_seg::TIds & m_Ids
TNumseg GetSeg(TSeqPos aln_pos) const
@ fUnalignedOnLeftOnAnchor
@ fUnalignedOnRightOnAnchor
@ fNotAlignedToSeqOnAnchor
TNumseg x_GetRawSegFromSeg(TNumseg seg) const
vector< CNumSegWithOffset > m_NumSegWithOffsets
TRawSegTypes & x_GetRawSegTypes() const
TSignedSeqPos GetSeqAlnStart(TNumrow row) const
bool x_CompareAdjacentSegTypes(TSegTypeFlags left_type, TSegTypeFlags right_type, TGetChunkFlags flags) const
TDim GetNumRows(void) const
TSegTypeFlags x_SetRawSegType(TNumrow row, TNumseg seg) const
TSeqPos GetAlnStop(TNumseg seg) const
void SetAnchor(TNumrow anchor)
CDense_seg::TStarts m_AlnStarts
vector< TNumseg > m_AlnSegIdx
void x_CreateAlnStarts(void)
vector< TNumseg > m_SeqLeftSegs
const CDense_seg::TStrands & m_Strands
const TNumseg & x_GetSeqRightSeg(TNumrow row) const
TSegTypeFlags x_GetRawSegType(TNumrow row, TNumseg seg, int hint_idx=-1) const
vector< TNumseg > m_SeqRightSegs
CRef< CAlnChunkVec > GetAlnChunks(TNumrow row, const TSignedRange &range, TGetChunkFlags flags=fAlnSegsOnly) const
unsigned int TSegTypeFlags
TSeqPos GetAlnStart(void) const
TSignedSeqPos x_GetRawStop(TNumrow row, TNumseg seg) const
TSeqPos GetLen(TNumseg seg, int offset=0) const
CDense_seg::TNumseg TNumseg
const CDense_seg::TWidths & m_Widths
TSeqPos GetAlnStop(void) const
TSeqPos GetSeqStop(TNumrow row) const
TSeqPos GetAlnStart(TNumseg seg) const
int StrandSign(TNumrow row) const
TSignedSeqPos GetSeqAlnStop(TNumrow row) const
TNumseg GetNumSegs(void) const
TSeqPos GetSeqStart(TNumrow row) const
void x_SetRawSegTypes(TNumrow row) const
TSignedSeqPos GetSeqPosFromSeqPos(TNumrow for_row, TNumrow row, TSeqPos seq_pos, ESearchDirection dir=eNone, bool try_reverse_dir=true) const
TSignedSeqPos x_GetRawStart(TNumrow row, TNumseg seg) const
vector< TSegTypeFlags > TRawSegTypes
const CDense_seg::TLens & m_Lens
TWidths & SetWidths(void)
ESearchDirection
Position search options.
@ eRight
Towards higher aln coord (always to the right)
@ eLeft
Towards lower aln coord (always to the left)
@ eBackwards
Towards lower seq coord (to the left if plus strand, right if minus)
@ eForward
Towards higher seq coord (to the right if plus strand, left if minus)
static void test_type(TDSSOCKET *tds, TDSCOLUMN *col)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static const struct type types[]
unsigned int TSeqPos
Type for sequence locations and lengths.
int TSignedSeqPos
Type for signed sequence position.
void Critical(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
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.
void SetTo(TTo value)
Assign a value to To data member.
TLens & SetLens(void)
Assign a value to Lens data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
void SetDim(TDim value)
Assign a value to Dim data member.
vector< TSignedSeqPos > TStarts
void SetDim(TDim value)
Assign a value to Dim data member.
void SetType(TType value)
Assign a value to Type data member.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TStrands & SetStrands(void)
Assign a value to Strands data member.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
TIds & SetIds(void)
Assign a value to Ids data member.
@ eType_partial
mapping pieces together
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
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