106 #include <wx/event.h>
160 DECLARE_EVENT_TABLE()
176 int cut_off = m_MaxAlignShownAdaptive;
182 cut_off = m_MaxAlignShownAdaptive;
186 cut_off = m_MaxAlignShownFull;
248 LOG_POST(
Warning <<
"CAlignmentTrack settings. Invalid layout string: '" << layout <<
"'");
256 if (iter.second == layout) {
279 if (iter != sm_LabelPosMap.end()) {
290 for (iter = sm_LabelPosMap.begin(); iter != sm_LabelPosMap.end(); ++iter) {
291 if (iter->second == pos) {
312 if (iter != sm_HideSraMap.end()) {
321 for (iter = sm_HideSraMap.begin(); iter != sm_HideSraMap.end(); ++iter) {
322 if (iter->second == hideSra) {
343 if (iter != sm_UnalignedTailsModeMap.end()) {
352 for (iter = sm_UnalignedTailsModeMap.begin(); iter != sm_UnalignedTailsModeMap.end(); ++iter) {
353 if (iter->second == tailsMode) {
362 static const string kBaseKey =
"GBPlugins.SeqGraphicAlignment";
369 "Graphical View Alignment Track");
375 , m_Layout(eLayout_Default)
376 , m_ShowAlignedSeqFeats(
false)
378 , m_ShowUnalignedTailsForTrans2GenomicAln(
true)
379 , m_ShowAlnStat(
false)
380 , m_ShowIdenticalBases(
false)
383 , m_ShowSecondPassAlignments(
true)
384 , m_CompactEnabled(
true)
385 , m_CompactThreshold(100)
386 , m_ExtremeCompactThreshold(1000)
397 true,
"track_layout"));
399 true,
"track_align_score"));
401 true,
"track_stat"));
403 true,
"track_tails"));
427 }
catch (exception& e) {
445 title =
"Other alignments";
562 if (preset_style.empty() || preset_style ==
kDefProfile) {
582 string memory_limit = view.
GetString(
"memory_limit",
"2GB");
608 string str =
f->GetData().GetStr();
613 ITERATE(list<string>, iter, toks)
619 <<
"parsing projected feature list: " << e.
GetMsg());
643 graph_params->
m_Height = size_view.GetInt(
"GraphHeight", 45);
677 else if (
NStr::EqualNocase(iter->first,
"ShowUnalignedTailsForTrans2GenomicAln"))
696 if (height >= 10 && graph_params) {
709 if ( !toks.empty() ) {
713 ITERATE (list<string>, f_iter, toks) {
718 <<
"parsing projected feature list: " << e.
GetMsg());
748 LOG_POST(
Warning <<
"CAlignmentTrack::x_LoadSettings() invalid settings: "
749 << iter->first <<
":" << iter->second);
820 if ( !preset_style.empty() ) {
821 settings[
"profile"] = preset_style;
831 settings[
"ShowUnalignedTailsForTrans2GenomicAln"] =
839 if ( !projected_feats.empty() ) {
840 settings[
"ProjectedFeats"] = projected_feats;
919 auto align_cost = -1;
935 bool show_coverage = !sequence_level;
937 if (show_pileup_cache) {
938 show_coverage =
false;
952 bool show_aligns =
false;
986 static const int kMaxRegulatAlignmentRows = 1000;
987 align_limit = kMaxRegulatAlignmentRows;
1004 LOG_POST(
Error <<
"CAignmentTrack::x_OnJobCompleted() notification for job \
1005 does not contain results.");
1012 switch (
result->m_Token) {
1053 wxT(
"Show alignment statistics"));
1058 wxT(
"Project features for aligned sequences"));
1062 item = menu.AppendCheckItem(
kContentBaseID + curr_id++,
wxT(
"Link mate pairs"));
1066 item = menu.AppendCheckItem(
kContentBaseID + curr_id++,
wxT(
"Sort alignments by strand"));
1070 item = menu.AppendCheckItem(
kContentBaseID + curr_id++,
wxT(
"Sort alignments by haplotype"));
1075 wxT(
"Show identical bases"));
1080 menu.AppendSeparator();
1093 int id_base = 10000;
1097 wxMenuItem* item = menu.AppendRadioItem(id_base + iter.first,
1098 ToWxString(iter.second + (l_default ?
" (Default)" :
"")));
1106 menu.AppendSeparator();
1107 wxMenuItem* item = menu.AppendCheckItem(compact_item_idx,
1108 wxT(
"Enable compact display"));
1113 wxMenuItemList& item_list = menu.GetMenuItems();
1114 ITERATE (wxMenuItemList, iter, item_list) {
1115 if ((*iter)->GetId() == compact_item_idx) {
1123 if ((*iter)->IsChecked() &&
id !=
m_Layout) {
1143 int id_base = 10000;
1153 wxMenuItem* item = menu.AppendRadioItem(id_base + curr_id,
1157 if (curr_method == (*iter)->GetName()) {
1165 wxMenuItem* item = menu.AppendRadioItem(id_base + curr_id,
1168 if (curr_method == score_name) {
1175 wxMenuItem* item = menu.AppendRadioItem(id_base + curr_id,
wxT(
"Disabled"));
1182 wxMenuItemList& item_list = menu.GetMenuItems();
1183 ITERATE (wxMenuItemList, iter, item_list) {
1184 int checked_id = (*iter)->GetId() - id_base;
1185 if ((*iter)->IsChecked() && score_id != checked_id) {
1186 if (checked_id == curr_id) {
1222 if(dlg.ShowModal() == wxID_OK) {
1241 int id_base = 10000;
1244 wxMenuItem* items[3];
1245 items[0] = menu.AppendRadioItem(id_base + curr_id++,
"Hide tails",
"Hide the unaligned tails");
1246 items[1] = menu.AppendRadioItem(id_base + curr_id++,
"Show tail length",
"Display the length of the unaligned tails");
1247 items[2] = menu.AppendRadioItem(id_base + curr_id++,
"Show tail sequence",
"Display the unaligned tails row sequence");
1249 menu.AppendSeparator();
1250 wxMenuItem* itemTrans2Genomic = menu.AppendCheckItem(
kContentBaseID + curr_id++,
1251 wxT(
"Show unaligned tails for transcript-to-genomic alignments"));
1253 itemTrans2Genomic->Check();
1258 if (items[1]->IsChecked())
1260 else if (items[2]->IsChecked())
1263 bool update =
false;
1317 vector<CLayoutGroup*> groups;
1322 groups.push_back(curr_group);
1326 groups.push_back(p_group);
1359 first_group =
dynamic_cast<const CNamedGroup*
>(
result.m_ObjectList.front().GetPointer());
1457 vector< CRef<CAlignGlyph> > aligns;
1464 vector<CLayoutGroup*> groups;
1478 groups.push_back(curr_group);
1481 groups.push_back(p_group);
1515 scored_alns.emplace_back(
tmp);
1525 if (project_feats) {
1537 scored_alns.emplace_back(
tmp);
1554 (*mp_iter)->SetRenderingContext(
m_Context);
1556 stat_aligns.emplace_back(&(*mp_iter)->GetAlignMgr());
1558 if (show_score && (*mp_iter)->GetAlignMgr().IsColoringAvailable()) {
1559 if ((*mp_iter)->IsSimplified()) {
1560 (*mp_iter)->SetShowScore();
1562 scored_alns.emplace_back(mp_iter->GetPointer());
1587 string coverage_annot;
1591 SetMsg(
", Coverage graph");
1627 float min_dist = 4.0;
1655 if ( !aligns.empty() ) {
1661 if ( !scored_alns.empty() ) {
1673 string coverage_annot;
1678 if (
result.m_ObjectList.empty()) {
1689 SetMsg(
", Coverage graph");
1703 string coverage_annot;
1705 if (conf_mgr->HasSettings(coverage_annot)) {
1706 params = conf_mgr->GetHistParams(coverage_annot);
1711 conf_mgr->AddSettings(coverage_annot, params);
1723 vector<CAlnStatGlyph*> stat_glyphs;
1724 for (
auto&& ch : objs) {
1730 stat_glyphs.push_back(stat_glyph);
1733 if (stat_glyphs.empty()) {
1768 for (
auto&& stat_glyph : stat_glyphs) {
1769 stat_glyph->SetConfig(
m_StatConf, graph_params);
1789 dynamic_cast<CAlignGlyph*
>((*a_iter)->m_Owner.GetPointer());
1790 if (objs.empty() || !align)
continue;
1797 parent_group->
Insert(align, group);
1798 parent_group->
Remove(align);
1801 if (objs.size() > 1) {
1806 TFeatGroups feat_groups;
1824 feat_groups[s_type].push_back(*iter);
1829 if (iter->second.size() > 1) {
1834 true,
false,
CRgbaColor(0.5, 0.5f, 0.5f, 0.5f),
1839 sub_group->
Set(iter->second);
1841 group->
Append(iter->second);
1865 true,
false,
CRgbaColor(0.0, 0.6f, 0.0f, 0.1f),
1870 group->SetShowGene(
true);
2006 if (seq_id.
Match(*
id))
2119 if ( !conf || !conf->
m_Dirty) {
2253 string msg =
", total ";
2256 msg +=
m_ObjNum > 1 ?
"s shown" :
" shown";
2273 if (s_ALnTypeMap.count(align_type) != 0)
2274 return s_ALnTypeMap[align_type];
2285 if (s_AlnLoaderMap.count(align_loader) != 0)
2286 return s_AlnLoaderMap[align_loader];
2296 string msg =
"second-pass alignments are hidden";
2314 p_areas->push_back(area);
2325 area->m_ID =
GetId();
2338 if (cgi_mode &&
GetGl().IsPrinterFriendly() ==
false) {
2379 if ( !src_annots.
empty() ) {
2389 if (track_settings.count(
"align_loader") > 0) {
2398 vector<string> target_g_annots;
2402 target_g_annots.push_back(iter->first);
2405 if ( !target_g_annots.empty() ) {
2417 }
catch(
const exception&) {
2441 bool is_reads =
false;
2457 if (track_settings.count(
"align_type") > 0)
2460 aln_track->SetAlnType(aln_type);
2461 }
else if (is_reads) {
2468 }
catch (
const exception&) {
2476 aln_track->SetAnnot(iter->first);
2477 if (!iter->second.empty()) {
2478 aln_track->SetTitle(iter->second);
2481 aln_track->SetDSContext(ds_context);
2483 tracks[iter->first] = aln_track.
GetPointer();
2519 bool sraTrack =
false;
2523 while (config_num) {
2527 config->SetLegend_text(
"anchor_7");
2551 if (profile ==
"BAM") {
2562 vector<string> scoring_methods;
2565 scoring_methods.push_back(
"Rasmol Amino Acid Colors");
2566 scoring_methods.push_back(
"Shapely Amino Acid Colors");
2567 scoring_methods.push_back(
"BLOSUM45");
2568 scoring_methods.push_back(
"BLOSUM62");
2569 scoring_methods.push_back(
"BLOSUM80");
2570 scoring_methods.push_back(
"Protein Quality Scoring with Coloring");
2571 scoring_methods.push_back(
"Hydropathy Scale");
2572 scoring_methods.push_back(
"Membrane preference");
2573 scoring_methods.push_back(
"Signal sequence");
2574 scoring_methods.push_back(
"Size");
2581 scoring_methods.push_back(
"Nucleic Acid Colors");
2588 switch (config_num) {
2590 config->SetSubkey(
"SRA");
2593 config->SetSubkey(
"protein");
2607 bool enable_color = view.
GetBool(
"EnableColoration",
true);
2613 bool aligned_seqfeats = view.
GetBool(
"ShowAlignedSeqFeats",
false);
2614 bool show_identical_bases = view.
GetBool(
"ShowIdenticalBases",
false);
2616 bool link_mate_pair = view.
GetBool(
"LinkMatePairAligns",
true);
2617 string rendering_style = view.
GetString(
"Layout");
2620 bool show_second_pass = view.
GetBool(
"ShowSecondPass",
true);
2621 int flag = view.
GetInt(
"StatDisplay", 15);
2622 bool show_aln_stat = view.
GetBool(
"ShowAlnStat",
false);
2628 enable_color =
false;
2630 enable_color =
true;
2633 ITERATE (vector<string>, sm_iter, scoring_methods) {
2635 scoring_method = iter->second;
2650 unaligned_tails_mode = iter->second;
2654 rendering_style = iter->second;
2662 hide_sra = iter->second;
2666 config->SetHidden_settings().push_back
2669 config->SetHidden_settings().push_back
2672 config->SetHidden_settings().push_back
2675 config->SetHidden_settings().push_back
2678 config->SetHidden_settings().push_back
2681 config->SetHidden_settings().push_back
2684 config->SetHidden_settings().push_back
2687 config->SetHidden_settings().push_back
2692 LOG_POST(
Warning <<
"CAlignmentTrack::x_LoadSettings() invalid settings: "
2693 << iter->first <<
":" << iter->second);
2697 rendering_style =
"Adaptive";
2701 "Layout",
"Alignment Display", rendering_style,
2702 "Alignment rendering style");
2703 choice->SetValues().push_back(
2707 "Pack alignments if necessary",
2709 choice->SetValues().push_back(
2713 "Always pack all alignments into a coverage graph or pileup graph",
2715 choice->SetValues().push_back(
2719 "Show one alignment per row sorted by alignments' start location",
2721 choice->SetValues().push_back(
2725 "Show all alignments",
2728 config->SetChoice_list().push_back(choice);
2732 if ( !enable_color ) {
2733 scoring_method =
"false";
2737 "Color",
"Score method", scoring_method,
2738 "Alignment score coloration method");
2740 ITERATE (vector<string>, iter, scoring_methods) {
2741 choice->SetValues().push_back(
2743 *iter, *iter, *iter,
""));
2745 choice->SetValues().push_back(
2747 "false",
"Disabled",
"No score coloration",
""));
2748 config->SetChoice_list().push_back(choice);
2751 config->SetCheck_boxes().push_back(
2753 "LinkMatePairAligns",
"Link mate pairs",
2754 "Enable/disable linking mate reads",
"", link_mate_pair));
2757 config->SetCheck_boxes().push_back(
2759 "ShowAlnStat",
"Show pileup",
2760 "Enable/disable pileup display alongside with alignments",
"",
2764 config->SetCheck_boxes().push_back(
2766 "AlignedSeqFeats",
"Project features",
2767 "Show features projected from the aligned sequences",
"",
2771 config->SetCheck_boxes().push_back(
2773 "Label",
"Show labels",
"Show/hide alignment labels",
"",
label));
2776 config->SetCheck_boxes().push_back(
2778 "IdenticalBases",
"Show identical bases",
"Write characters for matching bases",
"", show_identical_bases));
2781 config->SetCheck_boxes().push_back(
2783 "ShowSecondPass",
"Show second-pass alignments",
2784 "Show/Hide second-pass alignments",
"", show_second_pass, show_second_pass == view.
GetBool(
"ShowSecondPass",
true) ));
2789 "UnalignedTailsMode",
"Unaligned Tails", unaligned_tails_mode,
2790 "Unaligned tails display mode");
2791 choice->SetValues().push_back(
2795 "Hide the unaligned tails",
2798 choice->SetValues().push_back(
2802 "Display the length of the unaligned tails",
2805 choice->SetValues().push_back(
2809 "Display the unaligned tails row sequence",
2812 config->SetChoice_list().push_back(choice);
2816 if (sraTrack || (
CONFIG_SRA == config_num)) {
2818 "HideSraAlignments",
"Hide Alignments", hide_sra,
2819 "SRA alignments to hide");
2820 choice->SetValues().push_back(
2824 "Show all alignments",
2827 choice->SetValues().push_back(
2831 "Hide PCR duplicates",
2834 choice->SetValues().push_back(
2838 "Hide reads with poor sequence quality",
2841 choice->SetValues().push_back(
2844 "Duplicates/Bad reads",
2845 "Hide PCR duplicates and reads with poor sequence quality",
2848 config->SetChoice_list().push_back(choice);
2857 "sort_by",
"Sort alignments by", sort_by,
2858 "Sort alignments according to a selected criterion.");
2860 choice->SetValues().push_back(
2862 "",
"No sorting",
"Don't sort alignments",
""));
2866 config->SetChoice_list().push_back(choice);
static const size_t kProjectedFeatID
static const TUnalignedTailsModeStr s_UnalignedTailsModeStrs[]
CStaticArrayMap< string, CAlignmentConfig::ELabelPosition > TLabelPosMap
static const THideSraStr s_HideSraStrs[]
static const char * kDefaultScoringMethod
static const map< string, CAlignmentTrack::ELayout > sm_LayoutMap
DEFINE_STATIC_ARRAY_MAP(TLabelPosMap, sm_LabelPosMap, s_LabelPosStrs)
static const map< CAlignmentTrack::ELayout, string > sm_LayoutDispMap
layout style to layout display name
static const TLabelPosStr s_LabelPosStrs[]
static const string kTrackName
const string & s_LayoutToDisplayName(CAlignmentTrack::ELayout layout)
static const double kMinCoverageZoomLevel
Scale at which we unconditionally switch to coverage graph.
static const int kShowPileUpRange
Range length for unconditional swith to pieup.
CStaticArrayMap< string, CAlignmentConfig::EHideSraAlignments > THideSraMap
SStaticPair< const char *, CAlignmentConfig::EUnalignedTailsMode > TUnalignedTailsModeStr
static const string kMatePairKey
static const string kGeneModelBaseKey
SStaticPair< const char *, CAlignmentConfig::ELabelPosition > TLabelPosStr
static const string kDefProfile
CSGAlignmentDS::EDataLoader s_ParseAlignDataLoader(const string &align_loader)
static const string kAlignGlyphKey
SStaticPair< const char *, CAlignmentConfig::EHideSraAlignments > THideSraStr
static const char * kDefaultUnalignedTailsMode
static const string kReadsProfile
static const size_t kContentBaseID
IAlnExplorer::EAlignType s_ParseAlignType(const string &align_type)
CStaticArrayMap< string, CAlignmentConfig::EUnalignedTailsMode > TUnalignedTailsModeMap
@ CONFIG_ALL
special setting for TMS tracks that did not go through complete alignment type discovery in seqconfig...
static const char * kDefaultSraFilter
static const string kBaseKey
void SetConfig(CConstRef< CAlignmentConfig > conf)
inline methods
static std::string const & GetHaplotypeID()
static void SetTrackSetting(objects::CChoice &choice)
static const string & GetID()
ELabelPosition m_LabelPos
@ eExtremeCompact
extreme compact mode
CRgbaColor m_SmearColorMin
CRgbaColor m_SmearColorMax
CGlTextureFont m_LabelFont
bool m_Dirty
Dirty flag indicates any unsaved changes.
ECompactMode m_CompactMode
Alignment layout compact mode.
CRgbaColor m_UnalignedSequence
bool m_ShowIdenticalBases
bool m_ShowUnalignedTailsForTrans2GenomicAln
CRgbaColor m_NonConsensus
EUnalignedTailsMode m_UnalignedTailsMode
@ ePos_Above
above the rendered bar
@ ePos_Side
always on 5' side
virtual void RegisterIconImages() const override
virtual void GetMatchedAnnots(const TAnnotMetaDataList &src_annots, const ILayoutTrackFactory::SExtraParams ¶ms, TAnnotNameTitleMap &out_annots) const override
virtual string GetExtensionIdentifier() const override
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual string GetExtensionLabel() const override
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual const CTrackTypeInfo & GetThisTypeInfo() const override
virtual CRef< objects::CTrackConfigSet > GetSettings(const string &profile, const TKeyValuePairs &settings, const CTempTrackProxy *track_proxy) const override
virtual TTrackMap CreateTracks(SConstScopedObject &object, ISGDataSourceContext *ds_context, CRenderingContext *r_cntx, const SExtraParams ¶ms=SExtraParams(), const TAnnotMetaDataList &src_annots=TAnnotMetaDataList()) const override
CAlignmentTrackFactory.
static CTrackTypeInfo m_TypeInfo
void OnToggleContent(int id)
void x_OnLayoutIconClicked()
CRef< CSGAlignmentDS > m_DS
size_t m_CompactThreshold
Alignment number threshold between compact mode and non-compact mode.
void x_AddAlignmentLayout(const CSGJobResult &result)
CRef< CAlnStatConfig > m_StatConf
void x_LoadAlignmentSettings(const string &key, CRef< CAlignmentConfig > &conf)
common function for loading settings for multialign, pairwise aligns, and align smear.
int x_LayoutToCutoff(CAlignmentTrack::ELayout layout)
CAlignmentTrack.
bool m_ShowUnalignedTailsForTrans2GenomicAln
void SetAnnot(const string &annot)
virtual const CTrackTypeInfo & GetTypeInfo() const override
virtual CHTMLActiveArea * InitHTMLActiveArea(TAreaVector *p_areas) const override
Initialize the HTML active area for a track.
virtual void x_OnJobCompleted(CAppJobNotification ¬ify) override
vector< CRef< CAlnStatGlyph > > m_StatGlyph
EAlignGlyphType x_GetAlignGlyphType(const CSeqGlyph *glyph) const
int m_MaxAlignShownFull
MaxAlignCost Show PileUp Graph is cost is higher than MaxAlignCost.
void x_OnLayoutPolicyChanged()
static ELayout LayoutStrToValue(const string &layout)
CAlignmentConfig::EHideSraAlignments m_HideSraAlignments
void x_LoadMPPWAlignSettings()
CAlignmentTrack(CSGAlignmentDS *ds, CRenderingContext *r_cntx)
size_t m_ExtremeCompactThreshold
Alignment number threshold between compact mode and extreme compact mode.
void x_SavePWAlignSettings() const
void x_AddGraphLayout(const CSGJobResult &result)
int m_MaxAlignShownAdaptive
virtual ~CAlignmentTrack()
vector< int > TSubtypeVec
virtual void x_SaveSettings(const string &preset_style) override
save part of settings to a profile string.
static const string & LayoutValueToStr(ELayout layout)
int x_LayoutToCutoff_SRA(CAlignmentTrack::ELayout layout)
CRef< CSimpleLayout > m_GeneModelLayout
CRef< CColumnLayout > m_Column
double m_MinAlignCost
MinPileUpCost - Show Coverage Graph if cost is higher than MinPileUpCost.
static CAlignmentConfig::EUnalignedTailsMode UnalignedTailsModeStrToValue(const string &tailsMode)
CRef< CBoundaryParams > m_GeneGroupConf
CRef< CHistParams > x_GetGraphParams()
void x_LoadAlignSmearSettings()
void x_OnTailsIconClicked()
CRef< CAlignmentConfig > m_MultiAlignConf
> Default Settings profile
virtual void x_OnIconClicked(TIconID id) override
Mouse left-click event handler on an icon.
void x_SaveMultiAlignSettings() const
virtual void x_UpdateBoundingBox() override
Update the bounding box assuming children's sizes are fixed if any.
static const string & HideFlagValueToStr(CAlignmentConfig::EHideSraAlignments hideSra)
static const string & LabelPosValueToStr(CAlignmentConfig::ELabelPosition pos)
void x_AddAlignStatLayout(const CSGJobResult &result)
string m_MultiAlignProfile
bool m_ShowSecondPassAlignments
IAlnExplorer::EAlignType m_AlnType
bool m_ShowAlignedSeqFeats
CRef< CAlignmentConfig > m_MPPWAlignConf
for linked pairwise aligns
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const override
Get html active areas.
void x_SaveConfiguration(const string &preset_style) const
save all track settings to the configuration file.
CAlignmentConfig::EUnalignedTailsMode m_UnalignedTailsMode
TSubtypeVec m_ProjectedFeats
virtual void x_UpdateData() override
update track content.
virtual string GetFullTitle() const override
get a more meaningful title.
string m_AlignSmearProfile
void x_AddAlignFeatLayout(CBatchJobResult &results)
void x_OnStatIconClicked()
virtual void x_LoadSettings(const string &preset_style, const TKeyValuePairs &settings) override
load the track settings.
void x_LoadAlignedSeqFeats(vector< CRef< CAlignGlyph > > &aligns, CAlignGlyph *aln)
void x_LoadMatePairSettings()
void x_SaveMatePairSettings() const
CRef< CAlignmentConfig > m_AlignSmearConf
CRef< CGeneModelConfig > m_GeneModelConfig
void x_SaveAlignSmearSettings() const
bool m_ShowIdenticalBases
static CAlignmentConfig::ELabelPosition LabelPosStrToValue(const string &pos)
void OnChangeProjectedFeats()
void x_LoadMultiAlignSettings()
void x_OnContentIconClicked()
CRef< CMatePairConfig > m_MatePairConf
void x_OnScoreIconClicked()
void x_AddAlignFeat_Recursive(CLayoutGroup::TObjectList &objs)
@ eLayout_Adaptive
adaptive using loading costs to switch between rendering modes
@ eLayout_Full
one alignment per row sorted by pos
@ eLayout_ExpandedByPos
one alignment per row sorted by pos
@ eLayout_Packed
smear/pack all alignments into one smear bar
static CAlignmentConfig::EHideSraAlignments HideFlagStrToValue(const string &hideSra)
CRef< CBoundaryParams > m_FeatGroupConf
void x_LoadPWAlignSettings()
CRef< CAlignmentConfig > m_PWAlignConf
static const string & UnalignedTailsModeValueToStr(CAlignmentConfig::EUnalignedTailsMode tailsMode)
void x_SaveAlignmentSettings(const string &key, CConstRef< CAlignmentConfig > conf) const
double m_MaxAlignCost
MinAlignCost - Show Alignment Graph if cost is higher than MinAlignCost.
wxEvtHandler * m_ContentHandler
wx-related event handler.
void x_OnChangeProjectedFeats(wxCommandEvent &)
on change the projected feature list.
void OnContextMenu(wxContextMenuEvent &anEvent)
CAlignmentTrack * m_Track
void x_OnToggleContent(wxCommandEvent &event)
CAlnContentEvtHandler(CAlignmentTrack *track)
@ fBarGraph
otherwise, shown as density table
@ fShowCount
otherwise, shown percentage
@ fShowMismatch
otherwise, shown individual count
void SetDisplayFlag(FDisplay bit, bool f)
int m_StatZoomLevel
at what zoom level to turn on statistics
void SetShowLabel(bool flag)
array< CRgbaColor, eStat_Total+1 > m_Colors
color settings
@ eStat_Mismatch
mismatches (A+G+T+C - matches)
@ eStat_Total
total alignment count at this base (A+G+T+C+Gap)
bool IsBarGraph() const
CAlnStatConfig inline method implementation.
static CRef< objects::CChoice > CreateDisplayOptions(const string &option_name, int display_flag)
CAppJobNotification Notification send by CAppJobEventTranslator.
CBatchJobResult – the data structure holding the seqgraphic job results for a batch job processing.
vector< CRef< CSGJobResult > > TResults
CColumnLayout is for creating layout by sorting glyphs into 'columns'.
void SetMinDist(TSeqPos dist)
void SetLimitRowPerGroup(bool f)
CDataTrack - a abstract base class for layout tracks which need to deal with background data retrieva...
void SetRulerType(int ruler_types)
void SetProjectedFeat(bool f)
void SetConfig(CConstRef< CFeatureParams > conf)
const objects::CSeq_feat & GetFeature(void) const
Access the original feature.
CFeatListItem - basic configuration data for one "feature" type.
CConfigurableItems - a static list of items that can be configured.
bool GetItemBySubtype(int subtype, CFeatListItem &config_item) const
void GetSelected(TFeatTypeItemSet &feat_types)
void SetSelected(TFeatTypeItemSet &feat_types)
CGeneGroup is a subclass of CLayoutGroup contains gene, RNA, cds, and Exon features.
bool m_ShowNtRuler
Show nucleotide ruler.
bool m_ShowAaRuler
Show protein ruler.
void LoadSettings(CConstRef< CSeqGraphicConfig > g_conf, const string ®_path, const string &profile)
CRef< CCdsConfig > m_CdsConfig
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
CLayoutGroup & SetGroup()
CRef< CInlineLayout > m_Inline
const CLayoutGroup::TObjectList & GetChildren() const
const CLayoutGroup & GetGroup() const
CLayoutGroup::TObjectList & SetChildren()
CRef< CLayeredLayout > m_Layered
CRef< CSimpleLayout > m_Simple
void SetLayoutPolicy(ILayoutPolicy *policy)
Set policy on how to deploy the layout of its children.
static CGuiRegistry & GetInstance()
access the application-wide singleton
@ fNoHighlight
no highlighting on mouse over
@ fDrawBackground
highlight background for this area
@ fComment
render a label/comment on client side
@ fNoSelection
the object can't be selected
@ fTooltipEmbedded
tooltip embedded
string m_ID
area identifier
int m_Flags
area flags, will need to replace m_Type
string m_ParentId
parent entity idendifier, such as track_id
bool m_PositiveStrand
the default is true
static EScale ScaleStrToValue(const string &scale)
EScale m_Scale
requested scale
void SetDialogHost(IGlyphDialogHost *host)
void SetAnnotName(const string &name)
void SetConfig(const CSeqGraphicConfig &config)
CJobResultBase – the basic job result class holding a token.
CLayoutGroup is a container of CSeqGlyphs (layout objects).
void SetLayoutPolicy(ILayoutPolicy *policy)
Set policy on how to deploy the layout of its children.
void SetConfig(const CBoundaryParams *conf)
Set composition boundary parameters.
void PushBack(CSeqGlyph *obj)
Append a layout object to the end.
TObjectList & SetChildren()
const TObjectList & GetChildren() const
CLayoutGroup inline methods.
bool Remove(CSeqGlyph *obj)
Remove a layout object.
void Append(TObjectList &objs)
CConstRef< CSeqGlyph > GetChild(int idx) const
Get the layout object at index 'idx'.
void Insert(int at, CSeqGlyph *obj)
Insert a layout object before the given index.
void Set(const TObjectList &objs)
ILayoutPolicy::TObjectList TObjectList
@ eIcon_Content
icon id for setting content
@ eIcon_Layout
icon id for setting layout style
ILayoutTrackHost * m_LTHost
Top level host owning the tracks.
string GetTitle() const
get the track title.
TTrackAttrFlags m_Attrs
various track attributes
const string & GetId() const
virtual void x_OnIconClicked(TIconID id)
Mouse left-click event handler on an icon.
@ fNavigable
Track has navigation controls.
const string & GetProfile() const
TModelUnit x_GetTBHeight() const
Get title bar height including margin.
void SetMsg(const string &msg)
static void RegisterIconImage(const TIconAlias &key, const string &img_file)
register the image for an icon.
CConstRef< CSeqGraphicConfig > x_GetGlobalConfig() const
Method for getting global configuration from rendering context.
void SetProfile(const string &preset_style)
CLayoutTrack inline method implmentation.
CRef< CSeqGraphicConfig > m_gConfig
global configuration.
int TIconID
use int as TIconID instead of EIconID.
virtual CHTMLActiveArea * InitHTMLActiveArea(TAreaVector *p_areas) const
Initialize the HTML active area for a track.
void x_RegisterIcon(const SIconInfo &icon)
register track icons.
CMatePairConfig: the data structure holding alignment rendering parameters.
CRgbaColor m_FGOrientation
bool m_Dirty
Dirty flag indicates any unsaved changes.
CRgbaColor m_FGContraAlign
CRgbaColor m_SeqNonUnique
CGlTextureFont m_LabelFont
CRgbaColor m_SeqOrientation
CRgbaColor m_SeqMismatchNo
CRgbaColor m_SeqMismatchNonUnique
CRgbaColor m_SeqMismatchDistance
CRgbaColor m_SeqMismatchOrientation
TAlignList & SetSeqAligns()
vector< CRef< CAlignGlyph > > TAlignList
void SetConfig(CConstRef< CMatePairConfig > conf)
CTitleGroup is a layout group with a title.
void SetTitleFont(CGlTextureFont *font)
void SetBackgroundColor(const CRgbaColor &color)
void SetRepeatDist(int dist)
void SetRepeatTitle(bool f)
void SetTitleColor(const CRgbaColor &color)
void SetIndent(int indent)
void SetShowTitle(bool f)
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
double GetReal(const string &key, double default_val=0) const
bool GetBool(const string &key, bool default_val=false) const
string GetString(const string &key, const string &default_val=kEmptyStr) const
CConstRef< objects::CUser_field > GetField(const string &key) const
provide raw field access
void Set(const string &key, int val)
access a named key at this level, with no recursion
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
const TSeqRange & GetVisSeqRange() const
const TModelUnit & GetScale() const
TModelUnit SeqToScreen(const TModelUnit &size) const
convert from sequence positions to screen pixels
TModelUnit ScreenToSeq(const TModelUnit &size) const
convert from screen pixels to sequence positions
bool IsOverviewMode() const
bool WillSeqLetterFit() const
is it enougth space to sequence letters.
class CRgbaColor provides a simple abstraction for managing colors.
objects::CTSE_Handle m_DataHandle
void GetAnnotNames(objects::SAnnotSelector &sel, const TSeqRange &range, TAnnotNameTitleMap &names) const
const string & GetProteinScoringMethod() const
bool IsRangeCached(const TSeqRange &range) const
void SetEnableColoration(bool f)
bool GetEnableColoration() const
void SetDNAScoringMethod(const string &method)
bool GetLinkMatePairs() const
bool HasCoverageGraph() const
void SetSortBy(const string &sortby)
IAlnExplorer::EAlignType GetAlignType(const CSeqGlyph *obj) const
void LoadAlignments(const TSeqRange &range, TModelUnit window, int align_limit, bool smear_if_overlimit, TJobToken token)
void SetRemotePath(const string &remote_path)
void SetCgiMode(bool cgi_mode)
bool CanShowRange(const TSeqRange &range, int align_limit)
bool HasQualityMap() const
const string & GetSortBy() const
bool IsValidProteinScoringMethod(const string &name)
void LoadAlignFeats(const TSeqRange &range, TModelUnit window, vector< CRef< CAlignGlyph > > aligns, const vector< int > &projected_feats, TJobToken token)
void EnablePileUpCache(bool enable, bool enable_icache)
void SetLayoutPolicy(ILayoutPolicy *layout_policy)
const TMethods & GetScoringMethods(IAlnExplorer::EAlignType aln_type)
get all the existing align scoring methods.
virtual void DeleteAllJobs()
Remove waiting jobs from queue or cancel the unfinished jobs.
IAlnExplorer::EAlignType InitAlignType(bool isFastConfig=false)
This method might need object manager to connect to ID, and it is a block call.
void SetHasCoverageGraph(bool flag)
void SetUnalignedTailsMode(CAlignmentConfig::EUnalignedTailsMode tailsMode)
void SetAnnotName(const string &name)
list< CIRef< IScoringMethod > > TMethods
keep instances of score methods here.
bool IsCSRALoader() const
double GetAlignmentCost(const TSeqRange &range) const
void CalculateAlignmentScore(CSeqGlyph::TObjects &objs, TJobToken token)
void LoadCoverageGraph(const TSeqRange &range, TModelUnit window, TJobToken token)
bool IsValidDNAScoringMethod(const string &name)
double GetGraphCost(const TSeqRange &range) const
void SetHideSra(CAlignmentConfig::EHideSraAlignments hideSra)
void CalcAlnStat(const TAlnMgrVec &aligns, const TSeqRange &range, TModelUnit window, TJobToken token)
void SetMemoryLimit(Uint8 memory_limit)
vector< CConstRef< IAlnGraphicDataSource > > TAlnMgrVec
virtual void ClearJobID(TJobID job_id)
void SetProteinScoringMethod(const string &method)
void SetDataHandle(const objects::CTSE_Handle &tse)
void ResetAlnScoringJob()
const string & GetDNAScoringMethod() const
void SetShowSecondPassAlignments(bool value=true)
bool NeedReleaseMemory() const
void SetLinkMatePairs(bool f)
void SetAlnDataLoader(EDataLoader data_loader)
static const string & GetScoreName()
static CRegistryReadView GetSizeReadView(const CGuiRegistry ®, const string &base_key, const string §, const string &key, const string &def_sect="")
static void GetFont(const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
static string ComposeProfileString(const TKeyValuePairs &settings)
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 CRegistryReadView GetReadView(const CGuiRegistry ®, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
read/readwrite view creation helper methods.
static CRegistryReadView GetLabelPosReadView(const CGuiRegistry ®, const string &base_key, const string §, const string &key, const string &def_sect="")
static CRegistryWriteView GetWriteView(CGuiRegistry ®, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
static CRegistryWriteView GetLabelPosRWView(CGuiRegistry ®, const string &base_key, const string §, const string &key, const string &def_sect="")
static CRegistryWriteView GetColorRWView(CGuiRegistry ®, const string &base_key, const string §, const string &key, const string &def_sect="")
static void ParseProfileString(const string &profile_str, TKeyValuePairs &settings)
static CRegistryWriteView GetSizeRWView(CGuiRegistry ®, const string &base_key, const string §, const string &key, const string &def_sect="")
static void SetColor(CRegistryWriteView &view, const string &key, const CRgbaColor &color)
static void GetColor(const CRegistryReadView &view, const string &key, CRgbaColor &color)
static void SetFont(CRegistryWriteView &view, const string &face_key, const string &size_key, const CGlTextureFont &f)
static bool IsBackgroundJob()
void SetJobListener(CEventHandler *listener)
Set JobDispatcher listener.
void SetDepth(int depth)
Set the annotation selector resolving depth.
void SetAdaptive(bool flag)
void GetAnnotNames(objects::SAnnotSelector &sel, const TSeqRange &range, TAnnotNameTitleMap &names, bool seq_table=false) const
CSGJobResult – the data structure holding the seqgraphic job results.
static const CFeatList * GetFeatList()
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
void x_InitHTMLActiveArea(CHTMLActiveArea &area) const
initialize the basic information for a given active area.
CRenderingContext * m_Context
the rendering context
virtual void SetHeight(TModelUnit h)
void SetParent(CSeqGlyph *p)
void SetTearline(size_t Tearline)
tearline factor – used to limit a list of glyphs
virtual TModelUnit GetTop() const
virtual TModelUnit GetHeight() const
virtual void SetTop(TModelUnit b)
vector< CHTMLActiveArea > TAreaVector
list< CRef< CSeqGlyph > > TObjects
void SetRenderingContext(CRenderingContext *context)
Set the rendering context.
CRef< CHistParamsManager > GetHistParamsManager() const
Get histogram config manager.
const string & GetLabelPos() const
CRef< CGlTextureFont > GetCommentFont() const
bool GetRepeatComment() const
const string & GetSizeLevel() const
CConstRef< CFeatureParams > GetFeatParams(TFeatSubtype subtype) const
Get feature settings using a feature subtype.
const CRgbaColor & GetFGCommentColor() const
const CRgbaColor & GetBGCommentColor() const
bool GetShowComments() const
const string & GetColorTheme() const
int GetCommentRepeatDist() const
CSimpleLayout is the simpliest layout policy that simply stack a set of glyphs one on top of the othe...
@ eSort_BySeqPos
seq start position
void SetSortingType(TSortingMethod meth)
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
TBase::const_iterator const_iterator
const string & GetSortBy() const
const CLayoutTrack * GetTrack() const
static CRef< objects::CChoice > CreateChoice(const string &name, const string &disp_name, const string &curr_val, const string &help, bool optional=false)
static CRef< objects::CHiddenSetting > CreateHiddenSetting(const string &name, const string &value)
static CRef< objects::CCheckBox > CreateCheckBox(const string &name, const string &disp_n, const string &help_text, const string &legend_txt, bool value, bool optional=false)
static CRef< objects::CChoiceItem > CreateChoiceItem(const string &name, const string &disp_name, const string &help, const string &legend_txt, bool optional=false)
CTrackTypeInfo - holds description of a layout track type.
const string & GetDescr() const
const string & GetId() const
void SetDisplay(bool is_graph)
void SetContent(bool is_agtc)
void SetValueType(bool is_count)
void SetGraphHeight(int h)
int GetGraphHeight() const
Alignment explorer interface.
virtual const objects::CSeq_id & GetSeqId(TNumrow row) const =0
virtual bool IsColoringAvailable() const
IGlyphDialogHost An interface used for handling issues related to any dialog pops up that requires so...
virtual void PostDialogShow()=0
Post-processing after showing a dialog.
virtual void PreDialogShow()=0
Prepare for showing a dialog.
static void GetMatchedAnnots(const TAnnotMetaDataList &src_annots, const vector< string > &target_annots, const string &annot_type, const string &track_type, TAnnotNameTitleMap &out_annots)
Help function to find matched annotations.
virtual void LTH_PopupMenu(wxMenu *menu)=0
show track-specific context menu.
virtual void LTH_PushEventHandler(wxEvtHandler *handler)=0
virtual void LTH_OnLayoutChanged()=0
provides mouse coords in OpenGL viewport coord system
virtual void LTH_PopEventHandler()=0
ISGDSManager is seqgraphic data source manage that serves as an data source context.
virtual CIRef< ISGDataSource > GetDS(const string &type, SConstScopedObject &object)=0
Get a seqgraphic data source instance of the specified type.
virtual IAlnExplorer::TNumrow GetNumRows() const =0
virtual IAlnExplorer::TNumrow GetAnchor() const =0
iterator_bool insert(const value_type &val)
container_type::value_type value_type
iterator_bool insert(const value_type &val)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#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)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
void Warning(CExceptionArgs_Base &args)
bool IsSimplified() const
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
static bool IsAlignDb(const string &annot)
check if a given annotation is AlignDb (potentially suffixed with batch identication string after a '...
static void CreateCoverageAnnotName(const string &annot_name, string &coverage_annot)
const IAlnGraphicDataSource & GetAlignMgr(void) const
Inline methods.
static bool IsGeneModelFeature(int type, int subtype)
Does feature belong to gene model track Gene, RNA, cdregion, exon, C_region, and VDJ segments.
static bool IsUnnamed(const string &annot)
check if a given annotation is a unnamed annotation.
virtual const objects::CSeq_loc & GetLocation(void) const
access the position of this object.
static TAnnotNameType NameTypeStrToValue(const string &type)
void SetConfig(const CAlignmentConfig *conf)
@ eAnnot_Other
any given named annots
IRender & GetGl()
convenience function for getting current render manager
CRef< CObject > GetResult() const
returns non-null pointer only if Completed or Running and has temporary results available
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
TRange GetTotalRange(void) const
SAnnotSelector & SetCollectNames(bool value=true)
Collect available annot names rather than annots.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
position_type GetLength(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StringToBool(const CTempString str)
Convert string to bool.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
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 Uint8 StringToUInt8_DataSize(const CTempString str, TStringToNumFlags flags=0)
Convert string that can contain "software" qualifiers to Uint8.
static const string BoolToString(bool value)
Convert bool to string.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to 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.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ fWithCommas
Use commas as thousands separator.
static const char label[]
void SetFrom(TFrom value)
Assign a value to From data member.
void SetTo(TTo value)
Assign a value to To data member.
Tdata & Set(void)
Assign a value to data member.
unsigned int
A callback function used to compare two keys in a database.
range(_Ty, _Ty) -> range< _Ty >
double f(double x_, const double &y_)
EVT_MENU_RANGE(MID_SHOW_TITLES, MID_HIDE_TITLES, ViewerWindowBase::OnTitleView) EVT_MENU_RANGE(MID_ENABLE_EDIT
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
static const char * str(char *buf, int n)
A help struct for storing information about a icon.
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
void UseDefaultMarginWidth(wxMenu &menu)
Using default menu item margin width.
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)