<void()>
m_f;
106m_ConsensusRow(
NULL),
112m_bExpanded(
false),
113m_fExtOrgLookup(
true),
116m_PixLeft(-1), m_PixRight(-1), m_ModelLeft(-1), m_ModelRight(-1)
151 if(aln_from > aln_to)
152 swap(aln_from, aln_to);
153aln_from = floor(aln_from);
154aln_to = floor(aln_to );
157 intrc_right = floor(source_rc_vis.
Right());
158 intrc_left = floor(source_rc_vis.
Left());
160 if(aln_to == rc_right) {
165 if(aln_from == rc_left) {
172 if(aln_from == rc_left) {
176 if(aln_to == rc_right) {
215s_row,
"Click to expand/collapse",
"toggle_expand");
466}
catch(std::exception& e) {
469 if(!
error.empty()) {
545wxEventType
type=
event.GetEventType();
547wxPoint pos =
event.GetPosition();
554 event.Skip(
false);
560wxPoint pos =
event.GetPosition();
570 if(
type== wxEVT_LEFT_DOWN) {
572}
else if(
type== wxEVT_LEFT_UP) {
573skipped = glyph->
OnLeftUp(hit_point);
581 if(!event.CmdDown()) {
583sel_visitor->
Clear();
591}
else if(
type== wxEVT_LEFT_DCLICK) {
596 event.Skip(skipped);
616tooltip.
AddRow(
"First position in sequence coordinates");
619tooltip.
AddRow(
"First visible position in alignment coordinates");
625tooltip.
AddRow(
"Last visible position in alignment coordinates");
628tooltip.
AddRow(
"Last position in sequence");
631tooltip.
AddRow(
"Sequence length");
634tooltip.
AddRow(
"Organism name");
651tooltip.
AddRow(sequence::CDeflineGenerator().GenerateDefline(handle));
663 if(handle.
IsNa()) {
682s_tip =
"Strand - ";
687s_tip =
"Graphs: Click to ";
690s_tip =
"No graphs available - nothing to expand";
700 #define TOOLTIP_RANGE_PIX 3 714 const function<
bool(
CGlPane& pane)>&
f)
724 usingTRangeData = tuple < IAlnExplorer::TSignedRange, IAlnExplorer::TSignedRange, COpenRange<double> >;
725vector <TRangeData> render_list;
727 for(; *align_it; ++(*align_it)) {
731 auto& seq_range = seg.
GetRange();
732 if(seq_range.Empty())
735 if(aln_range.Empty())
741 doublex1 = aln_range.
GetFrom();
742 doublex2 = aln_range.GetTo();
745x1 = (x1 - offset_x) / scale_x;
746x2 = (x2 - offset_x + 1) / scale_x;
747x1 = max<TModelUnit>(x1 + left, left);
748x2 = min<TModelUnit>(x2 + left, right);
766 for(
auto&
data: render_list) {
767 auto& seq_range = get<0>(
data);
768 auto& aln_range = get<1>(
data);
769 auto& view_range = get<2>(
data);
770viewport.
SetHorz(view_range.GetFrom(), view_range.GetTo());
773 auto l= view_range.GetFrom(),
r= view_range.GetTo();
775 if(m_PixRight <= l || m_PixLeft >=
r)
777 auto len= (
r-
l) + 1;
787seq_range.GetFrom(), seq_range.GetTo(),
789 bool error=
f(target_pane);
840hit_point = track_pane.
UnProject(vp_pt.
X(), vp_pt.
Y());
848 returnlayout_track_hit;
859 if(hit_point.
m_X< 0)
873glyph =
m_TrackPanel->CGlyphContainer::HitTest(hit_point);
904glyph->
GetTooltip(hit_point, *track_tooltip, s_tip);
905 if(!track_tooltip->IsEmpty()) {
910tooltip.
Append(*track_tooltip);
915s_tip +=
", Negative Strand";
919tooltip.
Append(*track_tooltip);
938 returnformatter->Render();
968 const intkMaxRegions = 5;
983 if(n_regions < kMaxRegions) {
988 if(n_regions < kMaxRegions) {
991 if(seq_from > seq_to)
992 swap(seq_from, seq_to);
996 if(aln_from > aln_to)
997 swap(aln_from, aln_to);
1003}
else if(aligned) {
1004 if(aln_r.
GetFrom() == prev_aln_to + 1 && seq_r.
GetFrom() > prev_to + 1) {
1006 if(n_regions < kMaxRegions) {
1014prev_aln_to = aln_r.
GetTo();
1015prev_to = seq_r.
GetTo();
1019 if(n_regions > kMaxRegions)
1029 for(
autoseqdesc : descr.
Get()) {
1030 if(seqdesc->IsTitle()) {
1031res = seqdesc->GetTitle();
1043 for(
autoseqdesc : descr.
Get()) {
1044 if(seqdesc->IsSource()) {
1048 if(subsrc->IsSetSubtype() && subsrc->GetSubtype() == subtype) {
1049 returnsubsrc->GetName();
1063 for(
autoseqdesc : descr.
Get()) {
1064 if(seqdesc->IsSource()) {
1069 for(
autoorgmod : on.
GetMod()) {
1070 if(orgmod->IsSetSubtype() &&
1073 returnorgmod->GetSubname();
1095 if(!title.empty()) {
1107s_tip +=
" residues)";
1109s_tip +=
" bases)";
1112s_tip +=
", Negative Strand";
1119tooltip.
AddRow(
"Organism:", taxonomy);
1123s_tip +=
", Negative Strand";
1140 if(!s.empty()) tooltip.
AddRow(
"Sequence title:", s);
1142 if(!s.empty()) tooltip.
AddRow(
"Country:", s);
1146 if(!s.empty()) tooltip.
AddRow(
"Host:", s);
1149 if(!s.empty()) tooltip.
AddRow(
"Isolation source:", s);
1151 if(!s.empty()) tooltip.
AddRow(
"Collection date:", s);
1159seq_pos /= base_width;
1178s_tip +=
"<br>[coordinates ";
1181tooltip.
AddRow(
"Insertion:", s_tip);
1199s_tip +=
" residue";
1205tooltip.
AddRow(
"Gap:", s_tip);
1217 strings_tip =
"Unaligned region - ";
1223s_tip +=
", on Sequence [";
1249seq +=
"..."+ right_seq;
1295 intleft = (
int) floor(rc_model.
Left());
1296 intright =
int(ceil(rc_model.
Right())) - 1;
1315 boolcan_render_scores = averageable || scale_x <
kScoreMinScale;
1323 if(has_scores && can_render_scores) {
1355 intstart = (left < floor(rc_model.
Left())) ? left + 1 : left;
1356 intstop = (
int)ceil(rc_model.
Right());
1357 if(stop + 1 > rc_model.
Right()) {
1364gl.
Viewport(orig_vp[0], orig_vp[1], orig_vp[2], orig_vp[3]);
1382gl.
Begin(GL_LINES);
1383gl.
Vertex2f((
float)rc_vp.Right(), (
float)rc_vp.Top() + 1);
1384gl.
Vertex2f((
float)rc_vp.Right(), (
float)rc_vp.Bottom() - 1);
1410 static CRgbaColorcl_insert(0.0f, 0.0f, 1.0f);
1411 static CRgbaColorcl_unaligned(0.0f, 0.5f, 0.0f);
1412gl.
Begin(GL_LINES);
1422 TModelUnitins_pos = it_2->GetAlnRange().GetFrom() - offset_x;
1423 if(ins_pos < row_start || ins_pos > row_stop)
1427gl.
ColorC(cl_unaligned);
1433log_len =
max(log_len, kMinLen);
1438 glLined(ins_pos, top_y - 1, ins_pos, bottom_y - 1);
1439 glLined(x1, top_y - 1, x2, top_y - 1);
1440 glLined(x1, bottom_y, x2, bottom_y);
1453vector<TSeqRange> gaps;
1463 boolempty_seg = (
r.GetFrom() < row_start ||
r.GetTo() > row_stop);
1469gaps.emplace_back(
r.GetFrom(),
r.GetTo());
1471 if(
r.GetFrom() - gaps.back().GetTo() == 1) {
1472gaps.back().
SetTo(
r.GetTo());
1475gaps.emplace_back(
r.GetFrom(),
r.GetTo());
1479 if(!gaps.empty()) {
1481gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1482gl.
Begin(GL_LINES);
1483 for(
const auto&
r: gaps) {
1484 doublepix_len =
r.GetLength();
1486 if(pix_len < 1.5) {
1487 autopos =
r.GetFrom() - offset_x;
1488 floatalpha = 0.25 +
r.GetLength() * 0.75;
1512gl.
ColorC(cl_unaligned);
1513gl.
Begin(GL_LINES);
1524 if(aln_r.
GetFrom() == prev_aln_pos + 1 &&
r.GetFrom() > prev_pos + 1) {
1528log_len =
max(log_len, kMinLen);
1533 glLined(ins_pos, top_y, ins_pos, bottom_y);
1534 glLined(x1, top_y, x2, top_y);
1535 glLined(x1, bottom_y, x2, bottom_y);
1538prev_aln_pos = aln_r.
GetTo();
1539prev_pos =
r.GetTo();
1547 void operator()(
float& dst,
const float& src,
floatfraction,
boollong_seg)
1549dst += src * fraction;
1569TR rasterizer(rc_vp.Left(), rc_vp.Right(), rc_vis.
Left(), rc_vis.
Right());
1572 for( ; it; ++it ) {
1576rasterizer.AddInterval(
r.GetFrom(),
r.GetToOpen(), 1.0, f_sum);
1580 TVPUnitvp_top_y = rc_vp.Top();
1583 constTR::TRaster& raster = rasterizer.GetRaster();
1587gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1591 intoff_x = rc_vp.Left();
1592 static const floateps = 0.001f;
1599 if(!row_range.
Empty()) {
1601 TVPUnity_c = floor((
float(vp_top_y + vp_bottom_y) / 2) + 0.5);
1606gl.
Begin(GL_LINES);
1608 glLined(row_start + off_x, y_c, row_stop + off_x, y_c);
1613 for(
size_t i= 0;
i< raster.size(); ) {
1615 floatv = raster[
i];
1616 while(
i< raster.size() && raster[
i] == v) {
1624 doublealpha = 0.25 + v * 0.75;
1627gl.
Rectd(start + off_x, vp_top_y,
i+ off_x, vp_bottom_y);
1686gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1688 TVPUnitvp_top_y = rc_vp.Top();
1692 intrange_from = (
int) (floor(rc_vis.
Left()));
1694CScoreCache::TScoreColl::const_iterator it = ScoreColl.
begin();
1695 constCScoreCache::TScoreColl::const_iterator it_end = ScoreColl.
end();
1696it = ScoreColl.
find(it, it_end, range_from);
1748 static const floateps = 0.00001f;
1775CScoreCache::TScoreColl::const_iterator it,
1776 constCScoreCache::TScoreColl::const_iterator it_end,
1777 intvp_top_y,
intvp_bottom_y)
1787 static const floateps = 0.001f;
1794 while(it_seg && it != it_end && it->GetFrom() <= rc_vis.
Right()) {
1798 intfrom = std::max<int>(
r.GetFrom(), it->GetFrom());
1799 intto = std::min<int>(
r.GetTo(), it->GetTo());
1802 SScPix2pix = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
false};
1803 boolempty_seg = (from < row_start || to > row_stop);
1813rasterizer.AddInterval(from, to + 1, pix, f_sum);
1814}
else if(!empty_seg && ((to - from) + 1) > 0) {
1818rasterizer.AddInterval(from, to + 1, pix, f_sum);
1822 if(to ==
r.GetTo())
1824 if(to == (
int) it->GetTo())
1830 constTR::TRaster& raster = rasterizer.GetRaster();
1832 intshift_x = rc_vp.
Left();
1833 floatvalue_scale = value_limits.
GetTo() - value_limits.
GetFrom();
1834 if(value_scale <= 0)
1836 TVPUnity_c = floor((
float(vp_top_y + vp_bottom_y ) / 2) + 0.5);
1838 for(
size_t i= 0;
i< raster.size(); ) {
1839 autox1 =
i+ shift_x;
1840 const SScPix2& sc_pix = raster[
i];
1841 while(
i< raster.size() && raster[
i] == sc_pix) {
1844 autox2 =
i+ shift_x;
1849 static const CRgbaColorkAmbiguousResidueColor(
"darkgrey");
1850 color= kAmbiguousResidueColor;
1856sc =
min(1.0, max<double>(0., ((sc - value_limits.
GetFrom()) / value_scale)));
1858 floatalpha = 1.0f - sc * 0.75f;
1863gl.
Rectd(x1, vp_top_y, x2, vp_bottom_y);
1864}
else if(sc_pix.
m_GapLen> eps) {
1871gl.
Rectd(x1, y_c - 1, x2, y_c + 1);
1884CScoreCache::TScoreColl::const_iterator it,
1885 constCScoreCache::TScoreColl::const_iterator it_end,
1886 intvp_top_y,
intvp_bottom_y)
1899 SScPixpix = { 0.0f, 0.0f,
false};
1901 while(it_seg && it != it_end && it->GetFrom() <= rc_vis.
Right()) {
1905 intfrom = std::max<int>(
r.GetFrom(), it->GetFrom());
1906 intto = std::min<int>(
r.GetTo(), it->GetTo());
1909 boolempty_seg = (from < row_start || to > row_stop);
1918 if(to ==
r.GetTo()) {
1921 if(to == (
int) it->GetTo()) {
1928 constTR::TRaster& raster = rasterizer.GetRaster();
1930 TVPUnity_c = floor((
float(vp_top_y + vp_bottom_y ) / 2) + 0.5);
1931 static floateps = 0.0001f;
1933 intshift_x = rc_vp.
Left();
1934 for(
size_t i= 0;
i< raster.size(); ) {
1936 const SScPix& sc_pix = raster[
i];
1937 while(++
i< raster.size() && raster[
i] == sc_pix) ;
1944 if(sc_pix.
m_Gap) {
1945gl.
Rectd(start + shift_x, y_c - 1 ,
i+ shift_x, y_c + 1);
1947gl.
Rectd(start + shift_x, vp_top_y,
i+ shift_x, vp_bottom_y + 1);
1957 #define SEQ_OFF_VERT 0 1958 #define SEQ_OFF_HORZ 0 1968 returnmin_w >= scale_x;
1969}
else return false;
1973 bool IfDash(
charch) {
returnch ==
'-'; }
1978 intstart,
intstop)
1981unique_ptr<IAlnSegmentIterator> p_it(
1994off_y = floor(off_y/2. + 0.5);
2002 boolrender_scores =
false;
2005render_scores = method &&
2024stop = aln_r.GetTo();
2028 autosStart = seq_r.
GetFrom();
2029 autosStop = seq_r.GetTo();
2032 if(base_width == 3) {
2033frame_shift_f = sStart % base_width;
2034frame_shift_t = 2 - sStop % base_width;
2043 if(base_width == 3) {
2049vector<CRgbaColor*>
colors;
2050 if(render_scores) {
2053CScoreCache::TScoreColl::const_iterator it = ScoreColl.
begin();
2054 constCScoreCache::TScoreColl::const_iterator it_end = ScoreColl.
end();
2055it = ScoreColl.
find(it, it_end, start);
2057 int len= stop - start + 1;
2061std::fill_n(
colors.begin(),
len, &default_color);
2063 for(; it != it_end; ++it) {
2070std::fill_n(
colors.begin() + (from - start), to - from + 1, &cl);
2078 boolhas_consensus =
false;
2083(consensus.length() == seq.length())) {
2084has_consensus =
true;
2088 boolhas_colors = (
colors.size() == seq.length());
2091 stringtext_char(
" ");
2092 TModelUnitcenter_y = (top_y + bottom_y) * 0.5 + 0.5;
2094 doublebase_h = double(base_width)/2.;
2099 for(
size_t i= 0;
i< seq.size(); ++
i) {
2100current_color = has_colors ? *
colors[
i] : default_color;
2101 if(has_consensus && seq[
i] !=
'X'&& consensus[
i] == seq[
i]) {
2105render_dot = dot_texture.
NotEmpty();
2108gl.
Enable(GL_TEXTURE_2D);
2112 doublew = dot_texture->GetImage()->GetWidth();
2113dot_texture->MakeCurrent();
2125current_color.
Lighten(0.65f);
2126gl.
ColorC(current_color);
2128gl.
Begin(GL_LINES);
2135gl.
ColorC(current_color);
2136text_char[0] = seq[
i];
2138gl.
WriteText(x - off_x, y, text_char.c_str());
2176 intbase_height = 0;
2183 autoheight =
abs(rc_vp.
Height()) - 1;
2185 autooffset_top = (rc_vp.
Top() - row_top);
2186 autotop = rc_vp.
Top();
2187 if(offset_top >= 0) {
2188top -= (offset_top + base_height);
2215 doublemodel_top =
abs(offset_top);
2216 doublemodel_bottom = model_top + rc_vp.
Height();
2218rc_vis.
SetVert(model_bottom, model_top);
2224 returnmodel_height > 0;
2283 if(!
GetGl().IsPrinterFriendly()) {
2347 inty_top = rc_vp.Top() - h;
2363 for(
int i= 0;
i< 3;
i++ ) {
2364 if(vp_pt.
X() >= left && vp_pt.
X() < left +
kButtonSize) {
2395gl.
Rectd(rc_vp.Left(), rc_vp.Bottom(), rc_vp.Right(), rc_vp.Top());
2403 inthalf = rc_btn.
Height() / 2;
2404 intx1 = rc_btn.
Left();
2405 intx2 = rc_btn.
Right();
2415gl.
Begin(GL_TRIANGLES);
2436gl.
Begin(GL_LINES);
2483 inthalf = rc_btn.
Height() / 2;
2484 intx1 = rc_btn.
Left();
2485 intx2 = rc_btn.
Right();
2493gl.
Begin(GL_TRIANGLES);
2525gl.
Begin(GL_LINES);
2549 const char*s_marker =
"";
2552 if(seq_pos == -1) {
2561 label.append(s_marker);
2590gl.
Rectd(rc_vp.Left(), rc_vp.Bottom(), rc_vp.Right(), rc_vp.Top());
2617gl.
Begin(GL_LINES);
2618gl.
Vertex2d(rc_vp.Right(), rc_vp.Top());
2619gl.
Vertex2d(rc_vp.Right(), rc_vp.Bottom());
2620gl.
Vertex2d(rc_vp.Left(), rc_vp.Bottom());
2621gl.
Vertex2d(rc_vp.Right(), rc_vp.Bottom());
2649 m_RenderingCtx->SetOverviewCutoff(gConfig->GetOverviewCutoff());
2707}
catch(exception& e) {
2794 intaln_pos = (
int) floor(rc_vis.
Left());
2799 intaln_pos = -1 + (
int) ceil(rc_vis.
Right());
2855pos = (pos / 3) * 3;
2871 if( alstart < alstop ){
2872alrange.
Set( alstart, alstop);
2874alrange.
Set( alstop, alstart);
2895 if(!aln_r.Empty()) {
2896aligned += seq_r.GetLength();
2897 if(aln_r.GetFrom() == prev_aln_to + 1 && seq_r.GetFrom() > prev_seq_to + 1) {
2898unaligned += seq_r.GetFrom() - prev_seq_to;
2901indel += seq_r.GetLength();
2903prev_aln_to = aln_r.GetTo();
2904prev_seq_to = seq_r.GetTo();
2907gap += aln_r.GetLength();
2910indel += aln_r.GetLength();
2913unaligned += aln_r.GetLength();
2925start /= base_width;
2928 stringaln_str =
"Sequence is aligned from ";
2929aln_str += (is_aa) ?
"residues ":
"bases ";
2933tooltip.
AddRow(aln_str);
2935 stringbases = is_aa ?
"Residues":
"Bases";
2987track.
Reset(last_hit_track.GetPointer());
3040vr.SetHorz(
f,
t);
3059 if(max_height > 0) {
3080widget->PopupMenu(menu);
3090widget->PushEventHandler(
handler);
3099widget->PopEventHandler();
3140gConfig->SetDirty(
true);
3162 autobottom = top - (
m_Height- 1);
static IGlFont::EAlignMode s_GetColumnAlignemnt(int col_type)
double CompressLength(double len)
static string s_GetSourceSubtype(const CSeq_descr &descr, CSubSource::ESubtype subtype)
static string s_GetTitle(const CSeq_descr &descr)
static const int kTextOffsetY
static const int kAlignSpace
height of "white-space" between row borders and alignment band
static const int kSeqVertSpace
static const int kTextVertSpace
USING_SCOPE(ncbi::objects)
static const int kTooltipMaxLines
ON_EVENT(CGraphNotification, CGraphNotification::eContentChanged, &CAlnVecRow::x_OnGraphContentChanged) ON_EVENT(CGraphNotification
static const int kMaxSeqInTooltip
static const int kTextOffsetX
static const int kButtonSignSize
string FormatRange(TSignedSeqPos from, TSignedSeqPos to)
#define TOOLTIP_RANGE_PIX
static const int kGapOffset
vertical offset from the border of the alignment band to the border of gap band
static const TModelUnit kScoreMinScale
static void s_PrepareTrackPane(TModelUnit aln_from, TModelUnit aln_to, TModelUnit seq_from, TModelUnit seq_to, const IAlignRowHandle &row_handle, const CGlPane &source_pane, CGlPane &target_pane)
static const int kButtonSize
static const int kButtonOffset
static void FSetPixMaxCoverage(SScPix &dst, const SScPix &src, float fraction, bool long_seg)
a pixel with the Max coverage (fraction) overrides all attributes
void glLined(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2)
static string s_GetOrgModNatHost(const CSeq_descr &descr)
static const int kPosOffsetX
ncbi::TMaskedQueryRegions mask
virtual int GetRowState() const
Returns row state (combination of EState flags)
CAlnRowState()
CAlnRowState.
virtual void SetRowState(int mask, bool b_set)
Set/Clear Row State.
class CAlnVecRow - implementation of IAlignRow for CAlnVec-based alignments.
const CRowDisplayStyle * m_Style
const IAlignRowHandle & m_Handle
void x_ForEachAlnSeg(const IAlnExplorer::TSignedRange &range, const CGlPane &src_pane, CGlPane &target_pane, const function< bool(CGlPane &pane)> &f)
virtual int GetRowNum() const
Returns index of row in IAlnMultiDataSource.
void ConfigureTracks(bool reset=false)
virtual void x_RenderIconStrand()
virtual void x_RenderAlign()
Renders graphical part of the row.
TVPUnit m_PixLeft
Graphics caching.
void x_RenderTracks(CGlPane &pane, const TSignedRange &range)
virtual void UpdateOnStyleChanged()
virtual TSeqPos GetColumnAsSeqPos(TColumnType type, const TModelRect &rc_vis) const
virtual void x_RenderNonAveragableScores(CGlPane &pane, IAlnSegmentIterator &it_seg, TScoreConstIterator it, const TScoreConstIterator it_end, int vp_top_y, int vp_bottom_y)
virtual void GetHTMLActiveAreas(TColumnType col_type, CGlPane &pane, TAreaVector &areas)
virtual void x_OnClickExpandBtn(CGlPane &pane)
virtual TVPRect x_GetButtonRect(EButtons btn, int shift=1)
virtual void OnMouseEvent(wxMouseEvent &event, TColumnType col_type, CGlPane &pane)
void x_GetAlnPosLabel(TSeqPos aln_pos, IAlnExplorer::ESearchDirection dir, string &label) const
virtual void x_RenderAveragableScores(CGlPane &pane, IAlnSegmentIterator &it_seg, TScoreConstIterator it, const TScoreConstIterator it_end, int vp_top_y, int vp_bottom_y)
virtual void x_RenderGraph(const TSignedRange &range)
string x_GetTooltipSequence(TSeqPos from, TSeqPos to)
void GetTaxonomy(string &taxonomy) const
virtual void x_GetIconsTooltip(const TVPPoint &pt, CGlPane &pane, ITooltipFormatter &tooltip)
void x_GetAlignmentTooltip_Gap(const TSignedSeqRange &aln_r, const TSignedSeqRange &seq_r, ITooltipFormatter &tooltip)
virtual float GetColumnAsFloat(TColumnType type) const
virtual void x_UpdateRowHeight()
virtual bool x_CanRenderSeq(CGlPane &pane)
Checks if sequence can be drawn.
virtual void x_RenderIconExpand()
void x_GetAlignmentTooltip_Insert(const TSignedSeqRange &aln_r, const TSignedSeqRange &seq_r, ITooltipFormatter &tooltip)
virtual void UseExternalOrganismLookup(bool f)
virtual void x_RenderDescr()
virtual void LTH_ConfigureTracksDlg(const string &category)
CRef< CFeaturePanel > m_TrackPanel
void ConfigureTracksDialog(const string &category=NcbiEmptyString)
virtual void x_CreateTrackPanel(CGlPane &pane)
virtual void GetTooltip(const TVPPoint &vp_pt, TColumnType col_type, CGlPane &pane, ITooltipFormatter &tooltip)
returns tooltip text by point in the viewport coordinates
AutoPtr< CLayoutTrackHandler > m_TrackHandler
virtual void UpdateOnAnchorChanged()
virtual bool IsExpanded() const
CRef< CSeqGlyph > x_HitTest(const TVPPoint &vp_pt, CGlPane &pane, TModelPoint &hit_point)
bool m_NeedUpdateSelection
unique_ptr< CGlPane > m_TrackPane
virtual void LTH_PushEventHandler(wxEvtHandler *handler)
virtual string & GetColumnText(TColumnType col_type, string &text, bool for_printer=false) const
unique_ptr< CRenderingContext > m_RenderingCtx
virtual void GHH_Redraw()
redraws the Host and the handler
void x_GetAlignmentTooltip_Unaligned(TSignedSeqPos aln_prev_to, TSignedSeqPos aln_from, TSignedSeqPos prev_to, TSignedSeqPos from, ITooltipFormatter &tooltip)
virtual EButtons x_HitTestButton(CGlPane &pane, const TVPPoint &pt)
virtual void GHH_ReleaseMouse()
releases captured mouse
virtual int x_GetBaseHeight() const
virtual void GHH_CaptureMouse()
captures mouse events in the hosting window for D&D
virtual void x_RenderSequence(CGlPane &pane, TModelUnit top_y, TModelUnit bottom_y, int start, int stop)
virtual void GHH_SetCursor(const wxCursor &cursor)
changes the cursor in the hosting window
virtual void PrepareRendering(CGlPane &pane, TVPUnit row_top, int state)
virtual void Update(const CGlPane &pane, bool layout_only=false)
virtual void SetDisplayStyle(const CRowDisplayStyle *style)
virtual void LTH_OnLayoutChanged()
provides mouse coords in OpenGL viewport coord system
virtual bool IsExpandable() const
virtual void LTH_PopEventHandler()
virtual bool IsNucProtAlignment() const
virtual void SetHost(IAlignRowHost *host)
void x_OnGraphSizeChanged(CEvent *evt)
virtual void SetScoreCache(CScoreCache *cache)
virtual const IAlnRowGraphProperties * GetProperties() const
virtual void x_GetDescrTooltip(const TVPPoint &pt, CGlPane &pane, ITooltipFormatter &tooltip)
virtual string & GetAlnSeqString(string &buffer, const IAlnExplorer::TSignedRange &aln_rng) const
CWeakRef< CLayoutTrack > m_LastHitTrack
virtual void x_RenderAlignSegments(CGlPane &pane, IAlnSegmentIterator &it_seg, TModelUnit top_y, TModelUnit bottom_y, const CRgbaColor &color)
virtual void x_RenderIcons()
virtual void x_GetAlignmentTooltip(const TVPPoint &pt, CGlPane &pane, ITooltipFormatter &tooltip)
virtual void x_RenderAlnPos(TSeqPos aln_pos, IAlnExplorer::ESearchDirection dir)
virtual TModelPoint THH_GetModelByWindow(const wxPoint &pt)
virtual string GetAlignmentTooltip(TSeqPos pos, TSeqPos half_width)
IAlignRowHost * x_GetHost()
virtual void x_ResetTrackPanel()
virtual void x_RenderAlignScores(IAlnSegmentIterator &it_seg, int top_y, int bottom_y, bool averageable)
void x_OnGraphContentChanged(CEvent *evt)
virtual void x_RenderInserts(CGlPane &pane, int from, int to, TModelUnit top_y, TModelUnit bottom_y)
virtual bool UsesAATranslation() const
virtual void x_RenderTextCell(const string &text, IGlFont::TAlign align)
bool x_InitTrackPane(const CGlPane &row_pane, CGlPane &track_pane)
IAlnExplorer::TSignedRange TSignedRange
virtual void SetProperties(IAlnRowGraphProperties *props)
virtual void RenderColumn(TColumnType col_type)
Renders a row cell corresponding to column specified by "col_type".
void x_GetAlignmentTooltip_Helper(TSeqPos pos, TSignedRange &range, ITooltipFormatter &tooltip)
virtual void x_RenderEmptyBox()
size_t GetTrackCount(CGlPane &pane)
CAlnVecRow(const IAlignRowHandle &handle)
CAlnVecRow.
virtual void LTH_PopupMenu(wxMenu *menu)
show track-specific context menu.
void x_GetAlignmentTooltip_General(TSeqPos pos, ITooltipFormatter &tooltip)
virtual string & GetStringAtPos(string &buffer, TSignedSeqPos aln_pos) const
virtual void x_RenderUnaligned(CGlPane &pane, int from, int to, TModelUnit top_y, TModelUnit bottom_y)
CConsensusRow * m_ConsensusRow
CScoreCache * m_Cache
row display style
unique_ptr< CRenderingContext > m_SequenceRenderingCtx
virtual const CRowDisplayStyle * GetDisplayStyle()
virtual void GetRowStatistics(ITooltipFormatter &tooltip) const
virtual void Expand(bool b_exp, CGlPane &pane)
virtual CRef< CLayoutTrack > THH_GetLayoutTrack()
Get the layout track under the current mouse position.
virtual int GetHeightPixels() const
Returns height of the row in pixels.
const COrgName & GetOrgname(void) const
bool IsSetOrgname(void) const
const IAlignRowHandle & GetHandle() const
virtual string & GetAlnSeqString(string &buffer, const IAlnExplorer::TSignedRange &aln_rng) const
CEvent - generic event implementation TODO TODO - Attachments.
void SetInputObject(SConstScopedObject &obj)
void SetConfigKey(const string &config_key)
virtual void Update(bool layout_only)
Update content and layout including the bounding box.
virtual CRef< CSeqGlyph > HitTest(const TModelPoint &p)
Hit testing.
void LoadDefaultTracks()
Reset tracks to the original default track list.
void ShowConfigureTracksDlg(const string &category)
void SetTrackConfig(const TTrackSettingsSet &settings_set)
void SetDSContext(ISGDataSourceContext *ds_ctx)
CGlAttrGuard - guard class for restoring OpenGL attributes.
const CLayoutGroup & GetGroup() const
void SaveSettings(const string &curr_color, const string &curr_size) const
size_t GetChildrenNum() const
Get total number of children.
CLayoutTrackHandler - is the handler for handling the user interactions on layout tracks.
void Render(CGlPane &pane)
void SetHost(ITrackHandlerHost *host)
CLayoutTrackHandler inline methods.
virtual void SetPane(CGlPane *pane)
void SetConfig(CRef< CSeqGraphicConfig > conf)
void SetProfile(const string &preset_style)
CLayoutTrack inline method implmentation.
void SetHost(ILayoutTrackHost *host)
void GetLabel(string *label) const
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
@ fSkipGrid
track frame will be rendered when triggered.
@ fSkipTitleBar
can be collpased and expanded.
@ fSkipControls
track frame will be rendered when triggered.
class CRgbaColor provides a simple abstraction for managing colors.
CRowDisplayStyle is a base class representing a display style for IAlignRow.
CRef< CSeqGraphicConfig > GetSeqGraphicConfig() const
CRef< CGlTexture > GetDotTexture() const
virtual const CRgbaColor & GetColor(TColorType type) const
int GetShownElements() const
const string & GetTrackConfigKey() const
virtual bool GetShowIdenticalBases(void) const
const CTrackConfigManager::TTrackProxies & GetTrackSettings() const
bool IsWebRendering() const
virtual const CGlTextureFont & GetTextFont(void) const
virtual const CGlTextureFont & GetSeqFont(void) const
static const string & DefTrackProfile()
static bool IsBackgroundJob()
bool HasScores() const
returns "true" if CalculateScores() did produce results
const TScoreColl & GetScores(TNumrow row) const
IScoringMethod::TScore TScore
IScoringMethod * GetScoringMethod()
const CRgbaColor & GetColorForScore(TScore score, IScoringMethod::EColorType type) const
class CSelectionVisitor is a concrete glyph visitor for selection traversal and deselection traversal...
void UpdateSelection(CSeqGlyph *glyph)
void ResetObjectSelection(CSeqGlyph *glyph)
void SelectObject(const CObject *obj, bool verified)
bool IsObjectSelected(const CObject *obj)
void DeSelectObject(const CObject *obj)
bool HasSelectedObjects() const
virtual void SetHeight(TModelUnit h)
virtual bool IsClickable() const
Query if this glyph is clickable.
virtual void GetTooltip(const TModelPoint &, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
virtual bool OnLeftUp(const TModelPoint &)
virtual bool OnLeftDblClick(const TModelPoint &)
virtual TModelUnit GetHeight() const
virtual bool OnLeftDown(const TModelPoint &)
void Draw() const
render the layout.
CRef< CHistParamsManager > GetHistParamsManager() const
Get histogram config manager.
void SetTrackProfile(const string &profile)
@Seq_descr.hpp User-defined methods of the data storage class.
CTempTrackProxy::TTrackProxies TTrackProxies
bool IsTrackInitDone() const
FSetPix2(bool sequence_level)
void operator()(SScPix2 &dst, const SScPix2 &src, float fraction, bool long_seg)
accumulate weighted scores
IAlignRowHandle provides an abstract way to access alignment row data.
virtual bool UsesAATranslation() const =0
virtual int GetMismatches() const
virtual TSignedSeqPos GetSeqStart() const =0
virtual void GetHost(string &value) const
virtual bool CanGetBioseqHandle() const =0
virtual bool IsAnchor() const
virtual const string & GetOrgLabel(bool fExtOrgLookup=false) const
virtual TSignedSeqPos GetSeqAlnStart() const =0
virtual const objects::CBioseq_Handle & GetBioseqHandle() const =0
virtual void GetCountry(string &value) const
virtual double GetPctCoverage() const
virtual bool IsNucProtAlignment() const =0
virtual double GetPctIdentity() const
virtual size_t GetBaseWidth() const =0
virtual IAlnExplorer::TSignedRange GetSeqAlnRange() const =0
virtual TSeqPos GetSeqLength() const
virtual TSignedSeqPos GetSeqPosFromAlnPos(TSeqPos aln_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
virtual TNumrow GetRowNum() const =0
virtual string & GetAlnSeqString(string &buffer, const IAlnExplorer::TSignedRange &aln_rng) const =0
virtual TSignedSeqPos GetSeqAlnStop() const =0
virtual TSignedSeqPos GetSeqStop() const =0
virtual void GetCollectionDate(string &value) const
virtual string & GetSeqString(string &buffer, const IAlnExplorer::TRange &seq_rng) const =0
virtual void GetIsolationSource(string &value) const
virtual bool IsNegativeStrand() const =0
virtual void GetTaxonomy(string &taxonomy, bool fExtOrgLookup=false) const
virtual TSignedSeqPos GetAlnPosFromSeqPos(TSeqPos seq_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
virtual IAlnSegmentIterator * CreateSegmentIterator(const IAlnExplorer::TSignedRange &range, IAlnSegmentIterator::EFlags flags) const =0
virtual void GetGeneSymbol(string &value) const
virtual const string & GetText() const =0
IAlignRowHost represents a context in which IAlignRow lives.
virtual void ARH_OnSelectionChanged()=0
notifies a host about selection change
virtual CSelectionVisitor * ARH_GetSelectionVisitor()=0
notifies a host about selection change
virtual int ARH_GetRowTop(IAlignRow *p_row)=0
Returns Y-pos for row.
virtual TVPPoint ARH_GetVPPosByWindowPos(const wxPoint &pos)=0
provides mouse coords in OpenGL viewport coord system
virtual void ARH_OnRowChanged(IAlignRow *row)=0
notifies a host about changes the row
@ fWidgetFocused
it isn'e exactly a row state;
vector< CHTMLActiveArea > TAreaVector
@ ePctIdentity
% identity to consensus or anchor
@ eIconStrand
Icon for Positive/Negative (Mixed?) strand.
@ eIconExpand
Icon for expand (+) button.
@ eIcons
Strand + Expand icons.
@ ePctCoverage
% coverage to anchor
@ eMismatches
% number of mismatches to anchor/consensus
ESearchDirection
Position search options.
@ eRight
Towards higher aln coord (always to the right)
@ eLeft
Towards lower aln coord (always to the left)
Alignment segment iterator interface.
@ eSkipInserts
Iterate segments where at least some rows are aligned (including gap segments)
@ eInsertsOnly
Iterate only ranges not participating in the alignment (unaligned segments)
@ 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 ...
@ fGap
Both anchor row and the selected row are not included in the segment (some other row is present and t...
virtual TSegTypeFlags GetType(void) const =0
Get current segment type.
bool IsAligned(void) const
virtual const TSignedRange & GetAlnRange(void) const =0
Get alignment range for the segment.
static const int kAmbiguousResidueScore
virtual void GHH_ReleaseMouse()=0
releases captured mouse
virtual void GHH_Redraw()=0
redraws the Host and the handler
virtual void GHH_CaptureMouse()=0
captures mouse events in the hosting window for D&D
virtual void GHH_SetCursor(const wxCursor &cursor)=0
changes the cursor in the hosting window
virtual CConstRef< CObject > GetObject(TSeqPos pos) const =0
access our core component - we wrap an object(s) of some sort.
IScoringMethod represents an abstract algorithm for calculating alignment scores and assigning colors...
virtual int GetSupportedColorTypes() const =0
returns a combination of EColorType flags
virtual bool IsAverageable() const =0
return "true" if scores could be averaged
static const Colors colors
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)
Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...
unsigned int TSeqPos
Type for sequence locations and lengths.
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 NCBI_ASSERT(expr, mess)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
CGlRect & IntersectWith(const CGlRect &r)
void SetModelLimitsRect(const TModelRect &R)
virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)=0
void SetViewport(const TVPRect &R)
virtual void Enable(GLenum glstate)=0
EAlignMode
alignment modes
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.
virtual void BeginClippingRect(GLint x, GLint y, GLsizei width, GLsizei height)=0
TModelUnit UnProjectWidth(TVPUnit vp_w) const
TModelPoint UnProject(TVPUnit m_x, TVPUnit m_y) const
void Color3d(GLdouble r, GLdouble g, GLdouble b)
IRender & GetGl()
convenience function for getting current render manager
void Vertex2d(GLdouble x, GLdouble y)
TVPRect & GetViewport(void)
virtual void BeginText(const CGlTextureFont *font, const CRgbaColor &color)=0
Text is drawn is pixel coordinates.
virtual TModelUnit GetFontDescender() const
static string FormatSeparatedNumber(int number, bool b_postfix=false)
virtual void EndText()=0
Pops matrices and attributes after writing text.
const TVPRect * GetClipRect() const
returns clipping rect or NULL (if there is no clipping)
TModelUnit UnProjectX(TVPUnit m_x) const
CGlPoint< T > CenterPoint() const
TModelRect & GetModelLimitsRect(void)
virtual void EndClippingRect()=0
bool PtInRect(T x, T y) const
virtual bool IsPrinterFriendly() const =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 SetVert(T bottom, T top)
void SetVisibleRect(const TModelRect &R)
virtual TModelUnit GetMetric(EMetric metric, const char *text=NULL, int len=-1) const
virtual void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0)=0
Write text at specified model coords.
virtual TModelUnit TextWidth(const char *text) const
Compute and return font metrics.
virtual TModelUnit TextHeight(void) const
TModelRect & GetVisibleRect(void)
void Vertex2f(GLfloat x, GLfloat y)
virtual void Disable(GLenum glstate)=0
glDisable()
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
TModelUnit GetScaleX(void) const
TModelUnit GetOffsetX() const
void SetExactOrthoProjection(bool exact_projection)
void SetHorz(T left, T right)
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)
void EnableOffset(bool b_en=true)
Offset is used as a workaround for OpenGL precision problems emerging when size of visible range is s...
virtual void GetViewport(GLint *params)=0
virtual void AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
const_iterator end() const
void Lighten(float scale)
static CIRef< ITooltipFormatter > CreateTooltipFormatter()
static CRgbaColor Interpolate(const CRgbaColor &color1, const CRgbaColor &color2, float alpha)
Interpolate two colors.
#define END_EVENT_MAP()
Ends definition of Command Map.
const_iterator find(position_type pos) const
#define BEGIN_EVENT_MAP(thisClass, baseClass)
Begins definition of Command Map for CEventHandler-derived class.
virtual void Append(const ITooltipFormatter &tooltip)=0
appends another formatter to this one
const_iterator begin() const
string GetProteinName(const CBioseq_Handle &seq)
Return protein name from corresponding Prot-ref feature.
const COrg_ref & GetOrg_ref(const CBioseq_Handle &handle)
Return the org-ref associated with a given sequence.
TSeqPos GetBioseqLength(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
const TDescr & GetDescr(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
bool CanGetDescr(void) const
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
TRefType Lock(void) const
Lock the object and return reference to it.
void Reset(void)
Reset the containing pointer to null.
position_type GetLength(void) const
TThisType & IntersectWith(const TThisType &r)
TThisType IntersectionWith(const TThisType &r) const
position_type GetToOpen(void) const
TThisType & Set(position_type from, position_type to)
CRange< TSignedSeqPos > TSignedSeqRange
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
@ fWithCommas
Use commas as thousands separator.
static const char label[]
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
@ eSubtype_collection_date
DD-MMM-YYYY format.
@ eSubtype_isolation_source
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 TMod & GetMod(void) const
Get the Mod member data.
bool CanGetMod(void) const
Check if it is safe to call GetMod method.
@ eSubtype_nat_host
natural host of this specimen
const Tdata & Get(void) const
Get the member data.
unsigned int
A callback function used to compare two keys in a database.
if(yy_accept[yy_current_state])
static void text(MDB_val *v)
Defines: CTimeFormat - storage class for time format.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
void operator()(float &dst, const float &src, float fraction, bool long_seg)
~SRenderingContextGuard()
SRenderingContextGuard(const function< void()> &f)
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
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