44 #define NCBI_USE_ERRCODE_X Objects_SeqAlignMap
123 : m_LocMapper(loc_mapper),
125 m_HaveStrands(
false),
127 m_ScoresInvalidated(
false),
129 m_AlignFlags(eAlign_Normal)
138 : m_LocMapper(loc_mapper),
140 m_HaveStrands(
false),
142 m_ScoresInvalidated(
false),
144 m_AlignFlags(eAlign_Normal)
157 template<
class T,
class C1,
class C2>
160 ITERATE(
typename C1, it, src) {
171 template<
class C1,
class C2>
174 ITERATE(
typename C1, it, src) {
188 CopyContainer<CSeq_align::TScore, TScores>(
245 TSegments::iterator ins_it =
261 size_t dim = diag.
GetDim();
262 if (dim != diag.
GetIds().size()) {
284 bool have_prot =
false;
285 bool have_nuc =
false;
291 CopyContainer<CDense_diag::TScores, TScores>(
294 for (
size_t row = 0; row < dim; ++row) {
317 if (have_prot && have_nuc) {
320 "Dense-diags with mixed sequence types are not supported");
333 if (numseg != denseg.
GetLens().size()) {
335 numseg =
min(numseg, denseg.
GetLens().size());
353 CopyContainer<CDense_seg::TScores, TScores>(
357 bool have_nuc =
false;
358 bool have_prot =
false;
360 for (
size_t row = 0; row <
m_Dim; ++row) {
365 switch ( seq_type ) {
378 if (have_prot && have_nuc) {
380 "Dense-segs with mixed sequence types are not supported");
382 if ((have_nuc || have_prot) && !unknown.
empty()) {
392 int width = have_prot ? 3 : 1;
394 for (
size_t seg = 0; seg < numseg; seg++) {
397 for (
size_t row = 0; row <
m_Dim; ++row) {
406 alnseg.
m_Len *= width;
415 seglens.reserve(sseg.size());
432 "Locations with mixed seq-ids are not supported "
433 "in std-seg alignments");
436 if (minlen == 0 ||
len == minlen) {
439 else if (maxlen == 0 ||
len == maxlen) {
442 if (minlen > maxlen) {
443 swap(minlen, maxlen);
450 "Rows of the same std-seg have different lengths");
454 if (minlen != 0 && maxlen != 0) {
455 if (minlen*3 != maxlen) {
457 "Inconsistent seq-loc lengths in std-seg rows");
477 if (seqtype != newtype) {
479 "Segment lengths in std-seg alignment are "
480 "inconsistent with sequence types");
499 seglens.push_back(maxlen == 0 ? -1 : maxlen);
509 size_t dim = stdseg.
GetDim();
511 && dim != stdseg.
GetIds().size()) {
518 int seg_len = seglens[seg_idx++];
521 CopyContainer<CStd_seg::TScores, TScores>(
524 unsigned int row_idx = 0;
536 "Missing or multiple seq-ids in std-seg alignment");
548 bool have_strand =
false;
549 switch ( loc.
Which() ) {
566 "Unsupported seq-loc type in std-seg alignment");
575 if (
len > 0 &&
len != seg_len) {
579 if (seg_len == -1 && seg.
m_Len == -1) {
587 "Rows have different lengths in std-seg");
609 if (numseg != pseg.
GetLens().size()) {
632 CopyContainer<CPacked_seg::TScores, TScores>(
636 for (
size_t seg = 0; seg < numseg; seg++) {
641 bool have_nuc =
false;
643 for (
unsigned int row = 0; row <
m_Dim; row++) {
666 if (have_nuc && seg_width == 3) {
668 "Packed-segs with mixed sequence types are not supported");
671 alnseg.
m_Len *= seg_width;
702 CopyContainer<CScore_set::Tdata, TScores>(
738 int prod_start, prod_end;
765 part_gen_start = gen_start;
766 gen_start += seg_len;
770 part_gen_start = gen_end;
780 part_prod_start = -1;
784 part_prod_start = prod_start;
785 prod_start += seg_len;
789 part_prod_start = prod_end;
793 *ex_prod_id, part_prod_start,
m_HaveStrands, ex_prod_strand);
798 TSeqPos seg_len = gen_end - gen_start;
823 if ( sparse.
GetRows().size() > 1) {
825 "Sparse-segs with multiple rows are not supported");
827 if ( sparse.
GetRows().empty() ) {
832 CopyContainer<CSparse_seg::TRow_scores, TScores>(
844 "Invalid 'first-starts' size in sparse-align");
849 "Invalid 'second-starts' size in sparse-align");
852 if (numseg != row.
GetLens().size()) {
859 "Invalid 'second-strands' size in sparse-align");
871 if (width != second_width) {
873 "Sparse-segs with mixed sequence types are not supported");
881 CopyContainer<CSparse_align::TSeg_scores, TScores>(
885 for (
size_t seg = 0; seg < numseg; seg++) {
916 if ( (*it)->m_ScoresInvalidated ) {
938 if ( (*it)->m_ScoresInvalidated ) {
959 for (
size_t row_idx = 0; row_idx <
m_Dim; ++row_idx) {
970 TSegments::iterator seg_it =
m_Segs.begin();
971 for ( ; seg_it !=
m_Segs.end(); ) {
972 if (seg_it->m_Rows.size() <= row) {
985 if (dst_id && dst_id != seg_id &&
1009 TSegments::iterator old_it = seg_it;
1019 if (id_it == idmap.
end()) {
1021 return aln_row.
m_Id;
1024 if ( rmap.
empty() ) {
1027 return aln_row.
m_Id;
1030 typedef vector< CRef<CMappingRange> > TSortedMappings;
1031 TSortedMappings mappings;
1033 for ( ; rg_it; ++rg_it) {
1034 mappings.push_back(rg_it->second);
1044 dst_id = mappings[0]->GetDstIdHandle();
1048 if (mappings.size() > 1) {
1049 ITERATE(TSortedMappings, it, mappings) {
1050 if ((*it)->GetDstIdHandle() != dst_id) {
1056 seg.
m_Rows[row].m_Id = dst_id;
1057 seg.
m_Rows[row].SetMapped();
1058 return seg.
m_Rows[row].m_Id;
1062 TSegments::iterator ins_point = seg_it;
1065 bool mapped =
false;
1073 for (
size_t map_idx = 0; map_idx < mappings.size(); ++map_idx) {
1075 if (!mapping->CanMap(start, stop,
1086 if (mapping->m_Dst_id_Handle != dst_id) {
1090 dst_id = mapping->m_Dst_id_Handle;
1092 group_idx = mapping->m_Group;
1098 TSeqPos dl = mapping->m_Src_from <= start ?
1099 0 : mapping->m_Src_from - start;
1100 TSeqPos dr = mapping->m_Src_to >= stop ?
1101 0 : stop - mapping->m_Src_to;
1105 "Alignment segment can not be mapped without trimming.");
1115 for (
size_t r = 0;
r < seg.
m_Rows.size(); ++
r) {
1139 stop -
dr - start + 1, seg.
m_Rows.size(), src_reverse);
1154 for (
size_t r = 0;
r < seg.
m_Rows.size(); ++
r) {
1160 mapping->Map_Range(start, stop -
dr);
1161 mapping->Map_Strand(
1165 mrow.
m_Id = mapping->m_Dst_id_Handle;
1188 left_shift += mseg.
m_Len;
1189 start += mseg.
m_Len;
1191 if (start > stop)
break;
1204 seg.
m_Rows[row].m_Id = rmap.
begin()->second->m_Dst_id_Handle;
1205 seg.
m_Rows[row].SetMapped();
1207 return seg.
m_Rows[row].m_Id;
1209 if (start <= stop) {
1212 stop - start + 1, seg.
m_Rows.size(), src_reverse);
1215 for (
size_t r = 0;
r < seg.
m_Rows.size(); ++
r) {
1245 size_t max_rows =
m_Segs.front().m_Rows.size();
1249 if (seg_it->m_Rows.size() > max_rows) {
1250 max_rows = seg_it->m_Rows.size();
1254 strands.reserve(max_rows);
1255 for (
size_t r_idx = 0; r_idx < max_rows; r_idx++) {
1260 if (seg_it->m_Rows.size() <= r_idx)
continue;
1261 if (seg_it->m_Rows[r_idx].GetSegStart() != -1) {
1262 strand = seg_it->m_Rows[r_idx].m_Strand;
1293 "Mapped alignment contains gaps and can not be "
1294 "converted to dense-diag.");
1306 id.Reset(&
const_cast<CSeq_id&
>(*row->m_Id.GetSeqId()));
1307 diag->SetIds().push_back(
id);
1308 diag->SetStarts().push_back(row->GetSegStart()/seq_width);
1314 row->m_Strand : strands[str_idx]);
1319 diag->SetLen(seg_it->m_Len/len_width);
1322 CloneContainer<CScore, TScores, CDense_diag::TScores>(
1325 diags.push_back(diag);
1342 CloneContainer<CScore, TScores, CDense_seg::TScores>(
1347 for (
size_t r = 0;
r <
m_Segs.front().m_Rows.size();
r++) {
1348 bool only_gaps =
true;
1355 dseg.
SetIds().push_back(
id);
1372 "Mapped denseg contains empty row.");
1379 dseg.
SetLens().push_back(seg_it->m_Len/len_width);
1384 if (len_width == 3) {
1391 int start = row->GetSegStart();
1414 int non_gap_count = 0;
1419 bool set_frames =
true;
1421 vector< pair<TSeqPos, TSeqPos> > frames;
1422 frames.reserve(
m_Segs.size());
1424 if (seg_it->m_Rows.size() != 2) {
1432 if (r0_type == r1_type) {
1449 TSeqPos start = seg_it->m_Rows[p_row].m_Start;
1453 start_frame = start % 3;
1454 stop_frame = (start + seg_it->m_Len) % 3;
1456 stop_frame = 3 - stop_frame;
1459 frames.push_back(pair<TSeqPos, TSeqPos>(start_frame, stop_frame));
1466 std_seg->SetDim(
static_cast<CStd_seg::TDim>(seg_it->m_Rows.size()));
1467 if ( !seg_it->m_Scores.empty() ) {
1469 CloneContainer<CScore, TScores, CStd_seg::TScores>(
1470 seg_it->m_Scores, std_seg->SetScores());
1480 id.Reset(&
const_cast<CSeq_id&
>(*row->m_Id.GetSeqId()));
1481 std_seg->SetIds().push_back(
id);
1490 loc->
SetInt().SetId(*
id);
1492 TSeqPos start = row->m_Start/width;
1493 TSeqPos stop = (row->m_Start + seg_it->m_Len)/width;
1500 seg_it->m_Rows[1 - p_row];
1501 TSeqPos start_frame = frames[seg_n].first;
1502 TSeqPos stop_frame = frames[seg_n].second;
1504 swap(start_frame, stop_frame);
1506 if ( row_n == p_row ) {
1510 if (g_start < start_frame) {
1525 std_seg->SetLoc().pop_back();
1538 if ( start_frame ) {
1539 if (start >= start_frame) {
1541 loc->
SetInt().SetFuzz_from().SetAlt().push_back(start);
1542 start -= start_frame;
1546 start += 3 - start_frame;
1550 loc->
SetInt().SetFuzz_to().SetAlt().push_back(stop - 1);
1556 loc->
SetInt().SetFrom(start);
1559 loc->
SetInt().SetTo(stop > start ? stop - 1 : stop);
1560 if (row->m_IsSetStrand) {
1561 loc->
SetInt().SetStrand(row->m_Strand);
1565 std_seg->SetLoc().push_back(loc);
1570 if (seg_it ==
m_Segs.begin() && non_gap_count < 2) {
1574 if ( std_seg->GetLoc().empty() )
continue;
1575 std_segs.push_back(std_seg);
1577 if (non_gap_count < 2 && !std_segs.empty()) {
1579 std_segs.pop_back();
1595 CloneContainer<CScore, TScores, CPacked_seg::TScores>(
1602 for (
size_t r = 0;
r <
m_Segs.front().m_Rows.size();
r++) {
1608 pseg.
SetIds().push_back(
id);
1618 TSeqPos start = row->GetSegStart();
1632 row->m_Strand : strands[str_idx]);
1637 pseg.
SetLens().push_back(seg_it->m_Len/len_width);
1650 data.push_back((*it)->GetDstAlign());
1694 if (last_part && last_part->Which() == part_type) {
1698 sx_GetExonPartLength(*last_part) + part_len);
1705 exon.
SetParts().push_back(last_part);
1720 TSegments::const_iterator& seg,
1725 bool& last_exon_partial,
1729 bool partial_left =
false;
1730 bool partial_right =
false;
1732 if (seg !=
m_Segs.begin() && last_exon_partial) {
1735 exon->SetPartial(
true);
1736 partial_left =
true;
1739 last_exon_partial =
false;
1741 int prod_start = -1;
1746 bool gstrand_set =
false;
1747 bool pstrand_set =
false;
1748 bool aln_protein =
false;
1749 size_t mapped_gaps = 0;
1750 int non_gap_gen_start = 0;
1751 int non_gap_prod_start = 0;
1752 int non_gap_gen_end = 0;
1753 int non_gap_prod_end = 0;
1762 bool have_non_gaps =
false;
1764 for ( ; seg !=
m_Segs.end(); ++seg) {
1767 if (group_idx != -1 && seg->m_GroupIdx && seg->m_GroupIdx != group_idx) {
1769 partial_right =
true;
1773 if ( seg->m_GroupIdx ) {
1774 group_idx = seg->m_GroupIdx;
1782 if (seg->m_Rows.size() > 2) {
1784 "Can not construct spliced-seg with more than two rows");
1789 int gend = gstart + seg->m_Len;
1790 int pend = pstart + seg->m_Len;
1796 if (gen_id != gen_row.
m_Id) {
1803 gen_id = gen_row.
m_Id;
1813 if (prod_id != prod_row.
m_Id) {
1820 prod_id = prod_row.
m_Id;
1836 "Can not map protein product to a sequence "
1837 "of unknown type.");
1857 bool gen_reverse =
false;
1858 bool prod_reverse =
false;
1861 if ( !gstrand_set ) {
1865 else if (gen_strand != gen_row.
m_Strand) {
1867 "Can not construct spliced-seg "
1868 "with different genomic strands in the same exon");
1872 if ( gstrand_set ) {
1877 if ( !pstrand_set ) {
1881 else if (prod_strand != prod_row.
m_Strand) {
1883 "Can not construct spliced-seg "
1884 "with different product strands in the same exon");
1888 if ( pstrand_set ) {
1899 last_exon_partial =
true;
1900 exon->SetPartial(
true);
1901 partial_right =
true;
1912 if (prod_start >= 0 && prod_end > 0) {
1913 if (!prod_reverse) {
1915 if (pstart < prod_end) {
1917 partial_right =
true;
1920 if (pstart > prod_end) {
1922 pins_len = pstart - prod_end;
1927 if (pend > prod_start) {
1929 partial_right =
true;
1932 if (pend < prod_start) {
1934 pins_len = prod_start - pend;
1949 if (gen_start >= 0 && gen_end > 0) {
1952 if (gstart < gen_end) {
1954 partial_right =
true;
1957 if (gstart > gen_end) {
1959 gins_len = gstart - gen_end;
1964 if (gend > gen_start) {
1966 partial_right =
true;
1969 if (gend < gen_start) {
1971 gins_len = gen_start - gend;
1979 if (prod_start < 0 || prod_start > pstart) {
1980 prod_start = pstart;
1982 if (prod_end < pend) {
1988 if (gen_start < 0 || gen_start > gstart) {
1991 if (gen_end < gend) {
1998 if ( !exon->GetParts().empty() ) {
2004 if ( !exon->GetParts().empty() ) {
2013 have_non_gaps =
true;
2017 if (!is_gap || !exon->GetParts().empty() || orig_ptype == ptype) {
2018 size_t old_size = exon->GetParts().size();
2022 if (is_gap && orig_ptype != ptype) {
2024 mapped_gaps += exon->GetParts().size() - old_size;
2030 non_gap_prod_start = prod_start;
2031 non_gap_gen_start = gen_start;
2032 non_gap_prod_end = prod_end;
2033 non_gap_gen_end = gen_end;
2038 if ( !gen_reverse ) {
2039 gen_start += seg->m_Len;
2042 gen_end -= seg->m_Len;
2046 if ( !prod_reverse ) {
2047 prod_start += seg->m_Len;
2050 prod_end -= seg->m_Len;
2057 if (mapped_gaps > 0) {
2059 _ASSERT(parts.size() >= mapped_gaps);
2060 for (; mapped_gaps > 0; mapped_gaps--) {
2063 gen_start = non_gap_gen_start;
2064 prod_start = non_gap_prod_start;
2065 gen_end = non_gap_gen_end;
2066 prod_end = non_gap_prod_end;
2070 if (!have_non_gaps || exon->GetParts().empty()) {
2073 last_exon_partial =
true;
2093 exon->SetAcceptor_before_exon().Assign(
2098 exon->SetDonor_after_exon().Assign(
2105 exon->SetAcceptor_before_exon().Assign(
2110 exon->SetDonor_after_exon().Assign(
2116 if (!gen_id && last_gen_id) {
2117 gen_id = last_gen_id;
2120 if (!prod_id && last_prod_id) {
2121 prod_id = last_prod_id;
2125 exon->SetGenomic_start(gen_start);
2126 exon->SetGenomic_end(gen_end - 1);
2128 exon->SetGenomic_strand(gen_strand);
2130 if ( aln_protein ) {
2132 exon->SetProduct_start().SetProtpos().SetAmin(prod_start/3);
2133 exon->SetProduct_start().SetProtpos().SetFrame(prod_start%3 + 1);
2134 exon->SetProduct_end().SetProtpos().SetAmin((prod_end - 1)/3);
2135 exon->SetProduct_end().SetProtpos().SetFrame((prod_end - 1)%3 + 1);
2138 exon->SetProduct_start().SetNucpos(prod_start);
2139 exon->SetProduct_end().SetNucpos(prod_end - 1);
2141 exon->SetProduct_strand(prod_strand);
2148 CloneContainer<CScore, TScores, CScore_set::Tdata>(
2153 CloneContainer<CUser_object, CSpliced_exon::TExt, CSpliced_exon::TExt>(
2157 spliced.
SetExons().push_back(exon);
2165 bool& last_exon_partial,
2168 bool& single_gen_id,
2170 bool& single_gen_str,
2173 bool& single_prod_id,
2175 bool& single_prod_str,
2176 bool& partial)
const
2178 TSegments::const_iterator seg = sub_align.
m_Segs.begin();
2184 while (seg != sub_align.
m_Segs.end()) {
2189 bool added_exon = sub_align.
x_GetDstExon(spliced, seg, ex_gen_id, ex_prod_id,
2190 ex_gen_strand, ex_prod_strand, last_exon_partial,
2191 last_gen_id, last_prod_id);
2192 partial = partial || last_exon_partial;
2197 last_gen_id = ex_gen_id;
2202 single_gen_id &= gen_id == ex_gen_id;
2207 prod_id = ex_prod_id;
2210 single_prod_id &= prod_id == ex_prod_id;
2216 (gen_strand == ex_gen_strand);
2217 gen_strand = ex_gen_strand;
2224 (prod_strand == ex_prod_strand);
2225 prod_strand = ex_prod_strand;
2245 bool single_gen_id =
true;
2246 bool single_gen_str =
true;
2247 bool single_prod_id =
true;
2248 bool single_prod_str =
true;
2249 bool partial =
false;
2250 bool last_exon_partial =
false;
2260 swap(gen_row, prod_row);
2264 last_exon_partial, gen_id, last_gen_id, single_gen_id,
2265 gen_strand, single_gen_str,
2266 prod_id, last_prod_id, single_prod_id,
2267 prod_strand, single_prod_str,
2273 last_exon_partial, gen_id, last_gen_id, single_gen_id,
2274 gen_strand, single_gen_str,
2275 prod_id, last_prod_id, single_prod_id,
2276 prod_strand, single_prod_str,
2286 bool ex_gen_reverse =
false;
2287 bool ex_prod_reverse =
false;
2288 if ( exon->IsSetGenomic_strand() ) {
2289 ex_gen_reverse =
IsReverse(exon->GetGenomic_strand());
2294 if ( exon->IsSetProduct_strand() ) {
2295 ex_prod_reverse =
IsReverse(exon->GetProduct_strand());
2300 TSeqPos gen_start = exon->GetGenomic_start();
2301 TSeqPos gen_end = exon->GetGenomic_end();
2304 _ASSERT(exon->GetProduct_start().IsProtpos());
2305 _ASSERT(exon->GetProduct_end().IsProtpos());
2306 prod_start = exon->GetProduct_start().GetProtpos().GetAmin()*3
2307 + exon->GetProduct_start().GetProtpos().GetFrame() - 1;
2308 prod_end = exon->GetProduct_end().GetProtpos().GetAmin()*3
2309 + exon->GetProduct_end().GetProtpos().GetFrame() - 1;
2312 _ASSERT(exon->GetProduct_start().IsNucpos());
2313 _ASSERT(exon->GetProduct_end().IsNucpos());
2314 prod_start = exon->GetProduct_start().GetNucpos();
2315 prod_end = exon->GetProduct_end().GetNucpos();
2317 while (
IsExonGap(exon->GetParts().front()->Which()) ) {
2320 if ( ex_gen_reverse ) {
2328 if ( ex_prod_reverse ) {
2335 exon->SetParts().pop_front();
2337 exon->SetGenomic_start(gen_start);
2338 exon->SetGenomic_end(gen_end);
2340 exon->SetProduct_start().SetProtpos().SetAmin(prod_start/3);
2341 exon->SetProduct_start().SetProtpos().SetFrame(prod_start%3 + 1);
2342 exon->SetProduct_end().SetProtpos().SetAmin(prod_end/3);
2343 exon->SetProduct_end().SetProtpos().SetFrame(prod_end%3 + 1);
2346 exon->SetProduct_start().SetNucpos(prod_start);
2347 exon->SetProduct_end().SetNucpos(prod_end);
2351 ex_gen_reverse =
false;
2352 ex_prod_reverse =
false;
2353 if ( exon->IsSetGenomic_strand() ) {
2354 ex_gen_reverse =
IsReverse(exon->GetGenomic_strand());
2359 if ( exon->IsSetProduct_strand() ) {
2360 ex_prod_reverse =
IsReverse(exon->GetProduct_strand());
2365 gen_start = exon->GetGenomic_start();
2366 gen_end = exon->GetGenomic_end();
2368 _ASSERT(exon->GetProduct_start().IsProtpos());
2369 _ASSERT(exon->GetProduct_end().IsProtpos());
2370 prod_start = exon->GetProduct_start().GetProtpos().GetAmin()*3
2371 + exon->GetProduct_start().GetProtpos().GetFrame() - 1;
2372 prod_end = exon->GetProduct_end().GetProtpos().GetAmin()*3
2373 + exon->GetProduct_end().GetProtpos().GetFrame() - 1;
2376 _ASSERT(exon->GetProduct_start().IsNucpos());
2377 _ASSERT(exon->GetProduct_end().IsNucpos());
2378 prod_start = exon->GetProduct_start().GetNucpos();
2379 prod_end = exon->GetProduct_end().GetNucpos();
2381 while (
IsExonGap(exon->GetParts().back()->Which()) ) {
2384 if ( ex_gen_reverse ) {
2392 if ( ex_prod_reverse ) {
2399 exon->SetParts().pop_back();
2401 exon->SetGenomic_start(gen_start);
2402 exon->SetGenomic_end(gen_end);
2404 exon->SetProduct_start().SetProtpos().SetAmin(prod_start/3);
2405 exon->SetProduct_start().SetProtpos().SetFrame(prod_start%3 + 1);
2406 exon->SetProduct_end().SetProtpos().SetAmin(prod_end/3);
2407 exon->SetProduct_end().SetProtpos().SetFrame(prod_end%3 + 1);
2410 exon->SetProduct_start().SetNucpos(prod_start);
2411 exon->SetProduct_end().SetNucpos(prod_end);
2418 single_gen_id =
false;
2422 single_prod_id =
false;
2424 if ( single_gen_id ) {
2430 if ( single_prod_id ) {
2444 if ( mapped_it->
IsNull() ) {
2448 bounds.push_back(mapped_it);
2455 if ( single_gen_id ) {
2456 (*it)->ResetGenomic_id();
2458 else if ( gen_id && !(*it)->IsSetGenomic_id() ) {
2462 if ( single_prod_id ) {
2463 (*it)->ResetProduct_id();
2465 else if ( prod_id && !(*it)->IsSetProduct_id() ) {
2469 if ( single_gen_str ) {
2470 (*it)->ResetGenomic_strand();
2472 if ( single_prod_str ) {
2473 (*it)->ResetProduct_strand();
2480 if (
orig.IsSetPoly_a() ) {
2483 if (
orig.IsSetProduct_length() ) {
2488 if (!partial &&
orig.IsSetModifiers()) {
2503 CloneContainer<CScore, TScores, CSparse_seg::TRow_scores>(
2507 sparse.
SetRows().push_back(aln);
2519 if (seg->m_Rows.size() > 2) {
2521 "Can not construct sparse-seg with more than two ids");
2529 if (first_start < 0 || second_start < 0) {
2535 if (first_idh != first_row.
m_Id) {
2537 "Can not construct sparse-seg with multiple ids per row");
2541 first_idh = first_row.
m_Id;
2545 if (second_idh != second_row.
m_Id) {
2547 "Can not construct sparse-seg with multiple ids per row");
2551 second_idh = second_row.
m_Id;
2559 int first_width = first_prot ? 3 : 1;
2560 int second_width = second_prot ? 3 : 1;
2563 int len_width = (first_prot || second_prot) ? 3 : 1;
2565 aln->SetFirst_starts().push_back(first_start/first_width);
2566 aln->SetSecond_starts().push_back(second_start/second_width);
2567 aln->SetLens().push_back(seg->m_Len/len_width);
2570 if (aln->IsSetSecond_strands() ||
2573 for (
size_t i = aln->SetSecond_strands().size();
i < s;
i++) {
2580 aln->SetSecond_strands().push_back(
IsForward(first_strand)
2581 ? second_strand :
Reverse(second_strand));
2585 if (scores_group == -2) {
2586 scores_group = seg->m_ScoresGroupIdx;
2588 else if (scores_group != seg->m_ScoresGroupIdx) {
2594 if (scores_group >= 0) {
2595 CloneContainer<CScore, TScores, CSparse_align::TSeg_scores>(
2607 size_t start_seg)
const
2617 TSegments::const_iterator start_seg_it =
m_Segs.begin();
2618 for (
size_t s = 0; s < start_seg && start_seg_it !=
m_Segs.end();
2619 s++, start_seg_it++) {
2621 if (start_seg_it ==
m_Segs.end()) {
2627 size_t num_rows = start_segment.
m_Rows.size();
2628 auto last_seg =
m_Segs.size() - 1;
2633 vector<CSeq_id_Handle> ids;
2635 ids.resize(num_rows);
2636 for (
size_t r = 0;
r < num_rows;
r++) {
2638 TSegments::const_iterator seg_it = start_seg_it;
2639 auto seg_idx = start_seg;
2642 for ( ; seg_idx <= last_seg && seg_it !=
m_Segs.end();
2643 seg_idx++, seg_it++) {
2645 if (seg_it->m_Rows.size() != num_rows) {
2647 last_seg = seg_idx - 1;
2652 if (last_id && last_id != row.
m_Id) {
2653 last_seg = seg_idx - 1;
2662 int seg_stop = seg_start == -1 ? -1 : seg_start + seg_it->m_Len;
2663 if (seg_start != -1) {
2672 last_seg = seg_idx - 1;
2683 if (seg_stop > left) {
2684 last_seg = seg_idx - 1;
2690 if (seg_start < right) {
2691 last_seg = seg_idx - 1;
2701 _ASSERT(last_seg >= start_seg);
2704 for (
size_t i = 0;
i < num_rows;
i++) {
2707 dseg.
SetIds().push_back(
id);
2721 vector<size_t> segs_per_row(num_rows, 0);
2724 int non_empty_segs = 0;
2725 auto cur_seg = start_seg;
2726 for (TSegments::const_iterator it = start_seg_it; it !=
m_Segs.end();
2728 if (cur_seg > last_seg) {
2732 bool only_gaps =
true;
2733 for (
size_t row = 0; row < it->m_Rows.size(); row++) {
2735 segs_per_row[row]++;
2739 if (only_gaps)
continue;
2742 dseg.
SetLens().push_back(it->m_Len/len_width);
2755 int start = row->GetSegStart();
2770 if (non_empty_segs == 0) {
2775 ITERATE(vector<size_t>, row, segs_per_row) {
2786 return last_seg + 1;
2805 if (!dseg)
continue;
2806 data.push_back(dseg);
2814 bool have_prot =
false;
2815 bool have_nuc =
false;
2827 if (have_prot && have_nuc)
return true;
2842 for (
size_t r = 0;
r < seg->m_Rows.size(); ++
r) {
2843 if (
r >= strands.size()) {
2872 if (seg->m_Rows.size() < 2)
continue;
2876 if (++non_empty >= 2) {
2884 if ( !(*sub)->x_IsEmpty() )
return false;
2903 "Mapping resulted in an empty alignment, "
2904 "can not initialize Seq-align.");
2908 TSegments::iterator seg =
m_Segs.begin();
2909 vector<CSeq_id_Handle> row_ids;
2910 for ( ; seg !=
m_Segs.end(); ++seg) {
2911 if (row_ids.size() < seg->m_Rows.size()) {
2912 row_ids.resize(seg->m_Rows.size());
2914 for (
size_t r = 0;
r < seg->m_Rows.size();
r++) {
2918 row_ids[
r] = row.
m_Id;
2922 if ( !row_ids[
r] ) {
2924 TSegments::iterator fwd = seg;
2926 for ( ; fwd !=
m_Segs.end(); ++fwd) {
2927 if (fwd->m_Rows.size() <=
r)
continue;
2930 row_ids[
r] = fwd_row.
m_Id;
2936 row.
m_Id = row_ids[
r];
2950 CloneContainer<CScore, TScores, CSeq_align::TScore>(
2954 CloneContainer<CSeq_loc, CSeq_align::TBounds, CSeq_align::TBounds>(
2958 CloneContainer<CObject_id, CSeq_align::TId, CSeq_align::TId>(
2962 CloneContainer<CUser_object, CSeq_align::TExt, CSeq_align::TExt>(
2971 row_ids.size() == 2 &&
2994 switch ( orig_choice ) {
3065 unique_ptr<CSeq_align_Mapper_Base> sub(
3067 sub->InitExon(spliced, exon);
3068 return sub.release();
3074 if (
m_Segs.empty() || idx >=
m_Segs.begin()->m_Rows.size() ) {
3076 "Invalid row index");
3078 return m_Segs.begin()->m_Rows[idx].m_Id;
bool IsForward(ENa_strand s)
bool IsReverse(ENa_strand s)
ENa_strand Reverse(ENa_strand s)
bool SameOrientation(ENa_strand a, ENa_strand b)
Seq-loc and seq-align mapper exceptions.
Class used to map seq-alignments.
CSeq_loc_Mapper_Base & m_LocMapper
void x_PushExonPart(CRef< CSpliced_exon_chunk > &last_part, CSpliced_exon_chunk::E_Choice part_type, int part_len, CSpliced_exon &exon) const
void x_ConvToDstDisc(CRef< CSeq_align > &dst) const
CSeq_align::C_Segs::TDendiag TDendiag
void x_GetDstSparse(CRef< CSeq_align > &dst) const
CRef< CSeq_align > GetDstAlign(void) const
Create mapped alignment.
CSeq_align_Mapper_Base(const CSeq_align &align, CSeq_loc_Mapper_Base &loc_mapper)
void Convert(void)
Map the whole alignment through the linked seq-loc mapper.
bool x_HaveMixedStrand(void) const
void x_InvalidateScores(SAlignment_Segment *seg=NULL)
void x_GetDstDenseg(CRef< CSeq_align > &dst) const
void x_GetDstDisc(CRef< CSeq_align > &dst) const
vector< CRef< CSeq_align_Mapper_Base > > TSubAligns
void x_FillKnownStrands(TStrands &strands) const
bool x_GetDstExon(CSpliced_seg &spliced, TSegments::const_iterator &seg, CSeq_id_Handle &gen_id, CSeq_id_Handle &prod_id, ENa_strand &gen_strand, ENa_strand &prod_strand, bool &last_exon_partial, const CSeq_id_Handle &last_gen_id, const CSeq_id_Handle &last_prod_id) const
SAlignment_Segment & x_InsertSeg(TSegments::iterator &where, int len, size_t dim, bool reverse)
void InitExon(const CSpliced_seg &spliced, const CSpliced_exon &exon)
bool x_IsEmpty(void) const
void x_ConvertRow(size_t row)
bool x_HaveMixedSeqTypes(void) const
void x_GetDstDendiag(CRef< CSeq_align > &dst) const
CConstRef< CSpliced_exon > m_OrigExon
vector< ENa_strand > TStrands
CRef< CSeq_align > m_DstAlign
~CSeq_align_Mapper_Base(void)
void x_GetDstSplicedSubAlign(CSpliced_seg &spliced, const CSeq_align_Mapper_Base &sub_align, bool &last_exon_partial, CSeq_id_Handle &gen_id, CSeq_id_Handle &last_gen_id, bool &single_gen_id, ENa_strand &gen_strand, bool &single_gen_str, CSeq_id_Handle &prod_id, CSeq_id_Handle &last_prod_id, bool &single_prod_id, ENa_strand &prod_strand, bool &single_prod_str, bool &partial) const
void x_ConvertAlign(size_t *row)
void x_GetDstStd(CRef< CSeq_align > &dst) const
CConstRef< CSeq_align > m_OrigAlign
TScoresGroups m_GroupScores
CSeq_align::C_Segs::TStd TStd
ssize_t x_GetPartialDenseg(CRef< CSeq_align > &dst, size_t start_seg) const
void x_Init(const CSeq_align &align)
const CSeq_id_Handle & GetRowId(size_t idx) const
Get seq-id for the given row.
virtual CSeq_align_Mapper_Base * CreateSubAlign(const CSeq_align &align)
void x_GetDstPacked(CRef< CSeq_align > &dst) const
void x_GetDstSpliced(CRef< CSeq_align > &dst) const
CSeq_id_Handle x_ConvertSegment(TSegments::iterator &seg_it, size_t row)
SAlignment_Segment & x_PushSeg(int len, size_t dim, ENa_strand strand=eNa_strand_unknown)
list< SAlignment_Segment > TSegments
CSeq_loc_Mapper_Base –.
CSpliced_seg_modifier –.
const_iterator end() const
const_iterator find(const key_type &key) const
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.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
ENa_strand GetStrand(void) const
Get the location's strand.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
TRange GetTotalRange(void) const
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
ESeqType GetSeqTypeById(const CSeq_id_Handle &idh) const
Methods for getting sequence types, use cached types (m_SeqTypes) if possible.
const TIdMap & GetIdMap() const
void SetSeqTypeById(const CSeq_id_Handle &idh, ESeqType seqtype) const
Methods for setting sequence types.
bool x_IsSetMiscFlag(EMiscFlags flag) const
static TSeqPos sx_GetExonPartLength(const CSpliced_exon_chunk &part)
CRef< CMappingRanges > m_Mappings
const CSeq_id_Handle & x_GetPrimaryId(const CSeq_id_Handle &synonym) const
TIdMap::const_iterator TIdIterator
void x_AdjustSeqTypesToProt(const CSeq_id_Handle &idh)
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
position_type GetLength(void) const
const_iterator begin(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
TFrom GetFrom(void) const
Get the From member data.
const TScores & GetScores(void) const
Get the Scores member data.
bool IsSetProduct_strand(void) const
should be 'plus' or 'minus' Check if a value has been assigned to Product_strand data member.
const TDonor_after_exon & GetDonor_after_exon(void) const
Get the Donor_after_exon member data.
const TExt & GetExt(void) const
Get the Ext member data.
const TId & GetId(void) const
Get the Id member data.
const TDenseg & GetDenseg(void) const
Get the variant data.
TModifiers & SetModifiers(void)
Assign a value to Modifiers data member.
TId & SetId(void)
Assign a value to Id data member.
bool IsSetProduct_type(void) const
Check if a value has been assigned to Product_type data member.
TScore & SetScore(void)
Assign a value to Score data member.
vector< CRef< CSeq_loc > > TLoc
const TScores & GetScores(void) const
Get the Scores member data.
TRow_scores & SetRow_scores(void)
Assign a value to Row_scores data member.
bool IsProtpos(void) const
Check if variant Protpos is selected.
TLens & SetLens(void)
Assign a value to Lens data member.
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
bool IsSetBounds(void) const
regions of sequence over which align was computed Check if a value has been assigned to Bounds data m...
E_Choice Which(void) const
Which variant is currently selected.
const TSeg_scores & GetSeg_scores(void) const
Get the Seg_scores member data.
bool IsSetParts(void) const
basic seqments always are in biologic order Check if a value has been assigned to Parts data member.
list< CRef< CStd_seg > > TStd
TPresent & SetPresent(void)
Assign a value to Present data member.
bool IsSetId(void) const
alignment id Check if a value has been assigned to Id data member.
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
TProduct_ins & SetProduct_ins(void)
Select the variant.
void SetProduct_id(TProduct_id &value)
Assign a value to Product_id data member.
bool IsSetExt(void) const
extra info Check if a value has been assigned to Ext data member.
bool IsSetProduct_strand(void) const
should be 'plus' or 'minus' Check if a value has been assigned to Product_strand data member.
const TStarts & GetStarts(void) const
Get the Starts member data.
const TStarts & GetStarts(void) const
Get the Starts member data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TDim GetDim(void) const
Get the Dim member data.
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
bool IsSetScores(void) const
score for each seg Check if a value has been assigned to Scores data member.
TGenomic_start GetGenomic_start(void) const
Get the Genomic_start member data.
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
const TAcceptor_before_exon & GetAcceptor_before_exon(void) const
Get the Acceptor_before_exon member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
const TLens & GetLens(void) const
Get the Lens member data.
TDiag & SetDiag(void)
Select the variant.
bool IsSetAcceptor_before_exon(void) const
splice sites Check if a value has been assigned to Acceptor_before_exon data member.
TExons & SetExons(void)
Assign a value to Exons data member.
void SetProduct_strand(TProduct_strand value)
Assign a value to Product_strand data member.
const TIds & GetIds(void) const
Get the Ids member data.
TScores & SetScores(void)
Assign a value to Scores data member.
TScores & SetScores(void)
Assign a value to Scores data member.
bool IsSetSeg_scores(void) const
per-segment scores Check if a value has been assigned to Seg_scores data member.
bool IsSetScores(void) const
score for each segment Check if a value has been assigned to Scores data member.
TNumseg GetNumseg(void) const
Get the Numseg member data.
void SetProduct_length(TProduct_length value)
Assign a value to Product_length data member.
const TFirst_id & GetFirst_id(void) const
Get the First_id member data.
TLen GetLen(void) const
Get the Len member data.
void SetDim(TDim value)
Assign a value to Dim data member.
TProduct_type GetProduct_type(void) const
Get the Product_type member data.
TRows & SetRows(void)
Assign a value to Rows data member.
void SetDim(TDim value)
Assign a value to Dim data member.
TGenomic_strand GetGenomic_strand(void) const
Get the Genomic_strand member data.
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
void SetDim(TDim value)
Assign a value to Dim data member.
bool IsSetGenomic_strand(void) const
genomic-strand represents the strand of translation Check if a value has been assigned to Genomic_str...
const TScores & GetScores(void) const
Get the Scores member data.
bool IsSetProduct_id(void) const
product is either protein or transcript (cDNA) Check if a value has been assigned to Product_id data ...
void SetType(TType value)
Assign a value to Type data member.
const TParts & GetParts(void) const
Get the Parts member data.
const TProduct_start & GetProduct_start(void) const
Get the Product_start member data.
void ResetDonor_after_exon(void)
Reset Donor_after_exon data member.
TMismatch & SetMismatch(void)
Select the variant.
TDim GetDim(void) const
Get the Dim member data.
const TIds & GetIds(void) const
Get the Ids member data.
const TProduct_end & GetProduct_end(void) const
Get the Product_end member data.
bool IsSetProduct_id(void) const
product is either protein or transcript (cDNA) Check if a value has been assigned to Product_id data ...
const TSpliced & GetSpliced(void) const
Get the variant data.
bool IsSetIds(void) const
Check if a value has been assigned to Ids data member.
TIds & SetIds(void)
Assign a value to Ids data member.
TDim GetDim(void) const
Get the Dim member data.
list< CRef< CSpliced_seg_modifier > > TModifiers
const TLens & GetLens(void) const
Get the Lens member data.
list< CRef< CSeq_loc > > TBounds
const TSecond_starts & GetSecond_starts(void) const
Get the Second_starts member data.
bool IsGenomic_ins(void) const
Check if variant Genomic_ins is selected.
const TPacked & GetPacked(void) const
Get the variant data.
bool IsSetExt(void) const
extra info Check if a value has been assigned to Ext data member.
TGenomic_ins GetGenomic_ins(void) const
Get the variant data.
TExt & SetExt(void)
Assign a value to Ext data member.
bool IsSetScores(void) const
Check if a value has been assigned to Scores data member.
bool IsSetGenomic_strand(void) const
Check if a value has been assigned to Genomic_strand data member.
const TStd & GetStd(void) const
Get the variant data.
const TScores & GetScores(void) const
Get the Scores member data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
void SetPartial(TPartial value)
Assign a value to Partial data member.
const TLens & GetLens(void) const
Get the Lens member data.
const TIds & GetIds(void) const
Get the Ids member data.
void SetProduct_type(TProduct_type value)
Assign a value to Product_type 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 IsSetSecond_strands(void) const
Check if a value has been assigned to Second_strands data member.
void SetPoly_a(TPoly_a value)
Assign a value to Poly_a data member.
TDim GetDim(void) const
Get the Dim member data.
const TFirst_starts & GetFirst_starts(void) const
Get the First_starts member data.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
const TDendiag & GetDendiag(void) const
Get the variant data.
TGenomic_strand GetGenomic_strand(void) const
Get the Genomic_strand member data.
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
const TPresent & GetPresent(void) const
Get the Present member data.
TGenomic_ins & SetGenomic_ins(void)
Select the variant.
void ResetAcceptor_before_exon(void)
Reset Acceptor_before_exon data member.
TNumseg GetNumseg(void) const
Get the Numseg member data.
TType GetType(void) const
Get the Type member data.
TProduct_strand GetProduct_strand(void) const
Get the Product_strand member data.
TParts & SetParts(void)
Assign a value to Parts data member.
void SetGenomic_id(TGenomic_id &value)
Assign a value to Genomic_id data member.
bool IsSetDim(void) const
dimensionality Check if a value has been assigned to Dim data member.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
const TStrands & GetStrands(void) const
Get the Strands member data.
const TRow_scores & GetRow_scores(void) const
Get the Row_scores member data.
const TIds & GetIds(void) const
Get the Ids member data.
const TExt & GetExt(void) const
Get the Ext member data.
const TStrands & GetStrands(void) const
Get the Strands member data.
const TSecond_strands & GetSecond_strands(void) const
Get the Second_strands member data.
list< CRef< CSpliced_exon_chunk > > TParts
TMatch & SetMatch(void)
Select the variant.
bool IsSetScore(void) const
for whole alignment Check if a value has been assigned to Score data member.
const TSecond_id & GetSecond_id(void) const
Get the Second_id member data.
TGenomic_end GetGenomic_end(void) const
Get the Genomic_end member data.
const TStarts & GetStarts(void) const
Get the Starts member data.
void SetGenomic_strand(TGenomic_strand value)
Assign a value to Genomic_strand data member.
bool IsSpliced(void) const
Check if variant Spliced is selected.
TNumseg GetNumseg(void) const
Get the Numseg member data.
TProduct_strand GetProduct_strand(void) const
Get the Product_strand member data.
list< CRef< CSeq_align > > Tdata
const TSparse & GetSparse(void) const
Get the variant data.
TIds & SetIds(void)
Assign a value to Ids data member.
bool IsSetGenomic_id(void) const
Check if a value has been assigned to Genomic_id data member.
bool IsProduct_ins(void) const
Check if variant Product_ins is selected.
const TScore & GetScore(void) const
Get the Score member data.
TBounds & SetBounds(void)
Assign a value to Bounds data member.
TDim GetDim(void) const
Get the Dim member data.
const TScores & GetScores(void) const
Get the Scores member data.
const TRows & GetRows(void) const
Get the Rows member data.
TProduct_ins GetProduct_ins(void) const
Get the variant data.
const TDisc & GetDisc(void) const
Get the variant data.
const TStrands & GetStrands(void) const
Get the Strands member data.
const Tdata & Get(void) const
Get the member data.
TStrands & SetStrands(void)
Assign a value to Strands data member.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsSetScores(void) const
Check if a value has been assigned to Scores data member.
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
bool IsSetDonor_after_exon(void) const
Check if a value has been assigned to Donor_after_exon data member.
bool IsSetRow_scores(void) const
per-row scores Check if a value has been assigned to Row_scores data member.
TLens & SetLens(void)
Assign a value to Lens data member.
const TBounds & GetBounds(void) const
Get the Bounds member data.
bool IsSetGenomic_id(void) const
Check if a value has been assigned to Genomic_id data member.
bool IsSetScores(void) const
scores for this exon Check if a value has been assigned to Scores data member.
E_Choice Which(void) const
Which variant is currently selected.
@ e_Product_ins
insertion in product sequence (i.e. gap in the genomic sequence)
@ e_Diag
both sequences are represented, there is sufficient similarity between product and genomic sequences....
@ e_Genomic_ins
insertion in genomic sequence (i.e. gap in the product sequence)
@ e_Match
both sequences represented, product and genomic sequences match
@ e_not_set
No variant selected.
@ e_Mismatch
both sequences represented, product and genomic sequences do not match
@ eType_partial
mapping pieces together
@ eProduct_type_transcript
ENa_strand
strand of nucleic acid
const TPnt & GetPnt(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
bool IsWhole(void) const
Check if variant Whole is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsNull(void) const
Check if variant Null is selected.
@ e_Empty
to NULL one Seq-id in a collection
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in objects libraries.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
constexpr auto sort(_Init &&init)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
bool IsExonGap(CSpliced_exon_chunk::E_Choice chunk_type)
void CopyContainer(const C1 &src, C2 &dst)
void SetPartLength(CSpliced_exon_chunk &part, CSpliced_exon_chunk::E_Choice ptype, TSeqPos len)
void CloneContainer(const C1 &src, C2 &dst)
Single row of a single alignment segment.
ENa_strand m_Strand
Strand value.
TSeqPos m_Start
kInvalidSeqPos means gap
CSeq_id_Handle m_Id
Row's seq-id.
int GetSegStart(void) const
Get segment start or -1 if it's a gap.
bool m_IsSetStrand
Is strand set for the row?
bool SameStrand(const SAlignment_Row &r) const
Check if the query row has the same strand orientation.
bool m_Mapped
Flag indicating mapped rows.
void SetMapped(void)
Mark the row as mapped.
Structure to hold information about a single alignment segment.
vector< SAlignment_Row > TRows
TRows m_Rows
Segment rows.
SAlignment_Row & CopyRow(size_t idx, const SAlignment_Row &src_row)
Create a copy of the given row, store is to this segment as row number 'idx'.
TScores m_Scores
Scores for this segment.
ssize_t m_ScoresGroupIdx
Group of scores.
bool m_HaveStrands
Do at least some rows have strand set?
SAlignment_Row & GetRow(size_t idx)
Get row data with the given index.
SAlignment_Row & AddRow(size_t idx, const CSeq_id &id, int start, bool is_set_strand, ENa_strand strand)
Add new row.
int m_GroupIdx
Group of segments (e.g.