110 objects::CBioseq_Handle handle,
111 const objects::SAnnotSelector& sel,
117 , m_SmearOverLimit(
false)
119 , m_LoadCoverageGraph(
true)
122 , m_ShowSecondPass(
true)
123 , m_MaxStartTail(maxStartTail)
124 , m_MaxEndTail(maxEndTail)
130 objects::CBioseq_Handle handle,
131 const objects::SAnnotSelector& sel,
133 int align_limit,
bool smear_if_overlimit,
138 , m_AlignLimit(align_limit)
139 , m_SmearOverLimit(smear_if_overlimit)
140 , m_LinkPair(link_pair)
141 , m_LoadCoverageGraph(
false)
144 , m_ShowSecondPass(
true)
145 , m_MaxStartTail(maxStartTail)
146 , m_MaxEndTail(maxEndTail)
151 objects::CBioseq_Handle handle,
152 const objects::SAnnotSelector& sel,
161 , m_SmearOverLimit(
false)
163 , m_LoadCoverageGraph(
false)
166 , m_ShowSecondPass(
true)
167 , m_MaxStartTail(maxStartTail)
168 , m_MaxEndTail(maxEndTail)
174 objects::SAnnotSelector& sel,
177 sel.SetCollectNames();
180 if (iter->IsNamed()) {
181 if (iter->GetName().find(
"@@") == string::npos) {
194 if (sort_by.empty())
return;
196 size_t found = sort_by.find_first_of(
'|');
198 transform(sorter_type.begin(), sorter_type.end(), sorter_type.begin(), ::
tolower);
200 if (found != string::npos) {
201 sort_str = sort_by.substr(found + 1);
209 objects::SAnnotSelector& sel,
210 bool& has_quality_map,
215 sel.SetCollectNames(
false);
235 if (num_row < 2)
return type;
237 CScope& scope = handle.GetScope();
240 for (
int row = 0;
row < num_row; ++
row) {
245 if ( !row_handle )
continue;
249 case objects::CSeq_inst::eMol_dna:
250 case objects::CSeq_inst::eMol_rna:
251 case objects::CSeq_inst::eMol_na:
255 case objects::CSeq_inst::eMol_aa:
270 }
else if (this_type !=
type) {
279 for (
int row = num_row - 1;
row >= 0; --
row) {
292 if (graph_iter && graph_iter.
GetSize() == 1) {
293 has_quality_map =
true;
317 if (!(*iter)->GetType().IsStr())
340 id_str =
id.GetStr();
353 const string& expect_mate_ti =
"")
376 if ((*iter)->GetType().IsStr() &&
377 (*iter)->GetType().GetStr() ==
"Secondary") {
386 while (ti.empty() &&
i >=0) {
402 size_t len = ti.size();
403 mate_ti = ti.substr(0,
len - 1) + (ti[
len-1] ==
'1' ?
"2" :
"1");
404 }
else if (align.
IsSetExt() && !ti.empty()) {
406 if ((*iter)->GetType().IsStr() &&
407 (*iter)->GetType().GetStr() ==
"Secondary") {
410 if ((*iter)->GetType().IsStr() &&
411 (*iter)->GetType().GetStr() ==
"Mate read") {
425 if (mate_ti.empty()) {
428 size_t len = ti.size();
429 const char last_second_c = ti[
len-2];
430 const char last_c = ti[
len-1];
431 if (last_second_c ==
'.' && (last_c ==
'1' || last_c ==
'2')) {
432 mate_ti = ti.substr(0,
len - 1) + (last_c ==
'1' ?
"2" :
"1");
436 if (mate_ti.empty()) {
447 if (
id.IsGeneral() &&
448 (
id.GetGeneral().GetDb() ==
"ti" ||
449 id.GetGeneral().GetDb() ==
"TRACE")) {
450 if (
id.GetGeneral().GetTag().IsId()) {
453 ti =
id.GetGeneral().GetTag().GetStr();
471 if (!expect_mate_ti.empty() && mate_ti != expect_mate_ti) {
492 result->m_Results.push_back(single_res);
505 }
catch (std::exception& ex) {
559 if (upper_limit <= 0) {
596 if (account_for_tails) {
598 std::unique_ptr<CAlign_CI> extended_align_iter;
602 TSeqRange extendedRange(ext_from > 0 ? ext_from : 0, ext_to < bs_len ? ext_to : bs_len);
604 obj_size = (
int)extended_align_iter->GetSize();
605 status =
x_GetAlignments(objs, *(extended_align_iter.get()),
true,
true);
645 seq_loc->
SetId(aligned_seq);
657 for ( ; feat_iter; ++feat_iter) {
666 main_features.push_back(fref);
670 other_features.push_back(g_glyph);
677 feature::CFeatTree::eFeatId_by_type,
this) ||
682 std::copy(other_features.begin(), other_features.end(),
691 if ( !
tmp.empty() ) {
714 feat =
new CCdsGlyph(mapped_feat, *mapped_loc);
717 feat =
new CFeatGlyph(mapped_feat, *mapped_loc);
725 int aligned_seq = anchor == 0 ? 1 : 0;
738 id->Assign(aln_mgr.
GetSeqId(aligned_seq));
743 auto anchor_loc = aln_mapper_up.
Map(*lit.GetRangeAsSeq_loc());
744 if (anchor_loc->IsNull())
746 auto mapped_loc = aln_mapper_down.
Map(*anchor_loc);
749 aligned_loc->
Add(*mapped_loc);
755 auto aligned_segment = lit.GetRangeAsSeq_loc();
756 auto anchor_loc = aln_mapper_up.
Map(*aligned_segment);
757 if (anchor_loc->IsNull()) {
761 auto prod_loc = prod_mapper.
Map(*aligned_segment);
762 if (prod_loc->IsNull()) {
767 auto prod_range = prod_loc->GetTotalRange();
768 auto prod_from = prod_range.GetFrom();
769 auto prod_to = prod_range.GetTo();
775 auto gen_loc = aln_mapper_down.
Map(*anchor_loc);
797 if (offset_from > 0) {
801 if (offset_from == 2) {
815 if (offset_to == 1) {
832 auto prod_mapped = prod_mapper_up->Map(*prod_loc);
833 if (prod_mapped->IsNull()) {
839 auto diff_loc = prod_mapped->Subtract(*aligned_segment, 0,
nullptr,
nullptr);
844 if (g_l.
GetRange().
GetFrom() > aligned_segment->GetTotalRange().GetTo())
846 else if (g_l.
GetRange().
GetTo() < aligned_segment->GetTotalRange().GetFrom())
849 if (g_l.
GetRange().
GetTo() < aligned_segment->GetTotalRange().GetFrom())
851 else if (g_l.
GetRange().
GetFrom() > aligned_segment->GetTotalRange().GetTo())
861 if (offset_from > 0) {
865 if (offset_from == 2) {
867 prod_to -= offset_from;
868 prod_range.SetTo(prod_range.GetTo() - 1);
870 prod_from += offset_from;
871 prod_range.SetFrom(prod_range.GetFrom() + 1);
875 prod_to -= offset_from;
877 prod_from += offset_from;
887 prod_from -= offset_to;
889 prod_to += offset_to;
920 prod_int->
SetFrom(prod_range.GetFrom());
921 prod_int->
SetTo(prod_range.GetTo());
922 prod_int->
SetStrand(prod_loc->GetStrand());
923 prod_int->
SetId().Assign(*prod_loc->GetId());
928 gen_int->
SetFrom(aligned_segment->GetTotalRange().GetFrom());
929 gen_int->
SetTo(aligned_segment->GetTotalRange().GetTo());
930 gen_int->
SetStrand(aligned_segment->GetStrand());
936 anchor_loc->GetTotalRange(),
TSeqRange(prod_from, prod_to)));
947 for ( ; iter; ++iter) {
948 intervals.push_back(iter.
GetRange());
970 if ( !glyph )
continue;
973 (*iter)->GetFeature().GetData().GetSubtype();
974 if ((*iter)->GetChildren().empty()) {
976 if ( !global_exon_group ) {
981 objs.push_back(glyph);
994 if ( !c_glyph )
continue;
996 subtype = (*c_iter)->GetFeature().GetData().GetSubtype();
1021 if (global_exon_group) {
1022 if (objs.size() == 1 &&
dynamic_cast<CGeneGroup*
>(objs.front().GetPointer())) {
1024 if (global_exon_group->
GetChildren().size() == 1) {
1030 if (global_exon_group->
GetChildren().size() == 1) {
1031 objs.push_back(global_exon_group->
SetChildren().front());
1091 bool match_id =
false;
1095 if ((*descrIter)->IsUser() &&
1096 (*descrIter)->GetUser().GetType().IsStr() &&
1097 (*descrIter)->GetUser().GetType().GetStr() ==
"Mate read") {
1099 (*descrIter)->GetUser().
GetFieldRef(
"Match by local Seq-id");
1114 int reciprocity = 0;
1115 return align.
GetNamedScore(
"reciprocity", reciprocity) && reciprocity != 3;
1125 bool match_id =
false;
1135 auto synonyms =
m_Handle.GetSynonyms();
1137 for (; align_iter; ++align_iter) {
1155 vector<CSeq_align::TDim> anchors;
1175 x_CreateCAlignGlyph(objs, align, align_handle, aln_datasources, mated_aligns, match_id, flag, filterResults);
1190 if (!iter->second.first) {
1197 const string& ti = iter->first;
1198 string mate_ti = iter->second.second;
1205 if (mate_iter == mated_aligns.
end()) {
1211 CSeq_id id(
"gnl|ti|" + mate_ti);
1217 for (; second_mate_iter; ++second_mate_iter) {
1220 temp, mate_ti, ti)) {
1227 vector<CSeq_align::TDim> anchors;
1231 if (!aln_datasources.empty()) {
1234 aln_datasources.front().first, orig_align, align,
1250 }
else if (!mate_iter->second.first) {
1254 second_mate = mate_iter->second.first;
1255 mate_iter->second.first.
Reset();
1259 als.emplace_back(&first_mate);
1264 if (!objs_to_remove.
empty()) {
1266 return objs_to_remove.count(glyph.GetPointer()) > 0;
1268 objs.erase(remove_begin, objs.end());
1269 move(mated_objs.begin(), mated_objs.end(), back_inserter(objs));
1275 TAlignGroupMap sorted_aligns;
1282 sorted_aligns[idx].push_back(*iter);
1285 if (sorted_aligns.size() > 1) {
1288 for (
auto const& group : sorted_aligns) {
1289 sorted_groups[
m_Sorter->GroupIdxToName(group.first)] = group.first;
1291 for (
auto const& group : sorted_groups) {
1300 for (
auto& o : objs) {
1302 o->SetWidth(
range.GetLength());
1303 o->SetLeft(
range.GetFrom());
1313 return !glyph->GetVisible();
1315 objs.erase(remove_begin, objs.end());
1323 vector<CSeq_align::TDim> anchors;
1324 auto synonyms =
m_Handle.GetSynonyms();
1377 vector<CSeq_align::TDim> anchors;
1378 auto synonyms =
m_Handle.GetSynonyms();
1386 for (
const auto& exon_it : const_exons) {
1387 TSeqRange exon_rng = exon_it->GetRowSeq_range(anchors[0],
true);
1389 if (!ranges_str.empty()) {
1390 ranges_str +=
" , ";
1399 for (
const auto& exon_it : const_exons) {
1400 TSeqRange exon_rng = exon_it->GetRowSeq_range(anchors[0],
true);
1408 auto& exons = new_align->
SetSegs().SetSpliced().SetExons();
1410 auto& exon = **iter;
1411 TSeqRange exon_range(exon.GetGenomic_start(), exon.GetGenomic_end());
1412 if (exon_range != exon_rng) {
1427 for (
auto& it : align_ds) {
1428 it.first->SetCrossOrigin(
true);
1429 it.first->SetCrossOriginRange(ranges_str);
1432 x_CreateCAlignGlyph(objs, *new_align, align_handle, align_ds, mated_aligns, match_id, flag, filterResults);
1441 for (
size_t i = 0;
i < aln_datasources.size(); ++
i) {
1442 int anchor = aln_datasources[
i].second;
1443 auto& aln_datasource = aln_datasources[
i].first;
1445 if (filterResults) {
1446 TSeqRange aln_range = aln_datasource->GetAlnRangeWithTails();
1455 auto align_glyph =
Ref(
new CAlignGlyph(aln_datasource, align_handle, align, anchor));
1456 objs.emplace_back(align_glyph.GetPointer());
1464 mated_aligns.emplace(ti, make_pair(align_glyph, mate_ti));
1486 result->m_ObjectList.swap(glyphs);
1500 , m_AlnScoreMap(scores)
1519 if ( !score->HasScores() ) {
1520 score->CalculateScores();
1532 objects::CBioseq_Handle handle,
1533 const objects::SAnnotSelector& aln_sel,
1534 const objects::SAnnotSelector& graph_sel,
1538 const string& cache_key)
1540 , m_GraphSel(graph_sel)
1543 , m_CacheKey(cache_key)
1567 if (iter != sm_GraphTitleMap.end()) {
1568 return (
size_t)iter->second;
1577 for (iter = sm_GraphTitleMap.begin(); iter != sm_GraphTitleMap.end(); ++iter) {
1578 if ((
size_t)iter->second == idx) {
1597 vector<unsigned char> ref_bases;
1607 ref_len = seq_str.length();
1608 if (ref_len < stop - start) {
1609 stop = start +
static_cast<TSeqPos>(ref_len);
1611 ref_bases.resize(ref_len);
1612 for (
size_t i = 0;
i < ref_len; ++
i) {
1618 loc->
SetInt().SetFrom(start);
1619 loc->
SetInt().SetTo(stop - 1);
1620 range.Set(start, stop - 1);
1622 loc->
SetId(*seq_id);
1624 vector<CRef<CSeq_graph>> graphs;
1631 g->SetGraph().SetInt().SetValues().resize(ref_bases.size(), 0);
1654 anchor_start =
max(anchor_start, start);
1655 anchor_stop =
min(anchor_stop, stop - 1);
1656 if ((*iter)->IsSimplified()) {
1659 vector<int>& match_vals =
1662 if (anchor_start < start) anchor_start = start;
1663 if (anchor_stop > stop) anchor_stop = stop;
1664 while (anchor_start <= anchor_stop) {
1665 size_t curr_pos = anchor_start - start;
1666 vector<int>& ref_vals =
1667 graphs[ref_bases[curr_pos]]->SetGraph().SetInt().SetValues();
1668 ref_vals[curr_pos]++;
1669 match_vals[curr_pos]++;
1676 if (aln_r_e < aln_r_s)
1677 swap(aln_r_s, aln_r_e);
1688 unique_ptr<IAlnSegmentIterator> p_it(
1702 if (curr_aln_r.
Empty())
1710 if (curr_seq_from > curr_seq_to)
1711 swap(curr_seq_from, curr_seq_to);
1716 if (curr_seq_from < start) {
1717 pos = start - curr_seq_from;
1719 off = curr_seq_from - start;
1721 size_t curr_pos = off;
1736 0,
static_cast<TSeqPos>(aln_seq.length()), tmp_seq);
1737 swap(tmp_seq, aln_seq);
1740 while (pos < seg_len && curr_pos < ref_len) {
1745 if (pos < aln_seq.size()) {
1748 graphs[base_type]->SetGraph().SetInt().SetValues();
1749 vals[curr_pos] += 1;
1752 (base_type == ref_bases[curr_pos])) {
1753 vector<int>& m_vals =
1755 m_vals[curr_pos] += 1;
1762 if (pos < aln_seq.size()) {
1767 vals[curr_pos] += 1;
1772 vals[curr_pos] += 1;
1782 for (
const auto& gr : graphs) {
1783 graphs_out.emplace_back(gr.GetPointer());
1802 gaps.reserve(batch_size);
1845 vector<CPileUpGraph::TValType>
gaps;
1898 size_t val_num = (size_t)(stop - start);
1899 bool match_graph =
false;
1913 for (; graph_iter; ++graph_iter) {
1915 if (g_idx == (
size_t)-1)
1918 const auto&
range = gr.GetLoc().GetTotalRange();
1920 if (it == groups.
end())
1922 it->second[g_idx] = &gr;
1928 if (groups.
empty()) {
1945 if (!graphs.empty())
1946 groups.emplace(
range, graphs);
1957 double window = stat_collector.
GetWindow();
1959 if (window < 1.0) window = 1.0;
1960 size_t pix_num = (size_t)ceil(val_num / window);
1963 if (graph.
IsInt()) {
1965 val = vals[curr_idx];
1968 val = (
int)(
unsigned char)(vals[curr_idx]);
1974 size_t curr_start, curr_idx, num_vals, ref_idx, stat_idx, end_idx;
1979 for (
const auto& group : groups) {
1980 const auto&
range = group.first;
1981 const auto& graphs = group.second;
1982 curr_start = max<int>(main_range.
GetFrom(),
range.GetFrom());
1983 curr_idx = curr_start -
range.GetFrom();
1984 num_vals =
range.GetLength();
1985 stat_collector.
NewGroup(
static_cast<int>(num_vals));
1990 curr_pos = (double)(curr_start - main_range.
GetFrom());
1991 stat_idx = (size_t)floor(curr_pos / window);
1994 for (; stat_idx < pix_num && curr_idx < num_vals; ++stat_idx) {
1999 end_idx = min<size_t>(floor(curr_pos + 0.5) - graph_off, num_vals);
2007 for (; curr_idx < end_idx; ++curr_idx, ++ref_idx) {
2012 auto matches = (match_graph && graphs[g_idx]) ?
2013 l_GetVal(graphs[g_idx]->GetGraph(),
static_cast<int>(curr_idx)) : 0;
2014 if (ref_idx < ref_seq_str.size()) {
2018 matches = tmp_stat.
m_Data[base_type];
2019 else if (tmp_stat.
m_Data[base_type] == 0) {
2020 tmp_stat.
m_Data[base_type] = matches;
2025 }
else if (graphs[g_idx]) {
2026 tmp_stat.
m_Data[g_idx] = l_GetVal(graphs[g_idx]->GetGraph(),
static_cast<int>(curr_idx));
2029 stat_collector.
AddStat(stat_idx, tmp_stat);
2050 vector<TSeqRange> missing_ranges;
2052 bool update_data = !missing_ranges.empty();
2054 if (!
data->IsCacheGood()) {
2067 mutex data_handle_lock;
2068 for (
auto&
range : missing_ranges) {
2069 results.emplace_back(async(launch::async, [&](){
2074 lock_guard<mutex> guard(data_handle_lock);
2075 result->m_DataHandle = tse_handle;
2084 if (num_reads == 0) {
2089 result->m_DataHandle = tse_handle;
2091 if (num_reads != 0) {
2093 string err_msg =
"failure at "
2097 diag.Print(
"graph_cache_integrity", err_msg);
2098 ERR_POST(
Error <<
"GraphCache integrity check: " << err_msg);
2106 stat_glyph->ShowIntrons();
2111 }
catch (exception& e) {
2122 stats.resize(pix_num);
2126 stat_glyph->ShowIntrons();
2128 result->m_DataHandle = tse_handle;
2139 if (align_iter.
GetSize() == 0)
2146 auto synonyms =
m_Handle.GetSynonyms();
2147 for ( ; align_iter; ++align_iter) {
2151 vector<CSeq_align::TDim> anchors;
2163 for (
size_t i = 0;
i < aln_datasources.size(); ++
i) {
2164 auto& aln_datasource = aln_datasources[
i].first;
2165 m_Aligns.push_back(aln_datasource);
2180 auto& ids = handle.
GetId();
2184 for (
auto&
id : ids) {
2185 if (
id.
GetSeqId()->Match(row_id)) {
2186 anchors.push_back(
row);
2190 if (anchors.empty() && synonyms) {
2193 for (
size_t level = 0; level <= 5 && anchors.empty(); ++level) {
2200 anchors.push_back(
row);
2213 if (aln_set.empty())
2215 if (!aln_set.front()->GetSegs().IsDenseg())
2219 CDense_seg& new_ds = new_sa->SetSegs().SetDenseg();
2220 auto dim = aln_set.front()->
GetDim();
2223 new_ds.
SetIds() = aln_set.front()->GetSegs().GetDenseg().GetIds();
2224 for (
size_t j = 0; j < aln_set.size(); ++j) {
2225 for (
auto i = 0;
i < dim; ++
i) {
2226 new_ds.
SetStrands().push_back(aln_set.front()->GetSeqStrand(
i));
2230 vector<int> prev_start(dim, -1);
2231 for (
auto it : aln_set) {
2232 auto len = it->GetSeqRange(anchor_row).GetLength();
2234 for (
auto i = 0;
i < dim; ++
i) {
2235 auto r = it->GetSeqRange(
i);
2236 auto from = max<int>(prev_start[
i],
r.GetFrom());
2238 prev_start[
i] = from +
len;
2243 new_sa->Validate(
true);
2244 }
catch (exception& e) {
2246 new_sa.Reset(
nullptr);
2253 vector<CSeq_align::TDim>& anchors,
2260 data_sources.clear();
2263 if (anchors.empty())
2270 bool self_alignment =
false;
2271 if (num_row == (
int)anchors.size()) {
2274 self_alignment =
true;
2277 bool exact_self_aligned =
true;
2281 exact_self_aligned =
false;
2290 if (exact_self_aligned) {
2292 anchors.push_back(0);
2298 if (align.
CheckNumRows() == 2 && (anchors.size() == 1 || self_alignment)) {
2302 ITERATE(vector<CSeq_align::TDim>, row_iter, anchors) {
2315 const vector< CRef< CSeq_loc > >& locs =
2318 if (locs[0]->IsInt() && locs[1]->IsInt()) {
2319 TSeqPos len1 = locs[0]->GetTotalRange().GetLength();
2320 TSeqPos len2 = locs[1]->GetTotalRange().GetLength();
2321 if (len1 != len2 && len1 != 3 * len2 && len2 != 3 * len1) {
2341 auto& new_aln_list = new_aln_set->Set();
2344 bool is_minus = orig_aln_list.front()->GetSeqStrand(anchor_row) ==
eNa_strand_minus;
2345 function<void(
CSeq_align*)> add_to_front = [&new_aln_list](
CSeq_align* aln) { new_aln_list.emplace_front(aln); };
2346 function<void(
CSeq_align*)> add_to_back = [&new_aln_list](
CSeq_align* aln) { new_aln_list.emplace_back(aln); };
2347 auto add_to_list = is_minus ? add_to_front : add_to_back;
2351 auto r = aln->GetSeqRange(anchor_row);
2352 auto seq_align =
const_cast<CSeq_align*
>(aln.GetPointer());
2353 if (
r.GetTo() <
range->GetFrom()) {
2357 else if (
range->IntersectingWith(
r)) {
2362 add_to_list(seq_align);
2364 else if (
r.GetFrom() >
range->GetTo()) {
2369 add_to_list(seq_align);
2376 all_of(orig_aln_list.rbegin(), orig_aln_list.rend(), splice_alignment);
2379 all_of(orig_aln_list.begin(), orig_aln_list.end(), splice_alignment);
2381 auto prev_size = new_aln_list.size();
2388 if (prev_size > 300) {
2390 if (compressed_aln) {
2399 if (!new_aln_list.empty() && new_aln_list.size() < orig_aln_list.size()) {
2402 swap(new_align->SetSegs().SetDisc().Set(), new_aln_set->Set());
2403 align_ref.
Reset(&*new_align);
2417 if ( !data_sources.empty() )
2420 bool report_overlaps =
false;
2423 ITERATE (vector<CSeq_align::TDim>, row_iter, anchors) {
2427 typedef vector<const objects::CSeq_align*>
TAlnVector;
2432 aln_container.
insert(*align_ref);
2457 for (
size_t aln_idx = 0; aln_idx < aln_stats.
GetAlnCount(); ++aln_idx) {
2460 if ( anchored_aln ) {
2461 anchored_aln_vec.push_back(anchored_aln);
2465 anchored_aln->
SetScore() += rng_it->GetLength();
2472 if (self_alignment) {
2478 BuildAln(anchored_aln_vec, *out_aln, aln_user_options);
2479 anchored_aln_vec.clear();
2480 anchored_aln_vec.push_back(out_aln);
2483 bool has_overlaps =
false;
2484 auto& anchored_aln = **a_iter;
2492 _ASSERT(anchored_aln.GetDim() > 1);
2493 if (anchored_aln.GetDim() < 2) {
2496 <<
"Something is wrong with the alignment. It has only one row.");
2500 report_overlaps =
true;
2502 if (has_overlaps || anchored_aln.GetPairwiseAlns()[0]->GetSecondBaseWidth() == -1) {
2511 if (sparse_aln->
GetDim() < 2) {
2514 <<
"Something is wrong with the alignment. Create CSparseAln has only one row.");
2526 mix.
Add(*align_ref);
2536 if (report_overlaps) {
2537 LOG_POST(
Warning <<
"Coloring is not supported for alignment with overlapping segments");
2540 for_each(data_sources.begin(), data_sources.end(), [&alignment_partiality](
TAlnDS_Anchor& dsa){
2541 dsa.first->SetPartialFlags(alignment_partiality);
User-defined methods of the data storage class.
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_Biological
5' and 3'
static void s_ObjectIdToStr(const CObject_id &id, string &id_str)
static const double kDetailsZoomLevel
Scale at which align details are made visible Align details: unaligned tails, mate pairs.
static const TGraphTitle s_GraphTitles[]
SStaticPair< const char *, CAlnStatConfig::EStatType > TGraphTitle
layout style to layout display name
static const int kMaxAlignmentLoaded
maximal number of alignments allowed to load to avoid potential memery and performance problem.
void GetAnchors(CBioseq_Handle &handle, const CSynonymsSet *synonyms, const CSeq_align &align, vector< CSeq_align::TDim > &anchors)
const string & s_GraphIndexToTitle(size_t idx)
static CRef< CSeq_align > s_CompressDiscToDenseq(list< CRef< CSeq_align >> &aln_set, int anchor_row)
static bool s_IsMatchById(CConstRef< CSeq_annot > aln_annot)
size_t s_GraphTitleToIndex(const string &title)
static bool s_IsSecondPassAlignment(const CSeq_align &align)
DEFINE_STATIC_ARRAY_MAP(TGraphTitleMap, sm_GraphTitleMap, s_GraphTitles)
CStaticArrayMap< string, CAlnStatConfig::EStatType > TGraphTitleMap
void BuildAlignDataSource(CBioseq_Handle &handle, vector< CSeq_align::TDim > &anchors, const CSeq_align &align, bool sparseAln, TModelUnit window, TAlnDataSources &data_sources, CRange< TSeqPos > *range)
static bool s_CheckTraceMateAlign(bool match_id, bool is_bam_align, const CSeq_align &align, string &ti, string &mate_ti, const string &expect_mate_ti="")
static const double kSequenceZoomLevel
always show individual alignments when zoom level is below this threshold.
pair< CRef< IAlnGraphicDataSource >, int > TAlnDS_Anchor
CSGAlignmentJob.
vector< TAlnDS_Anchor > TAlnDataSources
void BuildAln(TAnchoredAlnVec &in_alns, CAnchoredAln &out_aln, const CAlnUserOptions &options, TAlnSeqIdIRef pseudo_seqid=TAlnSeqIdIRef())
Build anchored alignment from a set of alignmnets.
CRef< CAnchoredAln > CreateAnchoredAlnFromAln(const _TAlnStats &aln_stats, size_t aln_idx, const CAlnUserOptions &options, objects::CSeq_align::TDim explicit_anchor_row=-1)
Create an anchored alignment from Seq-align using hints.
CAlnStats< TAlnIdMap > TAlnStats
Default implementations for alignment stats.
vector< const CSeq_align * > TAlnVector
CAlnIdMap< vector< const CSeq_align * >, TIdExtract > TAlnIdMap
Default implementations of CAlnIdMap.
void remove_if(Container &c, Predicate *__pred)
void transform(Container &c, UnaryFunction *op)
Checksum and hash calculation classes.
bool IsSet(int flags) const
static IAlignSorter * CreateAlignSorter(std::string const &sort_by, std::string const &sort_str)
const_iterator insert(const CSeq_align &seq_align)
Insert new CSeq_align into the list.
size_type size(void) const
Container mapping seq-aligns to vectors of participating seq-ids.
void push_back(const CSeq_align &aln)
Adding an alignment.
void SetAnchor(TNumrow anchor)
void Add(const CDense_seg &ds, TAddFlags flags=0)
void Merge(TMergeFlags flags=0)
const CDense_seg & GetDenseg(void) const
static int GetRefSeqIdex(char base)
@ eStat_Intron
intron (for mRNA-to-genome alignments)
@ eStat_Mismatch
mismatches (A+G+T+C - matches)
@ eStat_Total
total alignment count at this base (A+G+T+C+Gap)
vector< SStatStruct > TStatVec
Helper class which collects seq-align statistics: seq-ids participating in alignments and rows,...
size_t GetAlnCount(void) const
How many alignments do we have?
Options for different alignment manager operations.
@ ePreserveRows
Preserve all rows as they were in the input (e.g.
@ eBothDirections
No filtering: use both direct and reverse sequences.
CAlnVecGraphicDataSource - implementation of CAlnGraphicDataSource for CAlnVec-based alignments.
Query-anchored alignment can be 2 or multi-dimentional.
const TPairwiseAlnVector & GetPairwiseAlns(void) const
The vector of pairwise alns.
TDim GetDim(void) const
How many rows.
void SetScore(int score)
Set the total score.
Seq-loc and seq-align mapper exceptions.
const TAnnotNames & GetAnnotNames(void) const
size_t GetSize(void) const
CSeq_annot_Handle GetAnnot(void) const
CAppJobError Default implementation for IAppJobError - encapsulates a text error message.
CBatchJobResult – the data structure holding the seqgraphic job results for a batch job processing.
TNumseg CheckNumSegs(void) const
bool IsSetWidths(void) const
This class is intended to be used for pairwised dense-seg seq-align to replace CSparseAlnGraphicDataS...
void SetColoringAvailable(bool v=true)
TIntervals & SetIntervals()
CFeatGlyph inline implementations.
virtual const objects::CSeq_loc & GetLocation(void) const
access the position of this object.
void SetProjectedMappingInfo(const CProjectedMappingInfo &info)
CGeneGroup is a subclass of CLayoutGroup contains gene, RNA, cds, and Exon features.
void SaveData(CRef< TData > data)
Clones TData, puts it into Save Queue for asynchroneous storage operation.
void RemoveData(const string &data_key)
Removes Data from in-memory cache.
CRef< TData > GetData(const string &data_key)
Retrieves TData from in-memory cache or if not found calls TData::Init to initialize new TData instan...
static CGraphCache & GetInstance()
CAlnStatGlyph::TStatVec & m_Stats
CGraphStatCollector_Glyph(double window, CAlnStatGlyph::TStatVec &stats)
virtual void AddStat(size_t index, CAlnStatGlyph::SStatStruct &stat) override
virtual void UpdateGroup(size_t offset) override
virtual bool ComputePileUp() override
virtual void NewGroup(int batch_size) override
vector< CPileUpGraph::TValType > matches
vector< CPileUpGraph::TValType > mismatches
virtual void AddStat(size_t index, CAlnStatGlyph::SStatStruct &stat) override
CGraphStatCollector_Graph(double window, CPileUpGraph &data)
vector< CPileUpGraph::TValType > introns
vector< CPileUpGraph::TValType > gaps
virtual void ClearRange(const TSeqRange &range) override
CGraphStatCollector Helper class to use with CSGAlignStatJob::x_CollectAlignStats x_CollectAlignStats...
virtual bool ComputePileUp()
virtual void ClearRange(const TSeqRange &range)
virtual void AddStat(size_t index, CAlnStatGlyph::SStatStruct &stat)=0
virtual void UpdateGroup(size_t offset)
virtual void NewGroup(int batch_size)
CJobResultBase – the basic job result class holding a token.
CLayoutGroup is a container of CSeqGlyphs (layout objects).
void PushBack(CSeqGlyph *obj)
Append a layout object to the end.
TObjectList & SetChildren()
const TObjectList & GetChildren() const
CLayoutGroup inline methods.
void Append(TObjectList &objs)
vector< CRef< CAlignGlyph > > TAlignList
CTitleGroup is a layout group with a title.
A pairwise aln is a collection of ranges for a pair of rows.
void SetAlignmentDataSource(const IAlnGraphicDataSource &align_ds)
CProjectedMappingInfo inline methods.
CSGAlignScoringJob(const string &desc, const TAlnScoreMap &scores)
CSGAlignScoringJob.
virtual EJobState x_Execute()
method truly doing the job.
TAlnScoreMap m_AlnScoreMap
EJobState x_LoadAlignments(objects::CTSE_Handle &tse_handle)
EJobState x_CollectAlignStats(const TSeqRange &main_range, objects::CTSE_Handle &tse_handle, CGraphStatCollector &stat_collector)
vector< CConstRef< IAlnGraphicDataSource > > TAlnMgrVec
objects::SAnnotSelector m_GraphSel
pileup graph selector
string m_CacheKey
Graph cache key calculated by alignment ds.
TModelUnit m_Window
current zoom scale
CSGAlignStatJob(const string &desc, objects::CBioseq_Handle handle, const objects::SAnnotSelector &aln_sel, const objects::SAnnotSelector &graph_sel, const TSeqRange &range, const TAlnMgrVec &aligns, TModelUnit scale, const string &cache_key)
CSGAlignStatJob.
IAlnGraphicDataSource::TNumrow TNumrow
vector< CConstRef< objects::CSeq_graph > > TGraphs
virtual EJobState x_Execute()
method truly doing the job.
void x_CreatePileUpGraphs(TSeqRange &range, TGraphs &graphs)
void x_UpdateMaxTails(const IAlnGraphicDataSource &aln_datasource)
CIRef< ILayoutPolicy > m_LayoutPolicy
CAlignmentConfig::EUnalignedTailsMode m_UnalignedTailsMode
Flag, indicating whether and how to display unaligned tails.
void x_CreateCAlignGlyph(CSeqGlyph::TObjects &objs, const objects::CSeq_align &align, const objects::CSeq_align_Handle &align_handle, const TAlnDataSources &aln_datasources, TMatedAlignments &mated_aligns, bool match_id, CSGAlignmentJob::EAlignFlags flag, bool filterResults)
EJobState x_LoadAlignments()
CRef< CSGJobResult > x_LoadAlignmentFeats(CAlignGlyph &align)
CAlignmentConfig::EHideSraAlignments m_HideSra
Flag, indicating whether to hide duplicates and/or bad reads.
static void GetAnnotNames(const objects::CBioseq_Handle &handle, const TSeqRange &range, objects::SAnnotSelector &sel, TAnnotNameTitleMap &names)
int m_AlignLimit
max number of alignments to load.
bool x_CreateGeneModels(objects::CSeq_loc_Mapper &mapper, CLinkedFeature::TLinkedFeats &feats, CSeqGlyph::TObjects &objs, CAlignGlyph &align) const
IAppJob::EJobState x_GetAlignments(CSeqGlyph::TObjects &objs, objects::CAlign_CI &align_iter, bool sparseAln, bool filterResults=false)
EAlignFlags
Request a list of alignments from a bioseq.
static IAlnExplorer::EAlignType GetAlignType(const objects::CBioseq_Handle &handle, objects::SAnnotSelector &sel, bool &has_quality_map, bool isFastConfig=false)
when isFastConfig set to true, it indicates that that the call is used by seqconfig this means that s...
IAppJob::EJobState x_GetCoverageGraph()
IAppJob::EJobState x_GetAlignSmear(CSeqGlyph::TObjects &objs, objects::CAlign_CI &align_iter)
void SetSortBy(const string &sort_by)
TModelUnit m_Window
current window for smear bars
CSGAlignmentJob(const string &desc, objects::CBioseq_Handle handle, const objects::SAnnotSelector &sel, const TSeqRange &range, TModelUnit window, TSignedSeqPos &maxStartTail, TSignedSeqPos &maxEndTail)
constructor for loading coverage graph.
void x_BuildAlignDataSource(const objects::CSeq_align &align, TAlnDataSources &align_ds, bool sparseAln)
TSignedSeqPos & m_MaxEndTail
Max length of unaligned tail at the end of the sequence.
vector< CRef< CAlignGlyph > > m_Aligns
alignments feature retrieval
bool FilterDuplicatesAndBadReads(const objects::CSeq_align &mapped_align)
virtual EJobState x_Execute()
method truly doing the job.
void x_CreateAlignGlyphsForCrossOriginAlign(CSeqGlyph::TObjects &objs, const objects::CSeq_align &align, const objects::CSeq_align_Handle &align_handle, bool sparseAln, TMatedAlignments &mated_aligns, bool match_id, CSGAlignmentJob::EAlignFlags flag, bool filterResults)
CRef< CSeqGlyph > x_CreateFeatGlyph(objects::CSeq_loc_Mapper &mapper, const objects::CMappedFeat &mapped_feat, CAlignGlyph &align) const
CIRef< IAlignSorter > m_Sorter
bool m_SmearOverLimit
flag indicating if smear is needed
bool m_LinkPair
link mate pair aligns
TSignedSeqPos & m_MaxStartTail
> Flag to show second-pass alignments (relevant to assembly to assembly alignments)
objects::SAnnotSelector m_Sel
our annotation selector
objects::CScope & GetScope(void) const
CSGAnnotJob inline methods.
TSeqRange m_Range
target range
IAppJob::EJobState x_CreateHistFromGraph(CSeqGlyph::TObjects &glyphs, const objects::SAnnotSelector &sel, TModelUnit window, bool fixed_scale, const TAxisLimits &y_limits)
objects::CBioseq_Handle m_Handle
target sequence
CSGJobResult – the data structure holding the seqgraphic job results.
void SetTearline(size_t Tearline)
tearline factor – used to limit a list of glyphs
list< CRef< CSeqGlyph > > TObjects
CSeqGraphicJob – the base class of seqgraphic job for handling the job status such as reporting the p...
virtual void SetTaskTotal(int total)
virtual void SetTaskName(const string &name)
virtual void SetTaskCompleted(int completed)
set total finished task number.
virtual void AddTaskCompleted(int delta)
set to add newly finished task number.
TJobToken m_Token
Job token recognizable by job listener.
CRef< CAppJobError > m_Error
static SIZE_TYPE ReverseComplement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
CRange< TSeqPos > GetSeqRange(TDim row) const
GetSeqRange NB: On a Spliced-seg, in case the product-type is protein, these only return the amin par...
CRef< CSeq_loc > CreateRowSeq_loc(TDim row) const
TDim CheckNumRows(void) const
Validatiors.
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
bool GetNamedScore(const string &id, int &score) const
Get score.
void Validate(bool full_test=false) const
void SetPartialStart(bool val, ESeqLocExtremes ext)
void SetPartialStop(bool val, ESeqLocExtremes ext)
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
This class is intended to be used for optimized version of pairwise seq-align to replace CSparseAlnGr...
void SetRegularity(bool f)
TDim GetDim(void) const
Alignment dimension (number of sequence rows in the alignment)
void Update(const TSeqRange &range, const TUpdateMap &update)
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
TBase::const_iterator const_iterator
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Return a field reference representing the tokenized key, or a NULL reference if the key doesn't exist...
@ eRight
Towards higher aln coord (always to the right)
@ eLeft
Towards lower aln coord (always to the left)
IAlnGraphicDataSource - interface to a data source representing an abstract alignment used in graphic...
virtual void GetUnalignedTails(TSignedSeqPos &start_tail, TSignedSeqPos &end_tail, bool clipped=true) const
virtual IAlnExplorer::EAlignType GetAlignType() const
virtual TSeqPos GetSeqStart(TNumrow row) const =0
virtual const objects::CSeq_id & GetSeqId(TNumrow row) const =0
virtual string & GetSeqString(string &buffer, TNumrow row, const TSignedRange &seq_rng, const TSignedRange &aln_rng, bool anchor_direct) const
Get sequence string for a given row in sequence range.
virtual bool IsPositiveStrand(TNumrow row) const =0
virtual TSeqPos GetSeqStop(TNumrow row) const =0
virtual TSignedSeqPos GetAlnPosFromSeqPos(TNumrow row, TSeqPos seq_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
Alignment segment iterator interface.
@ eAllSegments
Iterate all segments.
Alignment segment interface.
virtual const TSignedRange & GetRange(void) const =0
Get the selected row range.
@ fAligned
Aligned segment.
@ fIndel
Either anchor or the selected row is not present in the segment.
@ fUnaligned
The range on the selected sequence does not participate in the alignment (the alignment range of the ...
@ fGap
Both anchor row and the selected row are not included in the segment (some other row is present and t...
virtual TSegTypeFlags GetType(void) const =0
Get current segment type.
virtual const TSignedRange & GetAlnRange(void) const =0
Get alignment range for the segment.
vector< TSeqRange > TIntervals
virtual TSeqPos GetBaseWidth(IAlnExplorer::TNumrow) const =0
virtual IAlnExplorer::TNumrow GetNumRows() const =0
virtual IAlnExplorer::TNumrow GetAnchor() const =0
virtual IAlnSegmentIterator * CreateSegmentIterator(IAlnExplorer::TNumrow, const IAlnExplorer::TSignedRange &, IAlnSegmentIterator::EFlags) const =0
virtual TSignedSeqPos GetSeqPosFromAlnPos(IAlnExplorer::TNumrow for_row, TSeqPos aln_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
container_type::iterator iterator
const_iterator end() const
container_type::value_type value_type
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
static const struct name_t names[]
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
NetSchedule worker node application.
void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)
Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERASE_ITERATE(Type, Var, Cont)
Non-constant version with ability to erase current element, if container permits.
int TSignedSeqPos
Type for signed sequence position.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
CDiagContext & GetDiagContext(void)
Get diag context instance.
CDiagContext_Extra Extra(void) const
Create a temporary CDiagContext_Extra object.
#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)
void Fatal(CExceptionArgs_Base &args)
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
static bool LinkFeatures(CLinkedFeature::TLinkedFeats &feats, TFeatLinkingMode mode=1, ISeqTaskProgressCallback *p_cb=NULL)
Link features into a hierarchical list.
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
list< CRef< CLinkedFeature > > TLinkedFeats
static bool IsCrossOrigin(const objects::CSeq_loc &loc)
static bool SeparateStrands(const objects::CSeq_annot &seq_annot)
int GetOrigAnchor(void) const
const IAlnGraphicDataSource & GetAlignMgr(void) const
Inline methods.
static const string & GetUnnamedAnnot()
Get the commonly used symbol representing a unnnamed annotation.
static bool IsGeneModelFeature(int type, int subtype)
Does feature belong to gene model track Gene, RNA, cdregion, exon, C_region, and VDJ segments.
const objects::CSeq_align_Handle & GetOrigAlignment(void) const
virtual const objects::CSeq_loc & GetLocation(void) const
access the position of this object.
void AddAlignments(const objects::SAnnotSelector &sel, ISeqTaskProgressCallback *p_cb=NULL)
Smear all the alignments matched by this selector on my bioseq.
const objects::CSeq_align & GetAlignment(void) const
virtual bool IsCanceled() const override
EJobState
Job states (describe FSM)
C * SerialClone(const C &src)
Create on heap a clone of the source object.
#define MSerial_AsnText
I/O stream manipulators –.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
TRange GetTotalRange(void) const
CRef< CSeq_loc > Merge(TOpFlags flags, ISynonymMapper *syn_mapper) const
All functions create and return a new seq-loc object.
void Add(const CSeq_loc &other)
Simple adding of seq-locs.
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,...
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
@ fComparePositional
Use positional coordinates (ignore strands) when looking for abutting locations.
@ eNoOverlap
CSeq_locs do not overlap or abut.
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
@ eProductToLocation
Map from the feature's product to location.
@ eLocationToProduct
Map from the feature's location to product.
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
const CTSE_Handle & GetTSE_Handle(void) const
const CSeqFeatData & GetData(void) const
CConstRef< CSeq_annot > GetCompleteSeq_annot(void) const
Complete and return const reference to the current seq-annot.
bool ContainsSegment(const CSeq_id &id, size_t resolve_depth=kMax_Int, EFindSegment limit_flag=eFindSegment_NoLimit) const
Check if the seq-id describes a segment of the bioseq.
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
CSeqFeatData::ESubtype GetFeatSubtype(void) const
CSeqFeatData::E_Choice GetFeatType(void) const
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to the seq-annot.
const TId & GetId(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
const string & GetTitle(void) const
const CSeq_loc & GetLocation(void) const
const CSeq_graph & GetMappedGraph(void) const
Graph mapped to the master sequence.
SAnnotSelector & SetCollectNames(bool value=true)
Collect available annot names rather than annots.
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
SAnnotSelector & SetMaxSize(TMaxSize max_size)
Set maximum number of annotations to find.
CSeq_align_Handle GetSeq_align_Handle(void) const
Get original alignment handle.
SAnnotSelector & AddUnnamedAnnots(void)
Add unnamed annots to set of annots names to look for.
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
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.
TObjectType & GetObject(void)
Get object.
position_type GetLength(void) const
bool IntersectingWith(const TThisType &r) const
position_type GetToOpen(void) const
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
static TThisType GetWhole(void)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
@ fWithCommas
Use commas as thousands separator.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TStr & GetStr(void) const
Get the variant data.
const TTag & GetTag(void) const
Get the Tag member data.
const TData & GetData(void) const
Get the Data member data.
TBool GetBool(void) const
Get the variant data.
bool IsInt(void) const
Check if variant Int is selected.
bool IsStr(void) const
Check if variant Str is selected.
TInt GetInt(void) const
Get the variant data.
bool IsBool(void) const
Check if variant Bool is selected.
const TDenseg & GetDenseg(void) const
Get the variant data.
TLens & SetLens(void)
Assign a value to Lens data member.
bool IsSetExt(void) const
extra info Check if a value has been assigned to Ext data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
void SetDim(TDim value)
Assign a value to Dim data member.
list< CRef< CUser_object > > TExt
vector< CRef< CSeq_id > > TIds
const TSpliced & GetSpliced(void) const
Get the variant data.
TDim GetDim(void) const
Get the Dim member data.
const TStd & GetStd(void) const
Get the variant data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TStrands & SetStrands(void)
Assign a value to Strands data member.
list< CRef< CSpliced_exon > > TExons
const TExons & GetExons(void) const
Get the Exons member data.
bool IsStd(void) const
Check if variant Std is selected.
bool IsDisc(void) const
Check if variant Disc is selected.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
const TIds & GetIds(void) const
Get the Ids member data.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsSpliced(void) const
Check if variant Spliced is selected.
TIds & SetIds(void)
Assign a value to Ids data member.
const TDisc & GetDisc(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsDenseg(void) const
Check if variant Denseg is selected.
@ eType_disc
discontinuous alignment
bool IsCdregion(void) const
Check if variant Cdregion is selected.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
void SetTo(TTo value)
Assign a value to To data member.
bool IsEmpty(void) const
Check if variant Empty is selected.
void SetId(TId &value)
Assign a value to Id data member.
bool IsGeneral(void) const
Check if variant General is selected.
void SetFrom(TFrom value)
Assign a value to From data member.
const TLocal & GetLocal(void) const
Get the variant data.
bool IsLocal(void) const
Check if variant Local is selected.
const TGeneral & GetGeneral(void) const
Get the variant data.
bool IsNull(void) const
Check if variant Null is selected.
void SetStrand(TStrand value)
Assign a value to Strand data member.
const TInt & GetInt(void) const
Get the variant data.
bool IsInt(void) const
Check if variant Int is selected.
const TValues & GetValues(void) const
Get the Values member data.
const TByte & GetByte(void) const
Get the variant data.
const TValues & GetValues(void) const
Get the Values member data.
const Tdata & Get(void) const
Get the member data.
const TInst & GetInst(void) const
Get the Inst member data.
const TDesc & GetDesc(void) const
Get the Desc member data.
bool CanGetDesc(void) const
Check if it is safe to call GetDesc method.
TMol GetMol(void) const
Get the Mol member data.
unsigned int
A callback function used to compare two keys in a database.
range(_Ty, _Ty) -> range< _Ty >
double value_type
The numeric datatype used by the parser.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Useful/utility classes and methods.
T bound(T x_, T xlo_, T xhi_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
vector< CRef< CAnchoredAln > > TAnchoredAlnVec
Collection of anchored alignments.
struct named_group named_group
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Reader-writer based streams.
#define row(bind, expected)
int m_Data[CAlnStatConfig::eStat_Total+1]
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)