: m_SignalStyle(eCurve),
53m_ConfGraphState(eExpanded),
54m_SignalGraphState(eExpanded),
55m_bReverseColors(
true)
75: m_DataProxy(handle, b_neg_strand),
78m_TextColor(0.6f, 0.6f, 0.6f)
176 floatv = 1.0f - k * j;
185}
else return false;
234 CGlAttrGuardAttrGuard(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_HINT_BIT
235| GL_LINE_SMOOTH | GL_POLYGON_MODE | GL_LINE_BIT);
251unique_ptr<IAlnSegmentIterator> it_1(it.
Clone());
258gl.
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
260gl.
Enable(GL_LINE_SMOOTH);
261glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
264unique_ptr<IAlnSegmentIterator> it_3(it.
Clone());
274unique_ptr<IAlnSegmentIterator> it_4(it.
Clone());
286unique_ptr<IAlnSegmentIterator> it_2(it.
Clone());
405gl.
Rectd(x1, y1, x2, y2);
406gl.
Rectd(x1, y3, x2, y4);
413 const static float kEps= 0.000001f;
445 boolb_average = (scale_x > 0.3);
458gl.
Begin(GL_LINES);
460 boolit_seg_moved =
true;
467 doublev = 0, v_min = 0, v_max = 0;
471 for(
intpix = range_pix_start;
472pix <= range_pix_end && it_seg && pos <= gr_to; ) {
473 boolb_first =
true;
487to =
min(ch_range.
GetTo(), gr_to);
492 if(vis_to < vis_from) {
494 swap(vis_from, vis_to);
496from =
max(from, vis_from);
497to =
min(to, vis_to);
508it_seg_moved =
false;
513pos_pix_left = range_pix_start + (aln_pos - left) / scale_x;
514pos_pix_right = pos_pix_left + 1 / scale_x;
520 while(pos >= from && pos <= to && pos_pix_left < pix + 1) {
524v_min = b_first ? v :
min(v_min, v);
525v_max = b_first ? v :
max(v_max, v);
528 if(pos_pix_right < pix +1) {
531pos_pix_left = range_pix_start + (aln_pos - left) / scale_x;
532pos_pix_right = pos_pix_left + 1 / scale_x;
536 if(ch_pix_end < pix + 1) {
538it_seg_moved =
true;
541gl.
Color3d(0.0f, 0.5f, 0.0f);
545gl.
Color3d(0.0f, 0.75f, 0.25f);
551v = v_min = v_max = 0;
559gl.
Color3d(0.0f, 0.5f, 0.0f);
561 for( ; it_seg; ++it_seg ) {
575 doublex = aln_pos - offset_x;
576gl.
Rectd(x , base_y, x + 1.0, base_y + v);
597 for(
inti_ch = 0; i_ch < 4; i_ch++ ) {
611unique_ptr<IAlnSegmentIterator> p_it_1(it.
Clone());
613 if(it_1->IsAligned()) {
629 intbottom_y,
int,
intamp)
648 if(vis_to < vis_from) {
650 swap(vis_from, vis_to);
653from =
max(from, vis_from);
654to =
min(to, vis_to);
659sm_start =
max(0, sm_start);
662 if(sm_start <= sm_end) {
663gl.
Begin(GL_QUAD_STRIP);
668 if(sm_start_seqpos < from) {
669 if(sm_start + 1 < sm_end) {
670 doublev1 = values[sm_start];
671 double v2= values[sm_start + 1];
672 doublex1 = sm_start_seqpos;
673 doublex2 = positions[sm_start + 1];
674 doublev = v1 + ((from - x1) * (
v2- v1) / (x2 - x1));
678gl.
Vertex2d(aln_from - offset_x, bottom_y - v);
684 for(
inti_sm = sm_start; i_sm < sm_end; i_sm++ ) {
686 doublev = values[i_sm];
690gl.
Vertex2d(aln_pos - offset_x, bottom_y - v);
694 if( sm_end - 1 > sm_start) {
695 doublev1 = values[sm_end -1];
696 double v2= values[sm_end];
697 doublex1 = positions[sm_end - 1];
698 doublex2 = positions[sm_end];
699 doublev = v1 + ((to + 1 - x1) * (
v2- v1) / (x2 - x1));
703gl.
Vertex2d(aln_to - offset_x, bottom_y - v);
707 doublev = values[sm_end];
711gl.
Vertex2d(aln_pos - offset_x, bottom_y - v);
735 intband_h = av_h / 4;
736 intoff = (av_h - 4 * band_h) / 2;
747gl.
Begin(GL_LINES);
750 for(
intpix = range_pix_start; pix <= range_pix_end && it_seg; ++it_seg) {
764 if(vis_to < vis_from) {
766 swap(vis_from, vis_to);
769from =
max(from, vis_from);
770to =
min(to, vis_to);
775sm_start =
max(sm_start, 0);
782 swap(aln_from, aln_to);
786 TVPUnitpix_start = range_pix_start + (
TVPUnit) floor((aln_from - left) / scale_x);
787 TVPUnitpix_end = range_pix_start + (
TVPUnit) ceil((aln_to - left) / scale_x);
788pix_start =
max(pix_start, range_pix_start);
789pix_end =
min(pix_end, range_pix_end);
794 for(
inti_ch = 0; i_ch < 4; i_ch++ ) {
802 doublex1 = 0.0, x2 = 0.0, pix_x1 = 0.0, pix_x2 = 0.0;
803 doublev1,
v2, s, dx, sum, sum_pix_x;
808 for(
TVPUnitpix = pix_start; pix <= pix_end; pix++ ) {
814x1 = positions[sample];
818v1 =
v2= values[sample];
820 if(pix_x1 < pix + 1) {
822 boolb_next_point =
m_Data->
IsNegative() ? (sample > sm_start) : (sample < sm_end);
824x2 = positions[sample + sm_inc];
828 v2= values[sample + sm_inc];
832v1 += (
v2- v1) * (pix - pix_x1) / (pix_x2 - pix_x1);
837 while(b_next_point && pix_x2 <= pix + 1)
839dx = pix_x2 - pix_x1;
840s = 0.5 * (v1 +
v2) * dx;
850b_next_point =
m_Data->
IsNegative() ? (sample > sm_start) : (sample < sm_end);
852x2 = positions[sample + sm_inc];
856 v2= values[sample + sm_inc];
861 if(b_next_point && pix_x2 > pix + 1) {
862dx = pix + 1 - pix_x1;
865 doublev = v1 + (
v2- v1) * dx / (pix_x2 - pix_x1);
866s = 0.5 * (v1 + v) * dx;
873 doubleav_v = (sum_pix_x) > 0 ? sum / sum_pix_x : 0;
876 doublenorm = (MaxSignal == 0) ? 0 : (av_v / MaxSignal);
880gl.
Vertex2d(pix, band_y - band_h - 1);
895 _ASSERT(signal >= 0 && signal <= 3);
909 if(pos < m_Data->GetSeqFrom() || n_samples == 0) {
919 i=
min(
i, n_samples - 1);
922 if(positions[
i] > pos) {
923 for( ;
i> 0 && positions[
i] > pos;
i-- ) {
926 for( ; ++
i< n_samples && positions[
i] < pos; ) {
941 if(pos < m_Data->GetSeqFrom() || n_samples == 0) {
951 i=
min(
i, n_samples - 1);
954 if(positions[
i] > pos) {
955 for( ;
i> 0 && positions[
i] > pos;
i-- ) {
959 for( ; ++
i< n_samples && positions[
i] < pos; ) {
CGlAttrGuard - guard class for restoring OpenGL attributes.
class CRgbaColor provides a simple abstraction for managing colors.
TSignedSeqPos GetSeqFrom() const
Sequence related information.
TConfidence GetConfidence(TSignedSeqPos pos) const
TSignalValue GetMax(EChannel signal) const
int GetSamplesCount() const
TValues & GetValues(EChannel signal)
TConfidence GetMaxConfidence() const
TSignedSeqPos GetSeqTo() const
TPositions & GetPositions()
vector< TFloatSeqPos > TPositions
vector< TSignalValue > TValues
TSignedSeqPos GetSeqLength() const
EGraphState m_ConfGraphState
ESingnalStyle m_SignalStyle
EGraphState m_SignalGraphState
CTraceGraphProperties & operator=(const CTraceGraphProperties &orig)
void x_RenderIntensityGraphs(CGlPane &pane, int y, int h, IAlnSegmentIterator &it)
Render signals for all channels as gradient-color bands with color intensity proprotional to signal s...
void x_RenderText(CGlPane &pane)
void x_RenderSignalGraph(CGlPane &pane, int y, int h, IAlnSegmentIterator &it)
vector< CRgbaColor > m_vSignalColors
CTraceGraph(const objects::CBioseq_Handle &handle, bool b_neg_strand)
CTraceDataProxy m_DataProxy
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...
virtual void Render(CGlPane &pane)
void x_RenderContour(CGlPane &pane, int y, int conf_h, int total_h, IAlnSegmentIterator &it)
void SetSignalGraphState(EGraphState state)
void x_RenderCurveSegment(CGlPane &pane, const IAlnSegment &seg, const CTraceData::TPositions &positions, const CTraceData::TValues &values, int bottom_y, int h, int amp)
void SetConfGraphState(EGraphState state)
virtual bool IsCreated() const
Graph is not considered fully functional until it has been "created" by the call to create function.
void x_RenderConfGraph(CGlPane &pane, int y, int h, IAlnSegmentIterator &it)
int x_GetConfGraphH() const
virtual bool NeedTooltip(CGlPane &pane, int vp_x, int vp_y)
const CRgbaColor & GetColorByValue(double value, int signal) const
int x_GetSignalGraphH() const
virtual string GetTooltip()
virtual const IAlnRowGraphProperties * GetProperties() const
virtual void SetProperties(IAlnRowGraphProperties *props)
int x_FindSampleToLeft(double pos) const
returns index of rightmost sample having m_SeqPos less then "pos".
CTraceGraphProperties m_Props
virtual TVPPoint PreferredSize()
Alignment segment iterator interface.
virtual IAlnSegmentIterator * Clone(void) const =0
Create a copy of the iterator.
Alignment segment interface.
virtual const TSignedRange & GetRange(void) const =0
Get the selected row range.
bool IsAligned(void) const
virtual const TSignedRange & GetAlnRange(void) const =0
Get alignment range for the segment.
Include a standard set of the NCBI C++ Toolkit most basic headers.
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)
virtual void Enable(GLenum glstate)=0
virtual void Begin(GLenum mode)=0
Start rendering.
CGlPoint< TVPUnit > TVPPoint
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)
TModelUnit GetOffsetY() const
bool PtInRect(T x, T y) const
virtual void End()=0
Finish rendering (create buffer and send to renderer)
void Inflate(T d_x, T d_y)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
EProjectionMode GetProjMode(void) const
virtual void TextOut(const char *text) const
TextOut interface Write the specified text and set up state and transformation as needed.
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)
position_type GetLength(void) const
TThisType & IntersectWith(const TThisType &r)
bool NotEmpty(void) const
CRange< TSignedSeqPos > TSignedSeqRange
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
unsigned int
A callback function used to compare two keys in a database.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
const GenericPointer< typename T::ValueType > T2 value
const TSignedSeqRange * m_AlnRange
double GetSeqPosFromAlnPos(double aln_pos)
double GetAlnPosFromSeqPos(double seq_pos)
const TSignedSeqRange * m_SeqRange
void Init(const TSignedSeqRange &seq_range, const TSignedSeqRange &aln_range, bool negative)
TSignedSeqPos GetAlnPosFromSeqPos(TSignedSeqPos seq_pos)
TSignedSeqPos GetSeqPosFromAlnPos(TSignedSeqPos aln_pos)
static const int kSignalGraphPrefH
static const int kGradColors
CTraceGraph.
static const int kGraphOffsetY
static const int kTextOff
static const int kIntBandSpace
static const int kCollapsedGraphH
static const int kConfGraphPrefH
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