, m_ShowTitle(
false)
98 for(
intch = 0; ch < 4; ++ch) {
155tt.
AddRow(
"DNA Sequencing Chromatograms");
182 CGlAttrGuardAttrGuard(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_HINT_BIT
183| GL_LINE_SMOOTH | GL_POLYGON_MODE | GL_LINE_BIT);
190 inttop_y = m_ModelRect.
Top();
200gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
201gl.
Enable(GL_LINE_SMOOTH);
202glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
260gl.
Rectd(x1, y1, x2, y2);
261gl.
Rectd(x1, y3, x2, y4);
292 boolb_average = (scale_x > 0.5);
312 doublev = 0, v_min = 0, v_max = 0;
316 if(vis_from > vis_to) {
318 swap(vis_from, vis_to);
334gl.
Begin(GL_LINES);
335 for(
intpix = range_pix_start; pix <= range_pix_end;) {
337 if(pos < gr_from || pos > gr_to)
340 boolb_first =
true;
342pos_pix_left = range_pix_start + (left - pos) / scale_x;
344pos_pix_left = range_pix_start + (pos - left) / scale_x;
346pos_pix_right = pos_pix_left + 1 / scale_x;
352 while(pos_pix_left < pix + 1) {
353 if(pos < from || pos > to)
361v_min =
min(v_min, v);
362v_max =
max(v_max, v);
365 if(pos_pix_right >= pix + 1)
369pos_pix_left = range_pix_start + (left - pos) / scale_x;
371pos_pix_left = range_pix_start + (pos - left) / scale_x;
373pos_pix_right = pos_pix_left + 1 / scale_x;
386v = v_min = v_max = 0;
404from = max<TSignedSeqPos>(gr_from, from);
405to = min<TSignedSeqPos>(gr_to, to);
411 doublex = aln_pos - offset_x;
412gl.
Rectd(x, base_y, x + 1.0, base_y + v);
428 for(
inti_ch = 0; i_ch < 4; i_ch++) {
456 intbottom_y,
int,
intamp)
const 468 doublevis_from = rc_vis.
Left();
469 doublevis_to = rc_vis.
Right();
470 if(vis_to < vis_from) {
472 swap(vis_from, vis_to);
475from =
max(from, vis_from);
476to =
min(to, vis_to);
481sm_start =
max(0, sm_start);
484 if(sm_start <= sm_end) {
485gl.
Begin(GL_TRIANGLE_STRIP);
490 if(sm_start_seqpos < from) {
491 if(sm_start + 1 < sm_end) {
492 doublev1 = values[sm_start];
493 double v2= values[sm_start + 1];
494 doublex1 = sm_start_seqpos;
495 doublex2 = positions[sm_start + 1];
496 doublev = v1 + ((from - x1) * (
v2- v1) / (x2 - x1));
499 doublealn_from = from + (b_neg ? -1 : 0);
500gl.
Vertex2d(aln_from - offset_x, bottom_y - v);
506 for(
inti_sm = sm_start; i_sm < sm_end; i_sm++) {
508 doublev = values[i_sm];
511 doublealn_pos = seqpos + (b_neg ? -1 : 0);
512gl.
Vertex2d(aln_pos - offset_x, bottom_y - v);
516 if(sm_end - 1 > sm_start) {
517 doublev1 = values[sm_end - 1];
518 double v2= values[sm_end];
519 doublex1 = positions[sm_end - 1];
520 doublex2 = positions[sm_end];
521 doublev = v1 + ((to + 1 - x1) * (
v2- v1) / (x2 - x1));
524 doublealn_to = to + (b_neg ? 0 : 1);
525gl.
Vertex2d(aln_to - offset_x, bottom_y - v);
529 doublev = values[sm_end];
532 doublealn_pos = seqpos;
533gl.
Vertex2d(aln_pos - offset_x, bottom_y - v);
556 intband_h = av_h / 4;
557 intoff = (av_h - 4 * band_h) / 2;
566gl.
Begin(GL_LINES);
570 doublevis_from = rc_vis.
Left();
571 doublevis_to = rc_vis.
Right();
572 if(vis_to < vis_from) {
574 swap(vis_from, vis_to);
584sm_start =
max(sm_start, 0);
588 doublealn_from = from;
593 TVPUnitpix_start = range_pix_start + (aln_from - floor(vis_from)) / scale_x;;
594 TVPUnitpix_end = range_pix_start + (
TVPUnit)ceil((aln_to - floor(vis_from)) / scale_x);
596pix_start =
max(pix_start, range_pix_start);
597pix_end =
min(pix_end, range_pix_end);
602 for(
inti_ch = 0; i_ch < 4; i_ch++) {
610 doublex1 = 0.0, x2 = 0.0, pix_x1 = 0.0, pix_x2 = 0.0;
611 doublev1,
v2, s, dx, sum, sum_pix_x;
616 for(
TVPUnitpix = pix_start; pix <= pix_end; pix++) {
622x1 = positions[sample];
623pix_x1 = range_pix_start;
626pix_x1 += dist / scale_x;
628v1 =
v2= values[sample];
630 if(pix_x1 < pix + 1) {
634x2 = positions[sample + sm_inc];
635pix_x2 = range_pix_start;
638pix_x2 += dist / scale_x;
640 v2= values[sample + sm_inc];
644v1 += (
v2- v1) * (pix - pix_x1) / (pix_x2 - pix_x1);
649 while(b_next_point && pix_x2 <= pix + 1)
651dx = pix_x2 - pix_x1;
652s = 0.5 * (v1 +
v2) * dx;
665x2 = positions[sample + sm_inc];
666pix_x2 = range_pix_start;
669pix_x2 += dist / scale_x;
670 v2= values[sample + sm_inc];
674 if(b_next_point && pix_x2 > pix + 1) {
675dx = pix + 1 - pix_x1;
678 doublev = v1 + (
v2- v1) * dx / (pix_x2 - pix_x1);
679s = 0.5 * (v1 + v) * dx;
686 doubleav_v = (sum_pix_x) > 0 ? sum / sum_pix_x : 0;
689 doublenorm = (MaxSignal == 0) ? 0 : (av_v / MaxSignal);
693gl.
Vertex2d(pix, band_y + band_h - 1);
707 _ASSERT(signal >= 0 && signal <= 3);
724 if(pos < m_Data->GetSeqFrom() || n_samples == 0) {
734 i=
min(
i, n_samples - 1);
737 if(positions[
i] > pos) {
738 for(;
i> 0 && positions[
i] > pos;
i--) {
741 for(; ++
i< n_samples && positions[
i] < pos;) {
756 if(pos < m_Data->GetSeqFrom() || n_samples == 0) {
766 i=
min(
i, n_samples - 1);
769 if(positions[
i] > pos) {
770 for(;
i> 0 && positions[
i] > pos;
i--) {
774 for(; ++
i< n_samples && positions[
i] < pos;) {
CGlAttrGuard - guard class for restoring OpenGL attributes.
CGlPane * GetGlPane()
inline method implementations
const TModelRange & GetVisibleRange() const
bool IsFlippedStrand() const
class CRgbaColor provides a simple abstraction for managing colors.
TValues & GetValues(EChannel signal)
int GetSamplesCount() const
vector< TSignalValue > TValues
vector< TFloatSeqPos > TPositions
TConfidence GetMaxConfidence() const
TSignedSeqPos GetSeqTo() const
TSignedSeqPos GetSeqFrom() const
Sequence related information.
TPositions & GetPositions()
TSignalValue GetMax(EChannel signal) const
TConfidence GetConfidence(TSignedSeqPos pos) const
TSignedSeqPos GetSeqLength() const
CRenderingContext * m_Context
the rendering context
virtual void SetHeight(TModelUnit h)
virtual void SetWidth(TModelUnit w)
virtual void SetLeft(TModelUnit l)
virtual TModelUnit GetHeight() const
TModelRect GetModelRect() const
get the bounding box.
vector< CHTMLActiveArea > TAreaVector
int x_GetConfGraphH() const
virtual bool OnLeftDblClick(const TModelPoint &)
vector< CRgbaColor > m_vSignalColors
void x_RenderConfGraph(CGlPane &pane, int y, int h) const
void x_RenderSignalGraph(CGlPane &pane, int y, int h) const
int x_FindSampleToLeft(double pos) const
returns index of rightmost sample having m_SeqPos less then "pos".
CTraceGlyph(const CRef< CSGTraceData > &data, const CRef< CTraceGraphConfig > &config)
virtual bool IsClickable() const
Query if this glyph is clickable.
CRef< CTraceGraphConfig > m_Config
void x_InitColors() const
virtual void GetTooltip(const TModelPoint &, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
CRef< CSGTraceData > m_Data
void x_RenderCurveSegment(CGlPane &pane, const CSGTraceData::TPositions &positions, const CSGTraceData::TValues &values, int bottom_y, int, int amp) const
const CRgbaColor & GetColorByValue(double value, int signal) const
void x_RenderIntensityGraphs(CGlPane &pane, int y, int h) const
Render signals for all channels as gradient-color bands with color intensity proprotional to signal s...
int x_FindSampleToRight(double pos) const
returns index of the leftmost sample having m_SeqPos greater than "pos" if "pos" is to the left of th...
void x_RenderContour(CGlPane &pane, int y, int top_h, int total_h) 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.
int x_GetSignalGraphH() const
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
ESingnalStyle m_SignalStyle
CRgbaColor m_colorConfMax
EGraphState m_ConfGraphState
EGraphState m_SignalGraphState
array< CRgbaColor, 4 > m_colors
CRgbaColor m_colorConfMin
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)
void SetViewport(const TVPRect &R)
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 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 End()=0
Finish rendering (create buffer and send to renderer)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
EProjectionMode GetProjMode(void) const
TModelRect & GetVisibleRect(void)
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
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 AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
static void RgbToHsv(const CRgbaColor &rgb, float &h, float &s, float &v)
convert RGB to HSV.
static CRgbaColor HsvToRgb(float h, float s, float v)
position_type GetLength(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
TFrom GetFrom(void) const
Get the From member data.
unsigned int
A callback function used to compare two keys in a database.
const GenericPointer< typename T::ValueType > T2 value
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static const double kSignalGraphPrefHR
CRgbaColor s_GradientToWhite(const CRgbaColor &rgb, float degree)
static const int kGradColors
static const double kConfGraphPrefHR
static const int kGraphOffsetY
static const int kCollapsedGraphH
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