104 if (
r0.GetFrom() <
r1.GetFrom()) {
107 if (
r0.GetFrom() >
r1.GetFrom()) {
110 if (
r0.GetTo() <
r1.GetTo()) {
150 , m_Location(&
f.GetLocation())
152 , m_ProjectedFeat(
false)
154 , m_RulerType(eNoRuler)
155 , m_LinkedFeat(LinkedFeatDisplay)
165 , m_ProjectedFeat(
false)
167 , m_RulerType(eNoRuler)
168 , m_LinkedFeat(LinkedFeatDisplay)
182 return (comp(*
this, *feat));
205 CreateObjectInterface<IGuiObjectInfo>(scoped_obj,
NULL));
207 if ( !gui_info )
return;
226 if ((
int)at_p != -1) {
229 int aligned = aln_mgr->GetQuery();
231 if (aln_mgr->GetBaseWidth(anchor) == 3) {
232 pos *= aln_mgr->GetBaseWidth(anchor);
233 int fract_part = (p.
X() - floor(p.
X())) * 100.;
234 int off =
min(2, fract_part / 33);
235 at_p = aln_mgr->GetSeqPosFromSeqPos(aligned, anchor, pos);
236 if (aln_mgr->IsNegativeStrand(aligned))
241 at_p = aln_mgr->GetSeqPosFromSeqPos(aligned, anchor, pos);
250 auto& prod_range = mi.m_MappedProdRange;
252 mapping_info.emplace_back(prod_int, mi.m_MappedInt);
261 if (
ctx &&
ctx->GetSeqDS()) {
271 bool isTooltipGeneratedBySvc(
false);
272 gui_info->GetToolTip(tt, t_title, at_p, &isTooltipGeneratedBySvc);
273 if(!isTooltipGeneratedBySvc) {
274 gui_info->GetLinks(tt,
false);
322 string sColorTheme(
"Color");
324 string sColorKey(
"Default");
328 sColorKey =
"SingleBase";
331 sColorKey =
"MultiBase";
334 sColorKey =
"Insertion";
337 sColorKey =
"Deletion";
345 if(sColorKey !=
"Default") {
357 if (idx > 0 && idx <
colors.size()) {
404 if (
tag.NotEmpty()) {
415 if (
tag.NotEmpty()) {
425 if (
tag.NotEmpty()) {
460 if ( (*iter)->GetType().IsStr() &&
461 (*iter)->GetType().GetStr() ==
"Editing" &&
462 (*iter)->GetFieldRef(
"Editable") &&
463 (*iter)->GetFieldRef(
"Editable")->GetData().GetBool() &&
469 if((*iter)->GetFieldRef(
"Ignorable") &&
470 (*iter)->GetFieldRef(
"Ignorable")->GetData().GetBool()) {
483 tooltip->SetTrustedData(
false);
485 s = tooltip->Render();
489 p_areas->push_back(area);
594 "CFeatGlyph::GetSignature() failed to generate signature: " <<
661 #ifdef DEBUG_INFO_ON_SCREEN
678 sAdditionalInfo.clear();
692 if ((*iter)->IsSetSeq() && (*iter)->GetSeq().IsLiteral()) {
693 len = (*iter)->GetSeq().GetLiteral().GetLength();
731 }
else if (var.
IsGain()) {
735 }
else if (var.
IsCNV()) {
744 if ( !var_type.empty() ) {
758 if ( !identity.empty() ) {
761 if (identity_num > 99.0) {
763 }
else if (identity_num > 98.0) {
765 }
else if (identity_num > 90.0) {
800 return isRelatedGlyphSelected;
816 if(pParentLayoutGroup) {
819 for(
size_t iSeqGlyphs=0; iSeqGlyphs < pParentLayoutGroup->
GetChildrenNum(); ++iSeqGlyphs) {
820 if(pParentLayoutGroup->
GetChild(
static_cast<int>(iSeqGlyphs))->IsSelected()) {
843 if(pParentLayoutGroup) {
846 for(
size_t iSeqGlyphs=0; iSeqGlyphs < pParentLayoutGroup->
GetChildrenNum(); ++iSeqGlyphs) {
847 if(pParentLayoutGroup->
GetChild(
static_cast<int>(iSeqGlyphs))->IsSelected()) {
921 base += bar_height * 0.5;
943 x_IntersectVisible<TModelUnit>(
TModelRange(model_rect.
Left(), model_rect.
Right()), left, right);
968 prod_len = prod_vec.
size();
976 gen_seq.reserve(prod_len);
982 auto& prod_int = *iter.first;
983 auto& gen_int = *iter.second;
985 TSeqPos t_from = prod_int.GetFrom();
986 if (t_from > pre_t_to)
987 gen_seq.append(t_from - pre_t_to,
'N');
989 vec.
GetSeqData(gen_int.GetFrom(), gen_int.GetTo() + 1, tmp_seq);
990 bool neg = gen_int.IsSetStrand() && gen_int.GetStrand() ==
eNa_strand_minus;
994 0,
static_cast<TSeqPos>(tmp_seq.length()), seq);
997 pre_t_to = prod_int.GetTo() + 1;
1021 auto& prod_int = *map_it.first;
1022 auto& gen_int = *map_it.second;
1024 bool neg = gen_int.IsSetStrand() && gen_int.GetStrand() ==
eNa_strand_minus;
1025 int step = neg ? -1 : 1;
1026 TSeqRange gen_range(gen_int.GetFrom(), gen_int.GetTo());
1028 while (current_exon !=
m_Intervals.end() && current_exon->GetFrom() > gen_range.
GetTo()) {
1033 while (current_exon !=
m_Intervals.end() && current_exon->GetTo() < gen_range.
GetFrom()) {
1047 TSeqRange prod_range(prod_int.GetFrom(), prod_int.GetTo());
1052 while (prod_pos < prod_stop) {
1053 bool mismatch = (prod_seq[prod_pos] != gen_seq[prod_pos]);
1055 prod_out[0] = prod_seq[prod_pos];
1061 if (prev_gen != 0) {
1063 if (prev_prod->GetTo() + 1 != prod_int.GetFrom()) {
1064 c_pos = neg ? gen_int.GetTo() + 1 : gen_int.GetFrom();
1069 if (prev_gen->GetFrom() - 1 != gen_int.GetTo()) {
1070 c_pos = prev_gen->GetFrom() - 1;
1074 if (prev_gen->GetTo() + 1 != gen_int.GetFrom()) {
1075 c_pos = prev_gen->GetTo() + 1;
1086 prev_gen.
Reset(&gen_int);
1087 prev_prod.
Reset(&prod_int);
1147 if (visible_range_pos.
GetLength() < min_text_w_pos) {
1155 string sAdditionalInfo;
1157 if (!sAdditionalInfo.empty()) {
1212 int all_same_type = -1;
1215 while (parent !=
NULL) {
1216 if (all_same_type == -1 ) {
1219 all_same_type =
lg->AllChildrenSameType() ? 1 : 0;
1225 string track_title =
lt->GetFullTitle();
1226 size_t start_idx =
label.find_first_not_of(
" ()[]'\" <>,.@#$&*");
1227 size_t stop_idx =
label.find_last_not_of(
" ()[]'\" <>,.@#$&*");
1228 size_t len = stop_idx-start_idx;
1240 return (all_same_type == 1 &&
redundant);
1285 string sLabelTextOut;
1287 string sLabelTypeText;
1293 if (visible_range.
GetLength() > LabelTypeWidth * 4) {
1298 label += sLabelTextOut;
1299 sLabelTextOut =
label;
1313 base += font_height;
1324 m_Context->
TextOut(&font, sLabelTextOut.c_str(), LabelX, LabelY,
true,
true);
1338 if (exon_int.
Empty())
1352 bool side_lbl{
false };
1357 LabelVisibleWidth = (FeatureBarLeft < visible_range.
GetFrom() ? 0 : FeatureBarLeft - visible_range.
GetFrom());
1360 LabelVisibleWidth = (FeatureBarRight > visible_range.
GetTo() ? 0 : visible_range.
GetTo() - FeatureBarRight);
1399 (FeatureBarLeft < visible_range_pos.
GetFrom() ? 0 : FeatureBarLeft - visible_range_pos.
GetFrom())
1401 (FeatureBarRight > visible_range_pos.
GetToOpen() ? 0 : visible_range_pos.
GetToOpen() - FeatureBarRight));
1413 if (AvailableLabelVisibleWidthPos < m_Context->GetMinLabelWidthPos(font)) {
1421 if (label_width_px > max_width_px) {
1422 label_width_px = max_width_px;
1423 fl_content = font.
Truncate(fl_content.c_str(), label_width_px);
1424 if ((string::npos != fl_content.find(
"...")) && (fl_content.length() <= 5))
1433 label_base += (font_height * 0.5);
1438 label_clear_base = label_base;
1439 if (bar_height > font_height) {
1440 label_clear_height = bar_height;
1441 label_clear_base = floor(base) + (label_clear_height * 0.5);
1444 label_x_pos = visible_range_pos.
GetFrom();
1445 if (label_x_pos >
GetLeft()) {
1448 TModelRect(label_x_pos, label_clear_base + 1, label_x_pos + label_width_pos,
1449 label_clear_base - label_clear_height - 1), 0);
1452 label_x_pos = visible_range_pos.
GetToOpen() - label_width_pos;
1457 label_clear_base - label_clear_height - 1), 0);
1464 label_base,
false,
true);
1489 (FeatureBarLeft < visible_range.
GetFrom() ? 0 : FeatureBarLeft - visible_range.
GetFrom())
1491 (FeatureBarRight > visible_range.
GetToOpen() ? 0 : visible_range.
GetToOpen() - FeatureBarRight));
1493 string sAdditionalInfo;
1501 if(AvailableAdditionalInfoVisibleWidthPos < m_Context->GetMinLabelWidthPos()) {
1507 if (info_width_px > max_width_px) {
1508 info_width_px = max_width_px;
1509 sAdditionalInfo = font.
Truncate(sAdditionalInfo.c_str(), info_width_px);
1518 info_base += (font_height * 0.5);
1524 info_clear_base = info_base;
1525 if (bar_height > font_height) {
1526 info_clear_height = bar_height;
1527 info_clear_base = floor(base) + (info_clear_height * 0.5);
1530 info_x_pos = visible_range.
GetFrom();
1535 TModelRect(info_x_pos, info_clear_base + 1, info_x_pos + info_width_pos,
1536 info_clear_base - info_clear_height - 1), 0);
1539 info_x_pos = visible_range.
GetToOpen() - info_width_pos;
1545 info_clear_base - info_clear_height - 1), 0);
1553 info_base,
false,
true);
1591 if (loc_it || loc_it.
IsEmpty()) {
1606 bool has_product =
GetFeature().IsSetProduct();
1627 int display_options = 0;
1629 auto GetCDSFrame = [&]() {
1632 if (
m_Feature.GetData().GetCdregion().IsSetFrame() &&
m_Feature.GetData().GetCdregion().GetFrame() > 1) {
1633 return m_Feature.GetData().GetCdregion().GetFrame() - 1;
1648 id1->SetBaseWidth(1);
1649 id2->SetBaseWidth(1);
1651 if (protein_scale) {
1675 if (loc_it || loc_it.
IsEmpty()) {
1705 id1->SetBaseWidth(1);
1719 r.SetFirstFrom(seq_length -
r.GetFirstToOpen());
1720 r.SetReversed( !
r.IsReversed() );
1721 aln_reversed->push_back(
r);
1723 aln_reversed->Sort();
1724 aln.
Reset(aln_reversed.GetPointer());
1739 vpt.
SetTop((
int)floor(base_top));
1759 return (
TVPUnit)((x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5));
1780 int display_options = 0;
1791 int aligned_seq = aln_mgr->GetQuery();
1793 TSeqPos seq_length = aln_mgr->GetSeqLength(aligned_seq);
1794 int base_width = aln_mgr->GetBaseWidth(anchor);
1797 id1->SetBaseWidth(1);
1798 id2->SetBaseWidth(1);
1800 if (protein_scale) {
1815 glPushAttrib(GL_ALL_ATTRIB_BITS);
1824 bool anchor_neg = aln_mgr->IsNegativeStrand(anchor);
1825 bool aligned_neg = aln_mgr->IsNegativeStrand(aligned_seq);
1830 auto& anchor_range = iter->m_AnchorRange;
1833 auto& gen_int = *iter->m_MappedInt;
1836 auto& prod_int = *iter->m_ProductInt;
1837 auto& prod_range = iter->m_MappedProdRange;
1839 bool flip = (flip_strand != (anchor_neg || aligned_neg));
1843 prod_interval->SetId().Assign(prod_int.GetId());
1844 prod_interval->SetFrom(prod_range.GetFrom());
1845 prod_interval->SetTo(prod_range.GetTo());
1846 prod_interval->SetStrand(prod_int.GetStrand());
1851 mapped_interval->SetId().Assign(gen_int.GetId());
1852 mapped_interval->SetFrom(gen_from);
1853 mapped_interval->SetTo(gen_to);
1854 mapped_interval->SetStrand(gen_int.GetStrand());
1867 r1->SetFirstFrom(seq_length -
r.GetFirstToOpen());
1868 r1->SetReversed(!
r.IsReversed());
1873 TModelUnit seq_from = anchor_range.GetFrom();
1874 TModelUnit seq_to = min<int>(anchor_range.GetTo(), seq_from + (prod_range.GetLength() / base_width) - 1);
1877 swap(seq_from, seq_to);
1892 rcV.
SetHorz(gen_from, gen_to + 1);
1904 vpt.
SetTop((
int)floor(base_top));
1939 TModelUnit BoundaryYLow = YCenterLine - bar_height * 0.5f;
1940 TModelUnit BoundaryYHigh = YCenterLine + bar_height * 0.5f;
1959 if (!display_settings.
Empty()) {
1966 color.SetAlpha(0.8f);
1979 x_IntersectVisible<TSeqPos>(SeqRange, from, to);
1982 if (SeqRange.
GetLength() > pix_size * 2) {
1986 bool first_pass =
true;
1990 vector<TModelRange> labels_range;
1996 bool has_accessory_label =
false;
2009 strand_indicator_color =
color.ContrastingColor(
false);
2011 strand_indicator_color.
Darken(0.1f);
2015 vector<CConstRef<CSeq_loc>> locs;
2017 for (; iter; ++iter) {
2022 return a->GetTotalRange().GetFrom() < b->GetTotalRange().GetFrom();
2026 for (
const auto& curr_loc : locs) {
2027 TSeqRange curr = curr_loc->GetTotalRange();
2036 bool is_visible_region = x_IntersectVisible<TModelUnit>(
TModelRange(
f,
t),
f,
t);
2038 bool rsiteCutPnt =
false;
2040 if (curr_loc->IsPnt()) {
2055 bool fit = head_size * 1.5 <
fabs(
t -
f);
2056 bool adj_to = !neg_strand &&
t == SeqRange.
GetTo() && fit;
2057 bool adj_from = neg_strand &&
f == SeqRange.
GetFrom() && fit;
2059 if (adj_from || adj_to) {
2067 t = to - head_size * 1.5;
2070 f = from + head_size * 1.5;
2078 f = from + head_size;
2087 fit = tail_size <
fabs(
t -
f);
2088 adj_to = neg_strand &&
t == SeqRange.
GetTo() && fit;
2089 adj_from = !neg_strand &&
f == SeqRange.
GetFrom() && fit;
2091 if (adj_from || adj_to) {
2098 f = from + tail_size * 0.5f;
2101 t = to - tail_size * 0.5f;
2106 f = from + tail_size;
2114 f = from + tail_size;
2135 intron_f = prev_to_x;
2153 intron_f = prev_from_x;
2155 if (intron_f > intron_t)
2156 swap(intron_f, intron_t);
2159 x_IntersectVisible<TModelUnit>(
TModelRange(intron_f, intron_t), intron_f, intron_t);
2161 if (intron_f < intron_t) {
2162 glPushAttrib(GL_LINE_BIT);
2166 gl.
Enable(GL_LINE_STIPPLE);
2170 gl.
Enable(GL_LINE_STIPPLE);
2174 gl.
Enable(GL_LINE_STIPPLE);
2178 gl.
Enable(GL_LINE_STIPPLE);
2191 intron_f + (intron_t - intron_f) * 0.5f;
2212 BoundaryYHigh, color_lite);
2222 intron_t - intron_f, apart, bar_height,
2240 if (!rsiteCutPnt && is_visible_region) {
2279 gl.
Enable(GL_LINE_SMOOTH);
2283 if (prev_exon_rng.
Empty())
2284 prev_exon_rng = exon_rng;
2293 strand_rng = prev_exon_rng;
2294 prev_exon_rng = exon_rng;
2301 string accessory_label;
2309 if (!accessory_label.empty()) {
2316 if (
r.Right() >
r.Left()) {
2317 clipped_from =
std::max(
r.Left(), clipped_from);
2318 clipped_to =
std::min(
r.Right(), clipped_to);
2321 clipped_to =
std::min(
r.Left(), clipped_to);
2322 clipped_from =
std::max(
r.Right(), clipped_from);
2325 if (clipped_to-clipped_from >
TModelUnit(1.5) * label_width) {
2326 has_accessory_label =
true;
2331 if (first_pass && has_accessory_label) {
2333 auto len = (clipped_to - clipped_from) - 1;
2334 const static int kLabelStep = 600;
2336 if (
len >= label_step * 2) {
2337 has_accessory_label =
false;
2339 auto l = rng.
Left();
2343 auto from = max<int>(clipped_from,
l);
2346 auto x = max<int>(from - label_width /
TModelUnit(2), 0);
2347 if (x >=
r || x >= (clipped_to - label_width))
2349 m_Context->
TextOut(&font, accessory_label.c_str(), x, YCenterLine,
false,
true);
2350 labels_range.emplace_back(x, x + label_width);
2355 if (is_visible_region) {
2360 strand_indicator_color, neg_strand,
2362 !
m_HideLabel, has_accessory_label, &labels_range);
2363 strand_rng.
Set(0, 0);
2366 if (has_accessory_label) {
2368 m_Context->
TextOut(&font, accessory_label.c_str(), from, YCenterLine,
false,
true);
2374 if (p_start || p_stop) {
2376 curr.
GetToOpen(), BoundaryYHigh, p_start, p_stop,
true);
2381 prev_from_x =
m_RSite ? from_x : from_x - 1;
2386 if ((neg_strand && from == SeqRange.
GetFrom()) || (!neg_strand && to == SeqRange.
GetTo())) {
2394 TModelPoint(neg_strand ? from : to + 1, YCenterLine),
2395 head_height,
color, neg_strand,
true);
2399 TModelPoint(neg_strand ? from : to + 1, YCenterLine),
2400 head_height,
color, neg_strand,
false);
2405 TModelPoint(neg_strand ? from : to + 1, YCenterLine),
2406 head_height, neg_strand);
2416 if ((neg_strand && to == SeqRange.
GetTo()) || (!neg_strand && from == SeqRange.
GetFrom())) {
2423 TModelPoint(neg_strand ? to + 1.0 : from, YCenterLine),
2424 tail_height,
color, neg_strand);
2428 TModelPoint(neg_strand ? to + 1 : from, YCenterLine),
2429 tail_height,
color, neg_strand);
2434 neg_strand ? to + 1 : from, BoundaryYLow, BoundaryYHigh,
2435 tail_height,
color, neg_strand);
2448 bool draw_partial_start = (from == SeqRange.
GetFrom());
2449 bool draw_partial_stop = (to == SeqRange.
GetTo());
2451 BoundaryYHigh, draw_partial_start, draw_partial_stop,
false);
2455 if (p_start || p_stop) {
2456 if (neg_strand)
swap(p_start, p_stop);
2458 BoundaryYHigh, p_start, p_stop,
true);
2464 if (!prev_exon_rng.
Empty()) {
2470 strand_indicator_color, neg_strand,
2472 !
m_HideLabel, has_accessory_label, &labels_range);
2491 m_Context->
DrawLine(SeqPosTriangleMidPointX, BoundaryYLow, SeqPosTriangleMidPointX, BoundaryYHigh);
2493 SeqPosTriangleMidPointX + SeqTriangleHalf, BoundaryYLow - TriangleOffsetY,
2494 SeqPosTriangleMidPointX - SeqTriangleHalf, BoundaryYLow - TriangleOffsetY);
2496 SeqPosTriangleMidPointX + SeqTriangleHalf, BoundaryYHigh + TriangleOffsetY,
2497 SeqPosTriangleMidPointX - SeqTriangleHalf, BoundaryYHigh + TriangleOffsetY);
2509 SeqPosTriangleMidPointX + SeqTriangleHalf, BoundaryYLow - TriangleOffsetY,
2510 SeqPosTriangleMidPointX - SeqTriangleHalf, BoundaryYLow - TriangleOffsetY);
2524 TModelUnit BoundaryYLow = YCenterLine - bar_height * 0.5f;
2525 TModelUnit BoundaryYHigh = YCenterLine + bar_height * 0.5f;
2539 x_IntersectVisible<TSeqPos>(SeqRange, SeqPosFrom, SeqPosTo);
2549 bool first_pass =
true;
2552 SeqRange = iter.GetRange();
2553 SeqPosFrom = SeqRange.
GetFrom();
2554 SeqPosTo = SeqRange.
GetTo();
2555 TSeqPos SeqPosFromIn = SeqPosFrom;
2556 TSeqPos SeqPosToIn = SeqPosTo;
2565 SeqPosFrom = f_SeqRange.
GetMin();
2566 SeqPosFromIn = f_SeqRange.
GetMax();
2572 SeqPosTo = t_SeqRange.
GetMax();
2573 SeqPosToIn = t_SeqRange.
GetMin();
2578 if ( !first_pass ) {
2582 TModelUnit intron_f = SeqPosFrom > prev_to_x ? prev_to_x + 1 : SeqPosTo + 1;
2583 TModelUnit intron_t = SeqPosFrom > prev_to_x ? SeqPosFrom : prev_from_x;
2594 if (literal_len >= (
int)(SeqPosToIn - SeqPosFromIn)) {
2595 literal_len = SeqPosToIn - SeqPosFromIn - 2;
2597 TModelUnit xm = (SeqPosFromIn + SeqPosToIn) * 0.5;
2598 TModelUnit m = (SeqPosFromIn + SeqPosToIn - literal_len) * 0.5;
2599 TModelUnit n = (SeqPosFromIn + SeqPosToIn + literal_len) * 0.5;
2606 if (literal_len < half_w * 2.0) {
2607 half_w = literal_len * 0.5;
2610 vector<TModelPoint> points;
2612 points.push_back(
TModelPoint(xm - half_w, YCenterLine));
2613 points.push_back(
TModelPoint(xm - half_w * 0.5, BoundaryYLow - 1.0));
2614 points.push_back(
TModelPoint(xm + half_w * 0.5, BoundaryYHigh + 1.0));
2615 points.push_back(
TModelPoint(xm + half_w, YCenterLine));
2624 m_Context->
DrawQuad(SeqPosFromIn, BoundaryYLow, SeqPosToIn + 1.0, BoundaryYHigh);
2629 x_DrawInsertion((SeqPosFromIn + SeqPosToIn) * 0.5 + 0.5, BoundaryYLow, BoundaryYHigh, YCenterLine);
2633 m_Context->
DrawQuad(SeqPosFromIn, BoundaryYLow, SeqPosToIn + 1.0, BoundaryYHigh);
2638 x_DrawInsertion(SeqPosToIn + 1.0, BoundaryYLow, BoundaryYHigh, YCenterLine);
2641 }
else if (UndefinedBreakpointFrom ==
eBp_Outer || UndefinedBreakpointFrom ==
eBp_Outer) {
2643 m_Context->
DrawQuad(SeqPosFromIn, BoundaryYLow, SeqPosToIn + 1.0, BoundaryYHigh);
2649 if (SeqPosFromIn != SeqPosFrom) {
2653 if (SeqPosToIn != SeqPosTo) {
2663 if (UndefinedBreakpointFrom ==
eBp_Outer) {
2665 SeqPosFromIn - tri_width, BoundaryYLow,
true);
2666 }
else if (UndefinedBreakpointFrom ==
eBp_Inner) {
2667 m_Context->
DrawTriangle(SeqPosFromIn - TriangleOffsetX, BoundaryYLow, SeqPosFromIn - TriangleOffsetX, BoundaryYHigh,
2668 SeqPosFromIn - TriangleOffsetX - tri_width, YCenterLine,
true);
2672 if (UndefinedBreakpointTo ==
eBp_Outer) {
2674 SeqPosToIn + 1.0 + tri_width, BoundaryYLow,
true);
2675 }
else if (UndefinedBreakpointTo ==
eBp_Inner) {
2676 m_Context->
DrawTriangle(SeqPosToIn + TriangleOffsetX + 1.0, BoundaryYLow, SeqPosToIn + TriangleOffsetX + 1.0, BoundaryYHigh,
2677 SeqPosToIn + TriangleOffsetX + 1.0 + tri_width, YCenterLine,
true);
2681 prev_to_x = SeqPosTo;
2682 prev_from_x = SeqPosFrom;
2696 m_Context->
DrawQuad(x1, YCenterLine - bar_height, SeqPosTo + 1.0, YCenterLine + bar_height);
2700 x1, YCenterLine - bar_height, SeqPosTo + 1.0, YCenterLine + bar_height,
color,
true);
2708 SeqPosTo, BoundaryYHigh,
color,
true);
2720 TModelUnit markerHeight = BoundaryYHigh - BoundaryYLow;
2732 for ( ; iter; ++iter) {
2734 if (!curr_loc->
IsPnt())
2748 m_Context->
DrawTriangle(pos, BoundaryYHigh, pos + halfMarkerWidth, BoundaryYHigh + markerHeight, pos - halfMarkerWidth, BoundaryYHigh + markerHeight,
true);
2750 m_Context->
DrawTriangle(pos, BoundaryYLow, pos + halfMarkerWidth, BoundaryYLow - markerHeight, pos - halfMarkerWidth, BoundaryYLow - markerHeight,
true);
2777 }
else if (loc.
IsInt() &&
2786 }
else if (loc.
IsMix()) {
2814 }
else if (loc.
IsInt() &&
2823 }
else if (loc.
IsMix()) {
2864 if (label_width > available_width) {
2866 if ((string::npos != fl_content.find(
"...")) && (fl_content.length() <= 5))
2899 feat_id = &feat.
GetId();
2901 feat_id = feat.
GetIds().front().GetPointer();
2905 switch(feat_id->
Which()) {
2937 static string sColorFieldNames[]{
"color",
"colour",
"itemRgb",
"reserved"};
2938 string sUsedColorFieldName;
2940 for(
auto sCheckColorFieldName: sColorFieldNames) {
2941 if(display_settings.HasField(sCheckColorFieldName,
".",
NStr::eNocase)) {
2942 sUsedColorFieldName = sCheckColorFieldName;
2947 if (sUsedColorFieldName.empty())
2952 Int8 ColorAsInt(display_settings.GetField(sUsedColorFieldName,
".",
NStr::eNocase).GetInt8());
2953 c.
Set((
unsigned char)((ColorAsInt >> 16) & 0xFF), (
unsigned char)((ColorAsInt >> 8) & 0xFF), (
unsigned char)(ColorAsInt & 0xFF));
2964 LOG_POST(
Error <<
"Invalid color found in Exts.DisplaySettings.color" << err);
2985 auto&
id =
front().m_MappedInt->GetId();
2995 for (
auto&& map_it : *
this) {
2996 auto& gen_int = *map_it.m_MappedInt;
2997 auto& prod_range = map_it.m_MappedProdRange;
2998 auto& anchor_range = map_it.m_AnchorRange;
3001 int num2add = prod_range.GetFrom() - pre_to;
3003 buffer.append(num2add,
'N');
3004 else if (prev_anchor > 0 && pre_gen > 0) {
3006 prev_anchor - anchor_range.GetTo() : anchor_range.GetFrom() - prev_anchor;
3007 bool is_insert = d == 0;
3009 num2add = gen_neg ? pre_gen - gen_int.GetTo() : gen_int.GetFrom() - pre_gen;
3011 buffer.append(num2add,
'N');
3016 vec.
GetSeqData(gen_int.GetFrom(), gen_int.GetTo() + 1, tmp_seq);
3020 0,
static_cast<TSeqPos>(tmp_seq.length()), seq);
3023 pre_to = prod_range.GetTo() + 1;
3024 pre_gen = gen_neg ? gen_int.GetFrom() - 1 : gen_int.GetTo() + 1;
3025 prev_anchor = neg ? anchor_range.GetFrom() - 1: anchor_range.GetTo() + 1;
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void ConvertSeqLocsToPairwiseAln(CPairwiseAln &aln, const objects::CSeq_loc &loc_1, const objects::CSeq_loc &loc_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections)
Build pairwise alignment from a pair of seq-locs.
static void redundant(Char *flag)
@ fAllowOverlap
allow segments with different orientation
@ fKeepNormalized
Policies:
CAlignRange Represents an element of pairwise alignment of two sequences.
Default IAlnSeqId implementation based on CSeq_id_Handle.
@ eBothDirections
No filtering: use both direct and reverse sequences.
vector< CRgbaColor > TColorCode
const TColorCode & GetColorCode() const
@ eLowIdentity
feature's default color based on feature type
TSeqPos x_GetProtOffset() const
Returns protein translation offset.
bool GetRelatedGlyphSelected() const
virtual void x_Draw() const
The default renderer for this layout object.
string m_sTopLabelPrefix
Prefix to prepend to labels on top.
virtual bool HitTestHor(TSeqPos x, const CObject *obj)
void x_DrawInsertion(TModelUnit SeqPosTriangleMidPointX, TModelUnit BoundaryYLow, TModelUnit BoundaryYHigh, TModelUnit YCenterLine) const
bool x_CanShowStrand(objects::ENa_strand strand) const
TIntervals m_Intervals
intervals (like for features or alignments).
void x_GetUserColor(const objects::CUser_object &display_settings, CRgbaColor &color) const
CRef< objects::CSeq_loc > x_AdjustFrame(const objects::CSeq_loc &loc, TSeqPos offset) const
Adjusts a location to accommodate for the protein translation offset.
void LayoutChanged()
update the layout for everything encompassing this glyph
EUndefinedBpType x_GetUndefinedBp_to(const objects::CSeq_loc &loc) const
ELinkedFeatDisplay m_LinkedFeat
linkage mode for the track where this glyph is residing
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
void x_DrawAdditionalInfo(TModelUnit base) const
virtual bool HasSideLabel() const
Query if there is label and label is on the side.
void SetRelatedGlyphSelected(bool Selected)
CConstRef< CFeatureParams > m_Config
All the configs needed for rendering a feature.
bool x_isDrawn() const
determines whether the glyph should be drawn or not at all (currently children of unselected parents ...
TModelUnit x_GetBarHeight() const
CProjectedMappingInfo m_ProjectedMappingInfo
string m_sFilter
filter (if any) for the track where this glyph is residing
virtual bool IsClickable() const
Query if this glyph is clickable.
bool GetCustomColor(CRgbaColor &color) const
Get the customized color for a given feature.
virtual bool NeedTooltip(const TModelPoint &, ITooltipFormatter &, string &) const
Check if need to show tooltip.
void GetAdditionalInfo(string &sAdditionalInfo) const
Some features may have additional info on the right (alleles for SNPs)
virtual string GetSignature() const
return signature for this glyph.
void x_DrawRSites(const CRgbaColor &color, TModelUnit BoundaryYLow, TModelUnit BoundaryYHigh) const
EUndefinedBpType x_GetUndefinedBp_from(const objects::CSeq_loc &loc) const
virtual void GetTooltip(const TModelPoint &p, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
objects::CMappedFeat m_Feature
we store a mapped feature object which in turn holds the original feature.
void x_DrawDeletion(TModelUnit SeqPosTriangleMidPointX, TModelUnit BoundaryYLow, TModelUnit BoundaryYHigh) const
void x_DrawRuler(TModelUnit base, bool protein_scale=false) const
const TMappingInfo & GetMappingInfo() const
virtual bool HasObject(CConstRef< CObject > obj) const
check if the wrapped object(s) is the one.
bool m_ProjectedFeat
Projected features.
void x_DrawFeatureBar(TModelUnit &base) const
bool m_HideLabel
Force to hide the label.
virtual void SetHideLabel(bool b)
Force to hide label.
virtual bool LessBySeqPos(const CSeqGlyph &obj) const
compare this object to another based on glyph sequence position.
virtual void GetObjects(vector< CConstRef< CObject > > &objs) const
retrieve CObjects corresponding to this CSeqGlyph.
virtual CConstRef< CObject > GetObject(TSeqPos pos) const
Retrieve the feature as an object.
bool x_RedundantLabelCheck(const string &label) const
virtual const objects::CSeq_loc & GetLocation(void) const
access the position of this object.
CFeatGlyph(const objects::CMappedFeat &feat, ELinkedFeatDisplay LinkedFeat=ELinkedFeatDisplay::eLFD_Default)
void x_DrawInnerLabels(TModelUnit base, vector< TModelRange > *labels_range=nullptr, TSeqRange *interval=nullptr) const
void x_DrawProjectedRuler(TModelUnit base, bool protein_scale=false) const
CConstRef< objects::CSeq_loc > m_Location
Mapped location in top sequence coordinate.
bool x_LabelOnLeft() const
true if a label should be placed to the left of the feature bar (provided that it is ePos_Side)
TMappingInfo m_MappingInfo
Feature product sequence mapping info.
bool x_IsProjected() const
void x_DrawLabelWithYPinned(TModelUnit base) const
static bool IsDbVar(const objects::CSeq_feat &feat)
Utility to check if a feature is a structural variation.
void x_MaybeDrawLabelOthers(TModelUnit base) const
bool m_RSite
Flag indicating if this is a restriction site.
virtual bool IsConsensus() const
Check if (intron) feature is consensus or not.
TModelUnit GetBarCenter() const
void x_DrawLabelWithXPinned(TModelUnit &base) const
virtual bool SetSelected(bool f)
Select or deselect this glyph.
void x_DrawRNAProductSequence(TModelUnit base) const
bool x_isExpandable(size_t &nChildren) const
returns true if this glyph is expandable i.e.
void x_MaybeDrawLabelAbove(TModelUnit &base) const
bool x_isCollapsible() const
returns true if this glyph is collapsible i.e.
virtual void GetAccessoryLabel(string &accessory_label) const
Some features may have an accessory label on top (e.g. introns)
const objects::CMappedFeat & GetMappedFeature(void) const
Access a new, fully remapped feature.
string x_GetFeatureId() const
virtual TSeqRange GetRange(void) const
get the total range of this object.
map< CLabel::ELabelType, string > m_Labels
virtual string GetPName() const
persistent name of the glyph should not depend on the instance of the glyph, but should uniquely refl...
void x_DrawFeatureBar_sv(TModelUnit base) const
virtual const TIntervals & GetIntervals(void) const
access sub-intervals (if any).
const objects::CSeq_feat & GetFeature(void) const
Access the original feature.
static size_t GetCustomColorIdx(const objects::CSeq_feat &feat)
Get the customized color idx for a given feature.
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
void GetLabel(string &label, CLabel::ELabelType type) const
retrieve feature label for a given type
EConnection m_Connections
TModelUnit m_LineWidth
absolute value (in pixel)
TModelUnit m_HeadHeight
ratio to bar height
TModelUnit m_TailHeight
ratio to bar height
CRgbaColor m_NonConsensus
CRef< CCustomFeatureColor > m_CustomColors
custom color code for features with a special attribute.
TModelUnit m_OverviewFactor
ratio to bar height
CGlTextureFont m_LabelFont
TModelUnit GetBarHeight(bool overview) const
ELabelPosition m_LabelPos
@ eBox_Insertion
additional decoration for the box
@ eBox_Deletion
add an inverted triangle to mark a deletion
@ eBox_Line
No box - just a line.
TModelUnit m_BarHeight
absolute size (in pixel)
@ ePos_Side
always on 5' side
@ ePos_Inside
inside the rendered bar
@ ePos_Above
above the rendered bar
bool m_ShowStrandIndicator
static CGuiRegistry & GetInstance()
access the application-wide singleton
string m_Descr
description that can be used as label or tooltip
@ fNoCaching
The tooltip for this feature should not be cached.
@ fIgnorable
feature can be ignored (isca browser feature editing only)
@ fEditable
can be modified (isca browser feature editing only)
string m_ID
area identifier
int m_Flags
area flags, will need to replace m_Type
bool m_PositiveStrand
the default is true
CLayoutGroup is a container of CSeqGlyphs (layout objects).
static void PropagateRelatedSelection(bool isSelected, CSeqGlyph *pGlyph, CSeqGlyph *pGlyphFrom=NULL)
set "RelatedGlyphSelected" in CLayoutGroup-based glyph hierarchies everywhere in the hierarchy contai...
CConstRef< CSeqGlyph > GetChild(int idx) const
Get the layout object at index 'idx'.
size_t GetChildrenNum() const
Get total number of children.
bool IsMaster(const CSeqGlyph *glyph) const
static string GetFeatSignature(const objects::CSeq_feat &feat, objects::CScope *scope, const string &data_source="", const string &sAdditionalInfo="")
A pairwise aln is a collection of ranges for a pair of rows.
void GetAnchorSequence(objects::CScope &scope, string &buffer) const
CConstRef< IAlnGraphicDataSource > m_AlnMgr
const IAlnGraphicDataSource * GetAlignmentDataSource() const
class CRegistryReadView provides a nested hierarchical view at a particular key.
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
bool GetIsDrawn(const string &sPName) const
void DrawDisk(const TModelPoint &p, TModelUnit radius, GLint from=0, GLint to=360) const
bool IsHorizontal() const
void TextOut(const CGlTextureFont *font, const char *text, TModelUnit x, TModelUnit y, bool center, bool adjust_flip=true) const
static const int kLabelSpacePx
extra space for side labeling, in screen pixels
void DrawTriangle(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, TModelUnit x3, TModelUnit y3, bool border=false) const
void Draw3DFletch(TModelUnit pos_x, TModelUnit line_y1, TModelUnit line_y2, TModelUnit tail_height, const CRgbaColor &color, bool neg_strand) const
void DrawPseudoBar(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &light_color, const CRgbaColor &dark_color) const
CRef< CSGSequenceDS > GetSeqDS() const
const TSeqRange & GetVisSeqRange() const
CGlPane * GetGlPane()
inline method implementations
const TModelUnit & GetOffset() const
TModelRange IntersectVisible(const CSeqGlyph *obj) const
TModelUnit GetMinLabelWidthPos() const
TSeqPos GetVisSeqTo() const
void Draw3DQuad_HorzLines(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
void DrawLineStrip(const vector< TModelPoint > &points) const
void DrawLine(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2) const
void DrawRect(const TModelRect &rc) 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 GetMaxLabelWidth(const CGlBitmapFont &font) const
In screen pixel..
void DrawPartialBar(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, bool p_start, bool p_stop, bool loc) 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.
TSeqPos GetVisSeqFrom() const
const CRgbaColor & GetSelLabelColor() const
bool WillLabelFit(const TModelRect &rc) const
void DrawSquare(const TModelPoint &p, TModelUnit size, const CRgbaColor &color, bool neg_strand) const
void Draw3DArrow(const TModelPoint &p, TModelUnit size, bool neg_strand) const
void Draw3DQuad(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2, const CRgbaColor &color, bool border=false) const
void SetIsDrawn(const string &sPName, bool isDrawn)
void Draw3DTriangle(const TModelPoint &p, TModelUnit size, const CRgbaColor &color, bool neg_strand, bool need_neck) const
void DrawBackground(const TModelRect &rcm, TModelUnit border) const
void DrawStrandIndicators(const TModelPoint &start, TModelUnit length, TModelUnit apart, TModelUnit size, const CRgbaColor &color, bool neg_strand, bool avoid_center=false, bool single_indicator_center=false, const vector< TModelRange > *labels_ranges=nullptr) const
class CRgbaColor provides a simple abstraction for managing colors.
CRuler is a renderable object drawing a scale with position labels.
void SetTextLabel(const string &label)
void SetFont(CGlTextureFont::EFontFace font_type, unsigned int font_size=12)
void SetBaseWidth(int value)
@ eOppLabelTickHeight
tick size at label position (opposite)
@ eOppMajorTickHeight
major tick on the opposite side
@ eOppMinorTickHeight
minor tick on the opposite side
@ eLabelTickHeight
tick size at label position
void SetHorizontal(bool b_horz, ELabelPlacement place=eDefault, ELabelAlign aln=eAln_Center)
void SetDisplayOptions(int options)
virtual void Render(CGlPane &pane)
void SetGeometryParam(EGeometryParam geom, int value)
void SetMapping(const TAlignColl &coll)
static CRegistryReadView GetColorReadView(const CGuiRegistry ®, const string &base_key, const string §, const string &key, const string &def_sect="")
Create a read view specifically for 'Color' section.
static void GetColor(const CRegistryReadView &view, const string &key, CRgbaColor &color)
TSeqPos GetSequenceLength() const
const objects::CSeqVector & GetSeqVector(void) const
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
string GetTearlineText() const
ENeighbours m_Neighbours
Indicates whether the glyph has neighbours.
void x_InitHTMLActiveArea(CHTMLActiveArea &area) const
initialize the basic information for a given active area.
CRenderingContext * m_Context
the rendering context
virtual void x_OnLayoutChanged()
update the layout.
virtual void SetHeight(TModelUnit h)
const CRenderingContext * GetRenderingContext() const
Get the rendering context.
virtual TModelUnit GetRight() const
void x_DrawInnerLabels(TModelUnit base, const string &label, const CRgbaColor &color, const CGlTextureFont &font, bool side_label_visible, bool inside_only, vector< TModelRange > *labels_ranges=nullptr, TSeqRange *interval=nullptr, bool XOR_mode=false) const
bool IsInHor(TModelUnit x) const
void x_DrawException() const
Draw a shading background to indicate exception.
virtual void SetWidth(TModelUnit w)
CSeqGlyph * m_Parent
parent/child relationships for this feature
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.
virtual void SetTop(TModelUnit b)
virtual bool SetSelected(bool flag)
Select or deselect this glyph.
void x_Local2World(TModelPoint &p) const
Transform the coordiantes from local coord. to world coord.
virtual TModelUnit GetWidth() const
virtual TModelUnit GetLeft() const
TModelRect GetModelRect() const
get the bounding box.
vector< CHTMLActiveArea > TAreaVector
const CSeqGlyph * GetParent(void) const
static SIZE_TYPE ReverseComplement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
namespace ncbi::objects::
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
bool IsDeletionInsertion() const
bool IsTranslocation() const
virtual bool IsNegativeStrand(TNumrow row) const =0
vector< TSeqRange > TIntervals
virtual IAlnExplorer::TNumrow GetAnchor() const =0
static CConstRef< CDbtag > GetTag(const CSeq_feat &SrcFeat)
find a SNP tag in the feature returns NULL if no such tag (sm_dbTag_dbSNP)
vector< string > TAlleles
list of alleles belonging to particular SNP a deletion is represented by a "-"
static void GetAlleles(const CMappedFeat &mapped_feat, TAlleles &Alleles)
Return list of alleles encoded in qual.
const_iterator end() const
const_iterator find(const key_type &key) const
static const Colors colors
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
static const float kMinScaleForRulerLabels
Shoudl match feature_ds.cpp::kMinScaleForMapping i.e.
static const TModelUnit kRSiteMarkerThreshold
Restriction sites marker visibility threshold (ie if the marker's width is smaller then the threshold...
static const int kVertSpace
vertical space between elements.
static const TModelUnit kRSiteMarkerWidth
Restriction sites marker width (absolute)
static int s_GetLiteralLength(const CVariation_ref &var)
TVPUnit s_AdjustScreenCoordinate(TModelUnit x)
static const int kRulerHeight
feature ruler height.
static const TModelUnit kRSiteMarkerHeight
Restriction sites marker height (relative to the height of the bar)
bool Empty(const CNcbiOstrstream &src)
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 REVERSE_ITERATE(Type, Var, Cont)
ITERATE macro to reverse sequence through container elements.
#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)
static bool IsException(const objects::CSeq_feat &feat)
static bool IsPartialStart(const objects::CSeq_loc &loc)
static bool IsPartialFeature(const objects::CSeq_feat &feat)
static bool IsPseudoFeature(const objects::CSeq_feat &feat)
static bool IsPartialStop(const objects::CSeq_loc &loc)
static bool IsSameStrands(const objects::CSeq_loc &loc)
static bool isRmtAnnotName(const string &sAnnotname)
check if a given annotation was created by a remote file pipeline
vector< TMappedInt > TMappingInfo
void SetModelLimitsRect(const TModelRect &R)
void SetViewport(const TVPRect &R)
virtual void Enable(GLenum glstate)=0
virtual void LineStipple(GLint factor, GLushort pattern)=0
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
void Color3f(GLfloat r, GLfloat g, GLfloat b)
IRender & GetGl()
convenience function for getting current render manager
TVPRect & GetViewport(void)
virtual TModelUnit TextHeight(const CGlTextureFont *font) const =0
virtual TModelUnit TextWidth(const CGlTextureFont *font, const char *text) const =0
virtual void LoadIdentity()=0
TVPUnit ProjectY(TModelUnit m_y) const
virtual void PopMatrix()=0
CRange< TModelUnit > TModelRange
void SetVisibleRect(const TModelRect &R)
virtual TModelUnit TextWidth(const char *text) const
Compute and return font metrics.
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()
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,})
virtual void PushMatrix()=0
string Truncate(const char *text, TModelUnit w, ETruncate trunc=eTruncate_Ellipsis) const
Truncate text to the secified width.
@ eFontFace_Helvetica_Bold
CRgbaColor ContrastingColor(bool onlyBW=true) const
Return a color guaranteed to contrast nicely with this color.
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
void SetLocation(const objects::CSeq_loc &loc)
void Set(float r, float g, float b)
set the color from an Fl_Color
static NSnp::TClinSigID ClinSigFromString(const string &clinsig)
converts string to clinical significance type (CPhenotype::EClinical_significance)
float GetBlue(void) const
float GetGreen(void) const
static CIRef< ITooltipFormatter > CreateTooltipFormatter(ETooltipFormatters)
factory for requested tooltip formatter creation
void FromString(const string &str)
Assign color values encoded in a string.
void SetTaxId(int tax_id)
void Lighten(float scale)
static bool GetClinSigValue(const CSeq_feat &ref, string &attr_value)
returns CLNSIG attribute value from VcfAttribute user object returns false if not found
static bool isFromVcf(const CSeq_feat &variation_ref)
void SetMappingInfo(const CSeqUtils::TMappingInfo &mapping_info)
static CVariation_inst::EType GetVcfType(const CSeq_feat &variation_ref)
void SetMappedFeat(const objects::CMappedFeat &mapped_feat)
static void ClinSigAsColor(NSnp::TClinSigID ClinSigID, CRgbaColor &color)
returns color for clinsig values (SV-4908) returns #767677 for undefined values
float GetRed(void) const
Get specific channels in floating point values.
@ eTooltipFormatter_CSSTable
generated table is CSS based, generated NCBI URLs are paths (recommended for SViewer)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CConstRef< CSeq_id > GetSeqId(void) const
string AsString(void) const
@ eContent
Untagged human-readable accession or the like.
CRef< CSeq_loc > MakeSeq_loc(EMakeType make_type=eMake_CompactType) const
return constructed CSeq_loc with all changes
void SetPacked_int(TPacked_int &v)
void SetFrom(TSeqPos from)
Set the range from position.
void SetTo(TSeqPos to)
Set the range to position.
ENa_strand GetStrand(void) const
Get the location's strand.
bool IsReverseStrand(void) const
Return true if all ranges have reverse strand.
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
CConstRef< CSeq_loc > GetRangeAsSeq_loc(void) const
Get seq-loc for the current iterator position.
bool IsSetStrand(void) const
Get strand.
bool IsEmpty(void) const
True if the current location is empty.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
TRange GetRange(void) const
Get the range.
ENa_strand GetStrand(void) const
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.
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
TTaxId GetTaxId(const CBioseq_Handle &handle)
return the tax-id associated with a given sequence.
@ eGetId_ForceGi
return only a gi-based seq-id
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
@ 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).
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty – not pointing to any object which means having a null value.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
int64_t Int8
8-byte (64-bit) signed integer
position_type GetLength(void) const
bool AbuttingWith(const TThisType &r) const
bool IntersectingWith(const TThisType &r) const
TThisType & CombineWith(const TThisType &r)
TThisType IntersectionWith(const TThisType &r) const
position_type GetToOpen(void) const
TThisType & Set(position_type from, position_type to)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another 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.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
@ eNocase
Case insensitive compare.
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.
bool IsStr(void) const
Check if variant Str is selected.
bool IsLim(void) const
Check if variant Lim is selected.
const TTag & GetTag(void) const
Get the Tag member data.
bool IsId(void) const
Check if variant Id is selected.
const TDb & GetDb(void) const
Get the Db member data.
TLim GetLim(void) const
Get the variant data.
TMin GetMin(void) const
Get the Min member data.
const TStr & GetStr(void) const
Get the variant data.
bool IsRange(void) const
Check if variant Range is selected.
TMax GetMax(void) const
Get the Max member data.
TId GetId(void) const
Get the variant data.
const TRange & GetRange(void) const
Get the variant data.
@ eLim_tl
space to left of position
E_Choice Which(void) const
Which variant is currently selected.
const TIds & GetIds(void) const
Get the Ids member data.
list< CRef< CUser_object > > TExts
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
const TLocal & GetLocal(void) const
Get the variant data.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
const TGeneral & GetGeneral(void) const
Get the variant data.
const TGiim & GetGiim(void) const
Get the variant data.
bool IsSetIds(void) const
set of Ids; will replace 'id' field Check if a value has been assigned to Ids data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
TGibb GetGibb(void) const
Get the variant data.
const TVariation & GetVariation(void) const
Get the variant data.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
@ e_General
for use by various databases
@ e_Local
for local software use
@ eFrame_three
reading frame
const TFuzz_from & GetFuzz_from(void) const
Get the Fuzz_from member data.
TId GetId(void) const
Get the Id member data.
bool IsMix(void) const
Check if variant Mix is selected.
ENa_strand
strand of nucleic acid
const Tdata & Get(void) const
Get the member data.
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
const TFuzz_to & GetFuzz_to(void) const
Get the Fuzz_to member data.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
TStrand GetStrand(void) const
Get the Strand member data.
const Tdata & Get(void) const
Get the member data.
bool CanGetFuzz(void) const
Check if it is safe to call GetFuzz method.
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
bool CanGetPoint(void) const
Check if it is safe to call GetPoint method.
bool IsSetFuzz_to(void) const
Check if a value has been assigned to Fuzz_to data member.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsSetFuzz_from(void) const
Check if a value has been assigned to Fuzz_from data member.
const TMix & GetMix(void) const
Get the variant data.
bool IsPnt(void) const
Check if variant Pnt is selected.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
@ eNa_strand_both_rev
in reverse orientation
@ eNa_strand_both
in forward orientation
const TInstance & GetInstance(void) const
Get the variant data.
bool IsSetDelta(void) const
Sequence that replaces the location, in biological order.
const TId & GetId(void) const
Get the Id member data.
const TDelta & GetDelta(void) const
Get the Delta member data.
const TData & GetData(void) const
Get the Data member data.
bool IsInstance(void) const
Check if variant Instance is selected.
list< CRef< CDelta_item > > TDelta
bool CanGetId(void) const
Check if it is safe to call GetId method.
@ eType_snv
delta=[morph of length 1] NOTE: this is snV not snP; the latter requires frequency-based validation t...
@ eType_mnp
delta=[morph of length >1]
@ eType_delins
delta=[del, ins]
bm::gap_word_t gap_length(const bm::gap_word_t *buf) noexcept
Returs GAP block length.
static void text(MDB_val *v)
constexpr auto sort(_Init &&init)
constexpr auto front(list< Head, As... >, T=T()) noexcept -> Head
constexpr bool empty(list< Ts... >) noexcept
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
string GetProduct(const CProt_ref &prot_ref)
static const sljit_gpr r1
static SLJIT_INLINE sljit_ins lg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static const sljit_gpr r0
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
sorting functor for finding a range inside a collection of layout objects
bool operator()(const CRef< CLayoutObject > &obj1, const CRef< CLayoutObject > &obj2) const