82 , m_SeqAlign(&mapped_align)
83 , m_OrigSeqAlign(orig_align)
84 , m_OrigAnchor(orig_anchor)
86 , m_DisableTooltipsCaching(
false)
124 CreateObjectInterface<IGuiObjectInfo>(scoped_obj,
NULL));
126 if ( !gui_info )
return;
142 gui_info->GetToolTip(tt, t_title, at_p);
143 gui_info->GetLinks(tt,
false);
147 tt.
AddRow(
"Last displayed alignment");
148 tt.
AddRow(
"Alignment rows truncated for 'Adaptive' display");
149 tt.
AddRow(
"To see all alignments select 'Show All'");
167 p_areas->push_back(area);
249 if (
ctx.seq_range.Empty())
264 for (
int row = 0; row < row_num; ++row) {
268 unique_ptr<IAlnSegmentIterator> p_it(
282 ctx.base_width_anchor;
285 ctx.base_width_anchor;
286 if (curr_seq_from > curr_seq_to) {
287 swap (curr_seq_from, curr_seq_to);
289 curr_seq_to += 1.0 /
ctx.base_width_anchor;
291 if (gap_size > 1.5) {
323 if (
ctx.seq_range.Empty())
340 for (
int row = 0; row < row_num; ++row) {
344 unique_ptr<IAlnSegmentIterator> p_it(
348 int last_aligned_seg_to_anchor = -2;
349 int last_aligned_seg_to_curr = -2;
350 int last_aligned_seg_from_anchor = -2;
351 int last_aligned_seg_from_curr = -2;
353 int last_large_ins = -100000;
355 int seg_iter_dir = 0;
365 if (seg_iter_dir == 0) {
370 if (last_aligned_seg_to_anchor < 0) {
372 last_aligned_seg_to_anchor = anchor_to;
373 last_aligned_seg_from_anchor = anchor_from;
377 if (anchor_to < last_aligned_seg_to_anchor || anchor_from < last_aligned_seg_to_anchor) {
385 if (seg_iter_dir == -1) {
388 if ((
int)t_pos == last_aligned_seg_from_anchor - 1) {
389 start = t_pos /
ctx.base_width_anchor;
390 if (
ctx.reverse_strand) {
393 ins_len = last_aligned_seg_from_curr - seg.
GetRange().
GetTo();
397 last_aligned_seg_to_anchor = t_pos;
400 }
else if (seg_iter_dir == 1) {
403 if ((
int)f_pos == last_aligned_seg_to_anchor + 1) {
404 start = f_pos /
ctx.base_width_anchor;
405 if (
ctx.reverse_strand) {
406 ins_len = last_aligned_seg_from_curr - seg.
GetRange().
GetTo();
412 last_aligned_seg_from_anchor = f_pos;
426 start /=
ctx.base_width_anchor;
429 last_aligned_seg_to_anchor = -2;
430 last_aligned_seg_from_anchor = -2;
432 if (ins_len <= 0)
continue;
438 ins_len_pix /=
ctx.base_width_anchor;
445 }
else if (ins_len_pix > 2.0) {
447 last_large_ins = (
int)start;
449 if (ins_len_pix < 0.1f)
460 start + size_in_model,
ctx.yy - over,
461 start - size_in_model,
ctx.yy - over);
463 start - size_in_model,
ctx.yy +
ctx.bar_h + over,
464 start + size_in_model,
ctx.yy +
ctx.bar_h + over);
480 sort(unaligned_regions.begin(), unaligned_regions.end(),
483 return a.GetFrom() < b.GetFrom();
492 if (unaligned_regions.empty()) {
496 for (
const auto& unaligned_rng : unaligned_regions) {
498 ln_start = unaligned_rng.GetToOpen();
506 if (
ctx.seq_range.Empty())
529 for (
int row = 0; row < row_num; ++row) {
534 unique_ptr<IAlnSegmentIterator> p_it(
551 ctx.base_width_anchor;
554 ctx.base_width_anchor;
555 if (curr_seq_from > curr_seq_to) {
556 swap(curr_seq_from, curr_seq_to);
558 TSeqRange curr_seq(curr_seq_from, curr_seq_to - 1);
564 if (visible_range.
Empty())
567 unaligned_regions.emplace_back(visible_range.
GetFrom() + 1, visible_range.
GetTo() + 1);
572 if (h_text >
ctx.bar_h) {
579 sLabelTextOut +=
" bp unaligned";
586 if ((label_width + label_width*0.5) >= visible_range.
GetLength()) {
600 for (
int i = 0;
i < labelsCount; ++
i) {
601 xM = visible_range.
GetFrom() + part_size / 2.0 +
i*part_size;
602 xLT = visible_range.
GetFrom() + part_size / 2.0 +
i*part_size - half_label;
605 xLF = visible_range.
GetFrom() + part_size / 2.0 +
i*part_size + half_label;
634 if (tail_5 >
ctx.tail_5)
635 tail_5 -=
ctx.tail_5;
638 if (tail_3 >
ctx.tail_3)
639 tail_3 -=
ctx.tail_3;
662 if (h_text <
ctx.bar_h) {
686 if (h_text <
ctx.bar_h) {
696 if (
ctx.tail_5 > 0) {
699 if (
ctx.tail_3 > 0) {
705 if ((tail_5 >
ctx.tail_5) || (tail_3 >
ctx.tail_3))
722 if (!visible_range.
Empty()) {
737 int aligned_seq = anchor == 0 ? 1 : 0;
760 bool ab = mhndl.
IsAa();
761 bool rb = hndl.
IsAa();
774 if (
ctx.reverse_strand) {
798 string translated_seq;
801 translated_seq = seq;
822 for (
TSeqPos bp = 0; bp < seq.size(); bp++) {
826 pos = sStart + bp + addon;
829 pos = sStart + bp * 3 + addon + 1;
851 if (
ctx.seq_range.Empty())
869 if ( !splice5.empty() && !splice3.empty() &&
883 pre_stop = neg_genomic ?
890 if (
ctx.seq_range.Empty())
893 if (
ctx.override_color)
894 c =
ctx.read_status_color;
905 if (
ctx.override_color)
918 TModelUnit xM = (
ctx.whole_range.GetFrom() +
ctx.whole_range.GetTo()) * 0.5;
935 double identity = 100.0;
938 int identities = (
int)align_length;
943 identity = identities * 100 / align_length;
946 if (identity > 0.6) {
947 identity = 1.75 * identity - 0.75;
954 if (
ctx.override_color)
977 if (aligned_seq < 0) {
984 ctx.f /=
ctx.base_width_anchor;
986 ctx.t /=
ctx.base_width_anchor;
993 ctx.whole_range =
ctx.seq_range;
995 if (
ctx.seq_range.Empty()) {
997 <<
"CAlignGlyph::DrawPWAlignElem: zero alignment range!");
1011 ctx.override_color =
false;
1015 ctx.half =
ctx.bar_h * 0.5;
1033 if (aln_r_s > aln_r_e) {
1034 swap(aln_r_s, aln_r_e);
1047 if (show_unaligned_tails) {
1050 show_unaligned_tails =
false;
1061 if (
ctx.reverse_strand) {
1076 if (
ctx.reverse_strand && !(show_unaligned_tails &&
ctx.tail_5)) {
1080 else if (!(show_unaligned_tails &&
ctx.tail_3)) {
1082 ctx.t + 1 + over2,
ctx.yy - 1,
ctx.t + 1 + over2,
ctx.yy +
ctx.bar_h + 1);
1097 for (
int row = 0; row < row_num; ++row) {
1098 if (row == anchor) {
1101 if (
m_Score->IsAverageable()) {
1103 ctx.override_color,
ctx.read_status_color);
1106 ctx.override_color,
ctx.read_status_color);
1118 if (show_unaligned_tails) {
1160 if (
ctx.tail_5 > 0) {
1168 if (
ctx.tail_3 > 0) {
1193 *title =
"[Alignment] " +
1210 if (title->length() > 20 && title->find(
"\\panfs\\") != string::npos) {
1211 size_t pos = title->find_last_of(
"\\");
1212 if (pos != string::npos) {
1213 *title = title->substr(pos + 1);
1214 if (title->length() > 20) {
1215 pos = title->rfind(
'.');
1216 if (pos != string::npos && pos > 0) {
1217 pos = title->rfind(
'.', pos - 1);
1218 if (pos != string::npos) {
1219 *title = title->substr(pos + 1);
1244 gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1313 tail_len =
x_GetTailWidth(tail_5, visible_tail_5, base_width_curr);
1319 tail_len =
x_GetTailWidth(tail_3, visible_tail_3, base_width_curr);
1342 if ( !reverse_strand ) {
1348 if (row == anchor) {
1359 max_label_w =
max(max_label_w, label_w);
1393 if (max_label_width_px > 0.0) {
1396 if (label_width_px > max_label_width_px) {
1397 label_width_px = max_label_width_px;
1399 if ((string::npos !=
label.find(
"...")) && (
label.length() <= 5))
1408 if (reverse_strand) {
1409 xM = inrc.
GetTo() - t_w;
1413 inrc.
GetTo(), yM - label_h - 1.0), 0);
1420 xM + t_w, yM - label_h - 1.0), 0);
1445 if (anchor_range.
Empty()) {
1447 <<
"CAlignGlyph::x_DrawMultiAlign: zero alignment range!");
1453 if (anchor_range.
Empty()) {
1459 bool override_color =
false;
1467 if (aln_r_s > aln_r_e) {
1468 swap(aln_r_s, aln_r_e);
1480 if (row == anchor) {
1487 bool reverse_strand =
1503 if (
m_Score->IsAverageable()) {
1505 override_color, read_status_color);
1508 override_color, read_status_color);
1512 gl.
Color4f(1.0f, 0.0f, 0.0f, 1.0f);
1516 unique_ptr<IAlnSegmentIterator> p_it(
1529 start /= base_width_anchor;
1557 start /= base_width_anchor;
1597 char strandLabel[2] = {
'>',
'\0'};
1600 strandLabel[0] = reverse_strand ?
'>' :
'<';
1602 strandLabel[0] = reverse_strand ?
'<' :
'>';
1606 strandLabel[0] = reverse_strand ?
'<' :
'>';
1608 strandLabel[0] = reverse_strand ?
'>' :
'<';
1647 if (label_w > max_label_width_px) {
1648 label_w = max_label_width_px;
1659 xM + label_w, y - gl.
TextHeight(&l_font) - 1.0), 0);
1689 if (anchor_range.
Empty()) {
1703 if (aln_r_s > aln_r_e) {
1704 swap(aln_r_s, aln_r_e);
1708 if (aln_range.
GetFrom() > 2) {
1717 unique_ptr<IAlnSegmentIterator> p_it(
1721 bool ab = mhndl.
IsAa();
1722 bool rb = hndl.
IsAa();
1753 TSeqPos frame_shift_f = start % base_width_curr;
1754 TSeqPos frame_shift_t = 2 - stop % base_width_curr;
1755 if (base_width_anchor == 3) {
1756 frame_shift_f = sStart % base_width_anchor;
1757 frame_shift_t = 2 - sStop % base_width_anchor;
1759 if (sStart > sStop) {
1760 swap(sStart, sStop);
1761 swap(frame_shift_f, frame_shift_t);
1763 stop /= base_width_curr;
1764 start /= base_width_curr;
1765 sStart /= base_width_anchor;
1766 sStop /= base_width_anchor;
1776 sStop += frame_shift_t;
1777 sStart -= frame_shift_f;
1780 stop += frame_shift_t;
1781 start -= frame_shift_f;
1789 string seq, mseq, tmp_seq, visible_seq;
1792 visible_seq = tmp_seq;
1794 if (reverse_strand) {
1818 string translated_seq;
1822 string seq_candidate = mseq;
1823 if (reverse_strand) {
1829 if (reverse_strand) {
1832 translated_seq = tmp_seq;
1839 r.SetFrom(
r.GetFrom() - frame_shift_f);
1840 r.SetTo(
r.GetTo() + frame_shift_t);
1857 TSeqPos start_base = frame_shift_f % base_width_anchor;
1858 TSeqPos stop_base =
min(stop - start + 1 - frame_shift_t % base_width_anchor,
1862 for (
TSeqPos bp = start_base; bp < stop_base; bp++) {
1867 pos = sStart + bp + addon;
1868 match = bp < seq.size() && bp < mseq.size()
1869 && seq[bp] == mseq[bp];
1872 pos = sStart + bp * 3 + addon + 1;
1873 match = bp < seq.size() && bp < translated_seq.size()
1874 && seq[bp] == translated_seq[bp];
1878 int bp_pos = bp / 3;
1879 match = bp_pos < seq.size() && bp_pos < translated_seq.size()
1880 && mseq[bp_pos] == translated_seq[bp_pos];
1886 if (pos < (seg_start - 0.5))
1888 if (pos > (seg_stop + 1))
1904 unique_ptr<IAlnScoreIterator> score_iter(
m_Score->GetScoreIterator(row));
1905 score_iter->MoveTo(bp);
1917 bases[0] = visible_seq[bp];
1920 pos, center_y + fs * 0.5,
false);
1932 "Alignment rows truncated for 'Adaptive' display - select 'Show All' to see more"
1933 :
"The number of alignment rows exceeds the supported limit";
1935 "Select 'Show All' to see all alignments"
1936 :
"Number of rows exceeds limit";
1937 const char* char_msg =
"X";
1945 const char* msg =
NULL;
1948 if (width > long_msg_width) {
1950 msg_width = long_msg_width;
1952 else if (width > short_msg_width) {
1954 msg_width = short_msg_width;
1956 else if (width > char_msg_width) {
1958 msg_width = char_msg_width;
1963 TModelUnit msg_spacing = char_msg_width * 4.0;
1967 if (width < msg_width + msg_spacing*2.0) {
1982 vector<TModelPoint> pts;
1983 bool bottom_y =
true;
1985 while (pos <
GetLeft() + seq_w - seq_char_width) {
1987 pts.push_back(
TModelPoint(pos, center_y + fs * 0.5));
1989 pts.push_back(
TModelPoint(pos, center_y - fs * 0.5));
1991 bottom_y = !bottom_y;
1992 pos += seq_char_width;
1999 while (pos >
GetRight() - (seq_w - seq_char_width)) {
2001 pts.push_back(
TModelPoint(pos, center_y + fs * 0.5));
2003 pts.push_back(
TModelPoint(pos, center_y - fs * 0.5));
2005 bottom_y = !bottom_y;
2006 pos -= seq_char_width;
2035 float fraction,
bool)
2050 bool override_color,
2065 TR rasterizer(scoreStart, scoreEnd, fromM, toM);
2066 SScPix pix = { 0.0f, 0.0f,
false };
2068 unique_ptr<IAlnScoreIterator> score_iter(
m_Score->GetScoreIterator(row));
2074 while (aln_seg_it && it) {
2083 while (it && start1 > stop2) {
2089 if (start1 > stop2) {
2094 from = std::max<int>(start1, start2);
2095 to = std::min<int>(stop1, stop2);
2098 act_from /= base_width_anchor;
2100 act_to /= base_width_anchor;
2101 if (act_from > act_to) {
2102 swap(act_from, act_to);
2105 if (act_from <= act_to) {
2108 rasterizer.AddInterval(act_from, act_to + 1.0 / base_width_anchor, pix,
FSetPixMaxCoverage);
2121 const TR::TRaster& raster = rasterizer.GetRaster();
2122 static float eps = 0.0001f;
2123 double shift_x = scoreStart;
2127 for (
size_t i = 0;
i < raster.size(); ) {
2128 double start =
i + shift_x;
2129 const SScPix& sc_pix = raster[
i];
2130 while (++
i < raster.size() && raster[
i] == sc_pix);
2136 color = read_status_color;
2148 int off_y = sc_pix.
m_Gap ? GapOffset : 0;
2150 double x2 =
i + shift_x;
2154 gl.
Vertex2d(start, yy + height - off_y);
2157 gl.
Rectd(start, yy + off_y, x2, yy + height - off_y);
2192 static const float eps = 0.00001f;
2218 bool override_color,
2221 if (seq_range.
Empty())
2236 TR rasterizer(scoreStart, scoreEnd, fromM, toM);
2238 unique_ptr<IAlnScoreIterator> score_it(
m_Score->GetScoreIterator(row));
2244 while (aln_seg_it && it) {
2253 while (it && start1 > stop2) {
2261 if (start1 > stop2) {
2266 from = std::max<int>(start1, start2);
2267 to = std::min<int>(stop1, stop2);
2269 SScPix2 pix = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
false };
2271 act_from /= base_width_anchor;
2273 act_to /= base_width_anchor;
2274 if (act_from > act_to) {
2275 swap(act_from, act_to);
2277 if (act_from <= act_to && act_from <=toM) {
2285 rasterizer.AddInterval(act_from, act_to + 1.0 / base_width_anchor, pix,
FSetPix2);
2290 int len = (act_to - act_from) + 1;
2294 rasterizer.AddInterval(act_from, act_to + 1.0 / base_width_anchor, pix,
FSetPix2);
2311 const TR::TRaster& raster = rasterizer.GetRaster();
2315 double shift_x = scoreStart;
2316 static const float eps = 0.001f;
2317 float value_scale = value_limits.
GetTo() - value_limits.
GetFrom();
2318 if (value_scale <= 0)
2322 for (
size_t i = 0;
i < raster.size(); ) {
2323 double start =
i + shift_x;
2325 while (++
i < raster.size() && raster[
i] == sc_pix);
2332 color = override_color ?
2335 sc =
min(1.0f, ((sc - value_limits.
GetFrom()) / value_scale));
2338 float alpha = 1.0f - sc * 0.75f;
2345 float alpha =
min(1.0f, 0.25f + sc_pix.
m_GapLen * 0.75f);
2352 double x2 =
i + shift_x;
2361 gl.
Rectd(start, yy, x2, yy + height);
2397 <<
"CAlignGlyph::x_CalcIntervals: zero alignment range!");
2412 intervals.push_back(
r);
2419 if (aln_r_s > aln_r_e) {
2420 swap(aln_r_s, aln_r_e);
2424 int row = target_row;
2426 row =
max(0, 1 - anchor);
2442 start /= base_width_anchor;
2444 stop /= base_width_anchor;
2448 if (!intervals.empty()) {
2451 intervals.back().SetTo(stop);
2456 intervals.push_back(
TSeqRange(start, stop) );
2509 if (
ctx.reverse_strand) {
2512 start *=
ctx.base_width_anchor;
2513 start += aln_stop + 1;
2515 end *=
ctx.base_width_anchor;
2516 end += aln_stop + 1;
2521 start *=
ctx.base_width_anchor;
2522 start = aln_start - start;
2524 end *=
ctx.base_width_anchor;
2525 end = aln_start - end;
2532 start *=
ctx.base_width_anchor;
2535 end *=
ctx.base_width_anchor;
2541 start *=
ctx.base_width_anchor;
2544 end *=
ctx.base_width_anchor;
2572 tail_len_pix += label_space_pix;
2579 if (tail_label_len > 0) {
2586 tail_len = visible_tail*base_width_curr;
2587 if (visible_tail < tail) {
2591 if (tail_label_len > 0) {
2622 override_color =
false;
2627 if ((*iter)->GetType().IsStr() &&
2628 (*iter)->GetType().GetStr() ==
"PCR duplicate") {
2629 override_color =
true;
2632 if ((*iter)->GetType().IsStr() &&
2633 (*iter)->GetType().GetStr() ==
"Poor sequence quality") {
2634 override_color =
true;
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
double CompressLength(double len)
static void FSetPixMaxCoverage(SScPix &dst, const SScPix &src, float fraction, bool)
a pixel with the Max coverage (fraction) overrides all attributes
static const int kCompactLabelSpace_h
static const TSeqPos kTailGlyphLen
static float kMinSegDistance
static const int kLabelSpace_v
static const int kAlignRowSpace
static void FSetPix2(SScPix2 &dst, const SScPix2 &src, float fraction, bool long_seg)
accumulate weighted scores
static const TSeqPos kCompactTailGlyphLen
static const int kLabelSpace_h
static const TModelUnit kPWAlignPackLevel
ELabelPosition m_LabelPos
@ eExtremeCompact
extreme compact mode
CGlTextureFont m_LabelFont
ECompactMode m_CompactMode
Alignment layout compact mode.
CRgbaColor m_UnalignedSequence
bool m_ShowIdenticalBases
bool m_ShowUnalignedTailsForTrans2GenomicAln
CRgbaColor m_NonConsensus
EUnalignedTailsMode m_UnalignedTailsMode
@ ePos_Above
above the rendered bar
@ ePos_Side
always on 5' side
CGlAttrGuard - guard class for restoring OpenGL attributes.
@ fNoCaching
The tooltip for this feature should not be cached.
int m_Flags
area flags, will need to replace m_Type
bool m_PositiveStrand
the default is true
static string GetAlignSignature(const objects::CSeq_align &align, const objects::CSeq_loc &on_loc, objects::CScope *scope, const objects::CSeq_annot_Handle &annot_handle)
bool IsHorizontal() const
void TextOut(const CGlTextureFont *font, const char *text, TModelUnit x, TModelUnit y, bool center, bool adjust_flip=true) const
void DrawTriangle(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, TModelUnit x3, TModelUnit y3, bool border=false) const
CGlPane * GetGlPane()
inline method implementations
TModelRange IntersectVisible(const CSeqGlyph *obj) const
TVPUnit SeqToScreenX(const TModelUnit &size) const
void DrawLineStrip(const vector< TModelPoint > &points) const
void DrawUnalignedTail(TModelUnit x1, TModelUnit x2, TModelUnit y1, TModelUnit y2, bool is_polya, const CRgbaColor &color) const
void DrawLine(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2) const
void DrawStippledLine(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, int factor=2, unsigned short pattern=0xAAAA) const
objects::CScope & GetScope()
void DrawQuad(const TModelRect &rc, bool border=false) const
const TModelUnit & GetScale() const
void DrawSelection(const TModelRect &rc) const
TModelUnit SeqToScreen(const TModelUnit &size) const
convert from sequence positions to screen pixels
TModelUnit SeqToScreenXInModelUnit(const TModelUnit &size) const
TModelUnit ScreenToSeq(const TModelUnit &size) const
convert from screen pixels to sequence positions
bool IsOverviewMode() const
bool IsFlippedStrand() const
bool WillSeqLetterFit() const
is it enougth space to sequence letters.
void DrawDisk2(const TModelPoint &p, TModelUnit size, CRgbaColor color)
const CRgbaColor & GetSelLabelColor() const
void DrawLine_NoAA(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2) const
TSeqPos GetViewWidth() const
bool WillLabelFit(const TModelRect &rc) const
void Draw3DQuad(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
void DrawBackground(const TModelRect &rcm, TModelUnit border) const
void DrawGreaterLessSign(TModelUnit x1, TModelUnit x2, TModelUnit bar_h, bool negative) const
class CRgbaColor provides a simple abstraction for managing colors.
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
void x_InitHTMLActiveArea(CHTMLActiveArea &area) const
initialize the basic information for a given active area.
CRenderingContext * m_Context
the rendering context
virtual void SetHeight(TModelUnit h)
virtual TModelUnit GetRight() const
virtual void SetWidth(TModelUnit w)
virtual void SetLeft(TModelUnit l)
virtual TModelUnit GetTop() const
virtual TModelUnit GetHeight() const
virtual bool LessBySeqPos(const CSeqGlyph &obj) const
compare this object to another based on glyph sequence position.
float GetFadeFactor() const
size_t GetTearline() const
size_t GetVisible() const
virtual TModelUnit GetWidth() const
virtual TModelUnit GetLeft() const
TModelRect GetModelRect() const
get the bounding box.
vector< CHTMLActiveArea > TAreaVector
virtual TModelUnit GetBottom() const
static SIZE_TYPE Reverse(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
static SIZE_TYPE ReverseComplement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
static SIZE_TYPE Complement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
@ 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)
virtual EPolyATail HasPolyATail() const =0
Check if there is any unaligned polyA tail.
pair< ECigarOp, size_t > TCigarPair
virtual void GetUnalignedTails(TSignedSeqPos &start_tail, TSignedSeqPos &end_tail, bool clipped=true) const
virtual const TCigarPair * GetCigarAtAlnPos(int row, TSignedSeqPos pos) const
virtual bool IsRegular() const
virtual bool IsNegativeStrand(TNumrow row) const =0
int GetPartialFlags() const
virtual const objects::CBioseq_Handle & GetBioseqHandle(IAlnExplorer::TNumrow row) const =0
virtual TSeqRange GetAlnRangeWithTails() const
IAlnExplorer::TNumrow TNumrow
virtual TSeqPos GetSeqStart(TNumrow row) const =0
virtual const objects::CSeq_id & GetSeqId(TNumrow row) const =0
int GetGenCode(IAlnExplorer::TNumrow row) const
virtual TSignedRange GetSeqAlnRange(TNumrow row) const =0
virtual IAlnExplorer::TNumrow GetQuery() const
virtual TSeqPos GetSeqStop(TNumrow row) const =0
virtual TSignedSeqPos GetAlnPosFromSeqPos(TNumrow row, TSeqPos seq_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
virtual TSeqPos GetFrom() const =0
virtual float GetAttr() const =0
virtual TSeqPos GetTo() const =0
Alignment segment iterator interface.
@ eAllSegments
Iterate all segments.
@ eSkipGaps
Skip gap segments (show only aligned ranges)
Alignment segment interface.
virtual const TSignedRange & GetRange(void) const =0
Get the selected row range.
@ fAligned
Aligned segment.
@ fIndel
Either anchor or the selected row is not present in the segment.
@ fUnaligned
The range on the selected sequence does not participate in the alignment (the alignment range of the ...
virtual TSegTypeFlags GetType(void) const =0
Get current segment type.
bool IsAligned(void) const
bool IsGap(void) const
Check if there's a gap on the selected row.
virtual const TSignedRange & GetAlnRange(void) const =0
Get alignment range for the segment.
vector< TSeqRange > TIntervals
virtual TSeqPos GetBaseWidth(IAlnExplorer::TNumrow) const =0
virtual string & GetAlnSeqString(IAlnExplorer::TNumrow row, string &buffer, const IAlnExplorer::TSignedRange &aln_range) const =0
virtual IAlnExplorer::TNumrow GetNumRows() const =0
virtual IAlnExplorer::TNumrow GetAnchor() const =0
virtual IAlnSegmentIterator * CreateSegmentIterator(IAlnExplorer::TNumrow, const IAlnExplorer::TSignedRange &, IAlnSegmentIterator::EFlags) const =0
virtual TSignedSeqPos GetSeqPosFromAlnPos(IAlnExplorer::TNumrow for_row, TSeqPos aln_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
bool IsConsensusSplice(const string &splice5, const string &splice3)
Consensus splice is GY..AG or AT..AC.
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
void Warning(CExceptionArgs_Base &args)
bool IsSimplified() const
void x_DrawInserts(const SDrawContext &ctx) const
virtual void x_Draw() const
The default renderer for this layout object.
virtual bool NeedTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Check if need to show tooltip.
void x_CalcIntervals(TIntervals &intervals, int target_row=-1) const
void x_DrawStrandIndicators(const SDrawContext &ctx) const
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
virtual bool HasObject(CConstRef< CObject > obj) const
check if the wrapped object(s) is the one.
virtual bool LessBySeqPos(const CSeqGlyph &obj) const
compare this object to another based on glyph sequence position.
vector< TModelRange > TMUnitRanges
void x_RenderAveragableScores(TModelUnit yy, TSignedSeqRange aln_range, TSeqRange seq_range, TModelUnit height, int row, bool override_color, const CRgbaColor &read_status_color) const
void x_DrawMultiAlignLabel(int row, TModelUnit y) const
void x_DrawUnalignedBar(const ETail tail, const SDrawContext &ctx, const CRgbaColor &c_fg) const
CAlignGlyph(CConstRef< IAlnGraphicDataSource > aln_mgr, const objects::CSeq_align_Handle &orig_align, const objects::CSeq_align &mapped_align, int orig_anchor)
virtual CConstRef< CObject > GetObject(TSeqPos pos) const
access our core component - we wrap an object(s) of some sort.
TSeqRange x_ConvertAlnTaillRngToSeqRng(const ETail tail, const SDrawContext &ctx, const TSeqRange &aln_range) const
virtual void GetObjects(vector< CConstRef< CObject > > &objs) const
retrieve CObjects corresponding to this CSeqGlyph.
void x_DrawMultiAlign() const
void x_GetOverrideColor(bool &override_color, CRgbaColor &read_status_color) const
TModelUnit x_GetTailLabelWidth(const TSignedSeqPos tail) const
TIntervals m_Intervals
intervals.
virtual string GetSignature() const
return signature for this glyph.
void GetTitle(string *title, CLabel::ELabelType type) const
void x_DrawNonConsensusSpliceSites(const SDrawContext &ctx) const
void x_RenderNonAveragableScores(TModelUnit yy, TSignedSeqRange aln_range, TSeqRange seq_range, TModelUnit height, int row, bool override_color, const CRgbaColor &read_status_color) const
void x_DrawNoScoreAlign(const SDrawContext &ctx, const CRgbaColor &c_fg) const
void DrawPWAlignElem(const TModelRect &rcm, bool selected, bool show_label, const CRgbaColor &c_fg, const CRgbaColor &c_seq, const CRgbaColor &c_mis) const
virtual TSeqRange GetRange(void) const
get the total range of this object.
const IAlnGraphicDataSource & GetAlignMgr(void) const
Inline methods.
void x_DrawIntronsAndInternalUnalignedRegions(const SDrawContext &ctx, TSignedSeqPos from, TSignedSeqPos to) const
void x_DrawGaps(const SDrawContext &ctx) const
virtual void GetTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
CConstRef< CAlignmentConfig > m_Config
const objects::CSeq_align_Handle & GetOrigAlignment(void) const
virtual bool IsClickable() const
Query if this glyph is clickable.
void x_DrawUnalignedRowSequence(const ETail tail, const SDrawContext &ctx, const CRgbaColor &c_fg) const
virtual const objects::CSeq_loc & GetLocation(void) const
access the position of this object.
void x_DrawInternalUnalignedRegions(const SDrawContext &ctx, TMUnitRanges &unaligned_regions) const
CRef< objects::CSeq_loc > m_Location
static bool IsVDBAccession(const string &acc)
Check if string starts with ("SRA", "SRR", "DRR", "ERR")
TModelUnit GetBarHeight() const
TModelUnit x_GetTailWidth(const TSignedSeqPos tail, const TSignedSeqPos visible_tail, const TSignedSeqPos base_width_curr) const
virtual const TIntervals & GetIntervals(void) const
access sub-intervals (if any).
void x_DrawAlignRowSequence(TModelUnit center_y, int row, const CRgbaColor &c_fg, const CRgbaColor &c_seq, const CRgbaColor &c_mis) const
TSeqRange x_GetAlnTailRange(const ETail tail, const SDrawContext &ctx) const
void x_DrawSimplified(const SDrawContext &ctx, const CRgbaColor &c_fg) const
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
CConstRef< IAlnGraphicDataSource > m_AlnMgr
pointer to the actual alignment information.
bool x_ShowUnalignedTails(TModelUnit align_len) const
bool m_DisableTooltipsCaching
Indicates whether the front-end can cache the tooltips.
void x_DrawTailSequences(const SDrawContext &ctx, const CRgbaColor &c_fg) const
void x_DrawPWAlign() const
const objects::CSeq_align & GetAlignment(void) const
CConstRef< objects::CSeq_align > m_SeqAlign
CConstIRef< ISGAlnScore > m_Score
objects::CSeq_align_Handle m_OrigSeqAlign
int m_OrigAnchor
The anchor row number in original Seq-algin, not alnmgr.
void x_DrawTailGlyphs(const SDrawContext &ctx, bool show_label, const CRgbaColor &c_fg) const
virtual void Scalef(GLfloat x, GLfloat y, GLfloat z)=0
virtual void Enable(GLenum glstate)=0
virtual void Begin(GLenum mode)=0
Start rendering.
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
void Color3f(GLfloat r, GLfloat g, GLfloat b)
IRender & GetGl()
convenience function for getting current render manager
void Vertex2d(GLdouble x, GLdouble y)
TVPRect & GetViewport(void)
virtual TModelUnit TextHeight(const CGlTextureFont *font) const =0
virtual TModelUnit TextWidth(const CGlTextureFont *font, const char *text) const =0
void Color4d(GLdouble r, GLdouble g, GLdouble b, GLdouble a)
virtual void PopMatrix()=0
virtual void End()=0
Finish rendering (create buffer and send to renderer)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
TModelRect & GetVisibleRect(void)
CGlRect< TModelUnit > TModelRect
virtual void Disable(GLenum glstate)=0
glDisable()
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
TModelUnit GetScaleY(void) const
CGlPoint< TModelUnit > TModelPoint
virtual void ColorC(const CRgbaColor &c)=0
Set current color (glColor{3,4}{f,d}{v,})
void Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
virtual void PushMatrix()=0
string Truncate(const char *text, TModelUnit w, ETruncate trunc=eTruncate_Ellipsis) const
Truncate text to the secified width.
void SetDataSource(const CConstRef< IAlnGraphicDataSource > &data_source)
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
void SetAnchorRow(int anchor)
void SetFlippedStrands(bool flipped=true)
virtual void AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
void Set(float r, float g, float b)
set the color from an Fl_Color
float GetBlue(void) const
float GetGreen(void) const
void SetScale(double scale)
void Lighten(float scale)
static CRgbaColor Interpolate(const CRgbaColor &color1, const CRgbaColor &color2, float alpha)
Interpolate two colors.
static bool IsPolyA(const objects::CBioseq_Handle &bsh, TSeqPos start, TSeqPos stop)
float GetRed(void) const
Get specific channels in floating point values.
const string AsFastaString(void) const
CConstRef< CSeq_id > GetSeqId(void) const
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
@ fIs5PrimePartial
= 0x4 Translate first codon even if not start codon (because sequence is 5' partial)
TSeqPos GetBioseqLength(void) const
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
position_type GetLength(void) const
TThisType IntersectionWith(const TThisType &r) const
position_type GetToOpen(void) const
TThisType & Set(position_type from, position_type to)
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
CRange< TSignedSeqPos > TSignedSeqRange
#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.
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
@ fWithCommas
Use commas as thousands separator.
static const char label[]
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.
const TDonor_after_exon & GetDonor_after_exon(void) const
Get the Donor_after_exon member data.
TGenomic_start GetGenomic_start(void) const
Get the Genomic_start member data.
const TAcceptor_before_exon & GetAcceptor_before_exon(void) const
Get the Acceptor_before_exon member data.
bool IsSetAcceptor_before_exon(void) const
splice sites Check if a value has been assigned to Acceptor_before_exon data member.
list< CRef< CUser_object > > TExt
list< CRef< CSpliced_exon > > TExons
const TExons & GetExons(void) const
Get the Exons member data.
const TBases & GetBases(void) const
Get the Bases member data.
TGenomic_end GetGenomic_end(void) const
Get the Genomic_end member data.
bool IsSetDonor_after_exon(void) const
Check if a value has been assigned to Donor_after_exon data member.
unsigned int
A callback function used to compare two keys in a database.
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
represents a pixel with two scores, one corresponds to a gap interval, another - to an aligned segmen...
bool operator==(const SScPix2 &other) const
represents a pixel with a score, if several intervals cover a pixel, the interval with the maximum co...
float m_MaxCoverage
score assigned to the pixel
bool m_Gap
fraction of the pixel corresponding to the m_Score
bool operator==(const SScPix &other) const
true if this is a gap interval