seg_numrows = (*std_i)->CheckNumRows();
97 if( seg_numrows != numrows ) {
99 "CSeq_align::CheckNumRows(): Number of rows " 100 "is not the same for each disc seg.");
103numrows = seg_numrows;
113 TDimseg_numrows = (*std_i)->CheckNumRows();
115 if(seg_numrows != numrows) {
117 "CSeq_align::CheckNumRows(): Number of rows " 118 "is not the same for each std seg.");
121numrows = seg_numrows;
131 TDimseg_numrows = (*it)->CheckNumRows();
133 if( seg_numrows != numrows ) {
135 "CSeq_align::CheckNumRows(): Number of rows " 136 "is not the same for each dendiag seg.");
139numrows = seg_numrows;
147 "CSeq_align::CheckNumRows() currently does not handle " 148 "this type of alignment");
180 if(row_i++ ==
row) {
188 "CSeq_align::GetSeqRange():" 189 " Row seqids not consistent." 190 " Cannot determine range.");
196}
else if(loc.
IsPnt()) {
203 "CSeq_align::GetSeqRange():" 204 " Row seqids not consistent." 205 " Cannot determine range.");
214 if(row < 0 || row >= row_i) {
216 "CSeq_align::GetSeqRange():" 217 " Invalid row number");
221 "CSeq_align::GetSeqRange():" 222 " loc.size is inconsistent with dim");
228 "CSeq_align::GetSeqRange(): Row is empty");
247 "CSeq_align::GetSeqRange() currently does not handle " 248 "this type of alignment.");
267 "CSeq_align::GetSeqStart() currently does not handle " 268 "this type of alignment.");
288 "CSeq_align::GetSeqStop() currently does not handle " 289 "this type of alignment.");
311 "CSeq_align::GetSeqStrand() currently does not handle " 312 "this type of alignment.");
331 if( (*seg)->IsSetIds() &&
332(
size_t)
row< (*seg)->GetIds().size() ) {
333 return*(*seg)->GetIds()[
row];
344 if( (*seg)->IsSetIds() &&
345(
size_t)
row< (*seg)->GetIds().size()) {
346 return*((*seg)->GetIds()[
row]);
348 else if( (*seg)->IsSetLoc() &&
349(size_t)
row< (*seg)->GetLoc().size() ) {
366 const CSeq_id& rv = (*sub_aln)->GetSeq_id(
row);
382 if(
row== 0 && spliced_seg.IsSetProduct_id()) {
384}
else if(
row== 1 && spliced_seg.IsSetGenomic_id()) {
385 returnspliced_seg.GetGenomic_id();
392 "CSeq_align::GetSeq_id() currently does not handle " 393 "this type of alignment.");
397 "CSeq_align::GetSeq_id(): " 398 "can not get seq-id for the row requested.");
433 "Blast-style bit score",
434 "Blast-style e-value",
435 "Length of the aligned segments, including the length of all gap segments",
436 "Count of identities",
437 "Count of positives; protein-to-DNA score",
438 "Count of negatives; protein-to-DNA score",
439 "Count of mismatches",
440 "Number of gaps in the alignment",
441 "Percent identity (0.0-100.0); count each base in a gap in any row as a mismatch",
442 "Percent identity (0.0-100.0); don't count gaps",
443 "Percent identity (0.0-100.0); count a gap of any length in any row as a mismatch of length 1",
444 "Percentage of query sequence aligned to subject (0.0-100.0)",
445 "Blast-style sum_e",
446 "Composition-adjustment method from BLAST",
447 "Percent coverage (0.0-100.0) of high quality region",
448 "Count of identities",
449 "Percent identity; count gaps within exons and introns on product",
450 "Number of splices; 2 x number of introns that have no gap on product",
451 "Number of splices with consensus splice sequence",
452 "Percentage of query sequence aligned to subject (0.0-100.0)",
453 "Percent identity; count gaps within exons only" 489 if(m_ScoreNameMap.
empty()) {
499 returnm_ScoreNameMap;
525 if((*iter)->IsSetId() && (*iter)->GetId().IsStr() &&
526(*iter)->GetId().GetStr() == name) {
542 if((*iter)->IsSetId() && (*iter)->GetId().IsStr() &&
543(*iter)->GetId().GetStr() == name) {
552score->SetId().SetStr(name);
567 if(ref->GetValue().IsInt()) {
568score = ref->GetValue().GetInt();
570score = (
int)ref->GetValue().GetReal();
584 if(ref->GetValue().IsInt()) {
585score = (double)ref->GetValue().GetInt();
587score = ref->GetValue().GetReal();
610 if((*iter)->IsSetId() && (*iter)->GetId().IsStr() &&
611(*iter)->GetId().GetStr() == name) {
627ref->SetValue().SetInt(score);
633ref->SetValue().SetReal(score);
639ref->SetValue().SetInt(score);
645ref->SetValue().SetReal(score);
654(*dendiag_it)->Validate();
662(*seq_align_it)->Validate(full_test);
676 "CSeq_align::Validate() currently does not handle " 677 "this type of alignment");
693 "CSeq_align::Reverse() currently only handles dense-seg " 710(*it)->SwapRows(row1, row2);
719 "CSeq_align::SwapRows currently only handles dense-seg " 732 "CSeq_align::CreateDensegFromStdseg(): " 733 "Input Seq-align should have segs of type StdSeg!");
746vector<TSeqPos> row_lens;
751vector<bool> widths_determined;
759TNumrow dim = 0,
row= 0;
764seg_lens.push_back(0);
765 TSeqPos& seg_len = seg_lens.back();
767widths_determined.push_back(
false);
784to = interval.
GetTo();
785starts.push_back(from);
786row_len = to - from + 1;
787row_lens.push_back(row_len);
795 if(row_len * 3 == seg_len) {
798}
else if(row_len / 3 == seg_len) {
800}
else if(row_len != seg_len) {
802 "CreateDensegFromStdseg(): " 803 "Std-seg segment lengths not accurate!");
807widths_determined[seg] =
true;
808 if(widths[
row] > 0 && widths[
row] != width) {
810 "CreateDensegFromStdseg(): " 811 "Std-seg segment lengths not accurate!");
813widths[
row] = width;
818seq_id = &(*i)->GetInt().GetId();
824strands[
row] = strand;
826 if(strands[
row] != strand) {
828eInvalidInputAlignment,
829 "CreateDensegFromStdseg(): " 830 "Inconsistent strands!");
834}
else if((*i)->IsEmpty()) {
835starts.push_back(-1);
839seq_id = &(*i)->GetEmpty();
840row_lens.push_back(0);
847ds.
SetIds().push_back(
id);
855 string(
"CreateDensegFromStdseg(): Seq-ids: ") +
856 id.AsFastaString() +
" and "+
858 " Without the OM it cannot be determined if they belong to" 859 " the same sequence." 860 " Define and pass ChooseSeqId to resolve seq-ids.";
872 if(dim != ss.
GetDim() ||
row!= dim) {
874 "CreateDensegFromStdseg(): " 875 "Inconsistent dimentions!");
878 if(widths_determined[seg]) {
881 if((row_len = row_lens[
row]) > 0) {
883 if(row_len == seg_len * 3) {
885}
else if(row_len == seg_len) {
888 if(widths[
row] > 0 && widths[
row] != width) {
890 "CreateDensegFromStdseg(): " 891 "Std-seg segment lengths not accurate!");
893widths[
row] = width;
907 boolwidths_failure =
false;
908 boolwidths_success =
false;
909 for(seg = 0; seg < ds.
GetNumseg(); seg++) {
910 if(!widths_determined[seg]) {
912 if(starts[seg * dim +
row] >= 0) {
913 intwidth = widths[
row];
916}
else if(width == 0) {
917widths_failure =
true;
923widths_success =
true;
927 if(widths_failure) {
928 if(widths_success) {
930 "CreateDensegFromStdseg(): " 931 "Some widths cannot be determined!");
938 for(seg = 1; seg < ds.
GetNumseg(); seg++) {
940strands.push_back(strands[
row]);
955 if( !
GetSegs().IsDenseg() ) {
957 "CSeq_align::CreateTranslatedDensegFromNADenseg(): " 958 "Input Seq-align should have segs of type Dense-seg!");
964 if(
GetSegs().GetDenseg().IsSetWidths()) {
966 "CSeq_align::CreateTranslatedDensegFromNADenseg(): " 967 "Widths already exist for the original alignment");
980 if(orig_lens[numseg] % 3) {
982 string(
"CSeq_align::CreateTranslatedDensegFromNADenseg(): ") +
984 " is not divisible by 3.";
987lens[numseg] = orig_lens[numseg] / 3;
1004 template<
typenameT,
typenamePred = less<TSeqPos> >
1007 return m_Pred(x.first, y.first);
1017 if( !
GetSegs().IsDisc() ) {
1019 "CSeq_align::CreateDensegFromDisc(): " 1020 "Input Seq-align should have segs of type StdSeg!");
1036 typedefpair<TSeqPos, const CDense_seg *> TPosDsPair;
1037 typedefvector<TPosDsPair> TDsVec;
1042 const CDense_seg& ds = (*sa_i)->GetSegs().GetDenseg();
1043ds_vec.push_back(make_pair<TSeqPos, const CDense_seg *>(ds.
GetSeqStart(0), &ds));
1051 "CreateDensegFromDisc(): " 1052 "Inconsistent strands!");
1058 sort(ds_vec.begin(), ds_vec.end(),
1061 sort(ds_vec.begin(), ds_vec.end(),
1062 ds_cmp<TPosDsPair, greater<TSeqPos> >());
1068 ITERATE(TDsVec, ds_i, ds_vec) {
1075 if( !new_ds.
GetDim() ) {
1079 "CreateDensegFromDisc(): " 1080 "All disc dense-segs need to have the same dimension!");
1085 if(single_segment_strands.empty()) {
1086single_segment_strands.assign(ds.
GetStrands().begin(),
1089 if( !equal(single_segment_strands.begin(),
1090single_segment_strands.end(),
1093 "CreateDensegFromDisc(): " 1094 "All disc dense-segs need to have the same strands!");
1102 if( !single_segment_strands.empty() ) {
1109single_segment_strands.begin(),
1110single_segment_strands.begin() + new_ds.
GetDim());
1118 intnew_starts_i = 0;
1120 ITERATE(TDsVec, ds_i, ds_vec) {
1127 if(new_ds.
GetIds().empty()) {
1146 string(
"CreateDensegFromDisc(): Seq-ids: ") +
1148 id.AsFastaString() +
" are not identical!"+
1149 " Without the OM it cannot be determined if they belong to" 1150 " the same sequence." 1151 " Define and pass ChooseSeqId to resolve seq-ids.";
1169++starts_i, ++new_starts_i, ++
row) {
1189 return max(range1,range2).GetFrom() -
min(range1,range2).GetTo();
1195 if(aligns.
Get().size() == 1) {
1196 returnaligns.
Get().front();
1203align->
SetSegs().SetDisc().Set() = aligns.
Get();
1218 TSeqPosdiscontinuity_threshold)
const 1222 "SplitOnLongDiscontinuity() only implemented for pairwise alignments");
1225 size_tnum_splits = 0;
1226 switch(
GetSegs().Which()) {
1235 for( ; curr_seg < seg.
GetNumseg(); ++curr_seg) {
1238 if(p0_curr < 0 || p1_curr < 0) {
1246curr_range0 =
TSeqRange(p0_curr, p0_curr+curr_seg_len);
1247curr_range1 =
TSeqRange(p1_curr, p1_curr+curr_seg_len);
1249 if(prev_range0.
Empty()) {
1255(
s_Distance(curr_range0, prev_range0) > discontinuity_threshold ||
1256 s_Distance(curr_range1, prev_range1) > discontinuity_threshold))
1260last_seg = curr_seg;
1280curr_range0 = (*seg_it)->GetSeqRange(0);
1281curr_range1 = (*seg_it)->GetSeqRange(1);
1282list< CRef<CSeq_align> > seg_splits;
1283(*seg_it)->SplitOnLongDiscontinuity(seg_splits,
1284discontinuity_threshold);
1286 if(prev_range0.
Empty() ||
1287(
s_Distance(curr_range0, prev_range0) <= discontinuity_threshold &&
1288 s_Distance(curr_range1, prev_range1) <= discontinuity_threshold))
1293curr_disc.
Set().push_back(seg_splits.front());
1294seg_splits.pop_front();
1295 if(seg_splits.empty()) {
1307num_splits += seg_splits.size();
1308curr_disc.
Set().clear();
1309curr_disc.
Set().push_back(seg_splits.back());
1310seg_splits.pop_back();
1312aligns.splice(aligns.end(), seg_splits);
1335 if(
offset== 0)
return;
1337 switch(
SetSegs().Which()) {
1340(*dendiag_it)->OffsetRow(
row,
offset);
1353(*seq_align_it)->OffsetRow(
row,
offset);
1358 "CSeq_align::OffsetRow() currently does not handle " 1359 "this type of alignment");
1371 switch(dst_loc.
Which()) {
1378 "CSeq_align::RemapToLoc only supports int target seq-locs");
1381 switch(
SetSegs().Which()) {
1387(*std_it)->RemapToLoc(
row, dst_loc, ignore_strand);
1392(*seq_align_it)->RemapToLoc(
row, dst_loc, ignore_strand);
1397 "CSeq_align::RemapToLoc only supports Dense-seg and Std-seg alignments.");
1409 copy->Assign(align);
1415 "Location with multiple ids can not be used to " 1416 "remap seq-aligns.");
1419 id->Assign(*orig_id);
1424 if( it.IsWhole() ) {
1426 "Whole seq-loc can not be used to " 1427 "remap seq-aligns.");
1429 len+= it.GetRange().GetLength();
1437 returnmapper.
Map(align,
row);
1446length += it->IntersectionWith(range).GetLength();
1459 boolget_total_count)
1461 if(ranges.
empty()) {
1471 boolis_gapped =
false;
1482 if(!ranges.
begin()->IsWhole()) {
1484 if(gap_start >= 0) {
1486 TSeqRange(gap_start, gap_start + gap_len - 1));
1497retval += (get_total_count ? gap_len : (gap_len ? 1 : 0));
1518(*iter)->GetRowSeq_insertions(
1521: insertions.
size();
1529 if(
row< 0 && !get_total_count && ranges.
begin()->IsWhole()) {
1545 "CSeq_align::GetGapCount() currently does not handle " 1546 "this type of alignment.");
1593+ (
row== 0 ?
'I':
'D')
1597 staticvector<CSeq_align::SIndel>
1600 boolinclude_frameshifts,
boolinclude_non_frameshifts)
1602vector<CSeq_align::SIndel>
results;
1603 if(ranges.
empty()) {
1631? after_origin : before_origin)
1634vector<CSeq_align::SIndel> before_origin_frameshifts =
1635 s_GetIndels(before_origin,
row, ranges, include_frameshifts, include_non_frameshifts),
1636after_origin_frameshifts =
1637 s_GetIndels(after_origin,
row, ranges, include_frameshifts, include_non_frameshifts);
1638 results= before_origin_frameshifts;
1639 results.insert(
results.end(), after_origin_frameshifts.begin(),
1640after_origin_frameshifts.end());
1649 "CSeq_align::GetNumFrameshifts() currently does not handle " 1650 "this type of alignment.");
1653 if(generated_denseg) {
1654generated_denseg->
SetSegs().SetDenseg().OrderAdjacentGaps();
1655generated_denseg->
SetSegs().SetDenseg().Compact();
1656generated_denseg->
SetSegs().SetDenseg().RemovePureGapSegs();
1659 const CDense_seg&ds = (generated_denseg ? *generated_denseg : align)
1663 boolis_gapped =
false;
1673 if(!ranges.
begin()->IsWhole()) {
1675 if(gap_start >= 0) {
1677 TSeqRange(gap_start, gap_start + gap_len - 1));
1689((include_frameshifts && gap_len % 3 != 0) ||
1690(include_non_frameshifts && gap_len % 3 == 0)))
1695 if(product_gap_start < 0) {
1801 switch(
GetSegs().Which()) {
1806 boolis_gapped =
false;
1826ranges += (*iter)->GetAlignedBases(
row);
1834ranges += (*iter)->GetRowSeq_range(
row,
true);
1835ranges -= (*iter)->GetRowSeq_insertions(
row,
GetSegs().GetSpliced());
1842 "CSeq_align::GetInsertedRanges() currently does not handle " 1843 "this type of alignment.");
1855 if(ranges.
begin()->IsWhole())
1871 if(ranges.
empty()) {
1882 boolis_gap_seg =
false;
1884!is_gap_seg && j < ds.
GetDim(); ++j) {
1890 if( !is_gap_seg ) {
1912 if(!ranges.
begin()->IsWhole())
1914 "Can't calculate alignment length within a range " 1915 "for standard seg representation");
1919vector<TSeqPos> sizes;
1924 boolis_gap =
false;
1926 if((*it)->IsEmpty()) {
1932 if( !ungapped || !is_gap) {
1935 if( !(*it)->IsEmpty() ) {
1936 if(sizes.empty()) {
1937sizes.resize(seg.
GetDim(), 0);
1938}
else if(sizes.size() != (
size_t)seg.
GetDim()) {
1941 "inconsistent number of locs");
1944 for(
CSeq_loc_CIloc_it(**it); loc_it; ++loc_it) {
1945sizes[
i] += loc_it.GetRange().GetLength();
1955 if( sizes.empty() )
return0;
1956vector<TSeqPos>::iterator iter = sizes.begin();
1957vector<TSeqPos>::iterator smallest = iter;
1958 for(++iter; iter != sizes.end(); ++iter) {
1959 if(*iter < *smallest) {
1971exon_ranges &= (*iter)->GetRowSeq_range(0,
true);
1974 len-= (*iter)->GetRowSeq_insertions(
1980 len+= (*iter)->GetRowSeq_insertions(
2004 boolinclude_gaps)
const 2013 boolinclude_gaps)
const 2023 if(
r0.GetLength()) {
2024 r= double(
r1.GetLength()) / double(
r0.GetLength());
2033 switch(
GetSegs().Which()) {
2038(*it)->CreateRowSeq_interval(
row));
2052loc->
SetMix().Set().push_back(
2053(*it)->CreateRowSeq_loc(
row));
2060loc->
SetMix().Set().push_back((*it)->CreateRowSeq_loc(
row));
2068 "CSeq_align::CreateRowSeq_loc() - row number must " 2069 "be 0 or 1 for spliced-segs.");
2076(*ex)->CreateRowSeq_interval(
row, spl));
2084 "CSeq_align::CreateRowSeq_loc() currently does not handle " 2085 "this type of alignment.");
2096 if(range.first > length) {
2097range.first = length;
2099 if(range.second < length) {
2100range.second = length;
2105 if(range.first > new_range.first) {
2106range.first = new_range.first;
2108 if(range.second < new_range.second) {
2109range.second = new_range.second;
2119 switch(
GetSegs().Which()) {
2124 boolis_gapped =
false;
2141vector<TSeqRange> last_seg_ranges;
2144length_range.
AddRange((*iter)->GapLengthRange());
2145vector<TSeqRange> seg_ranges;
2146 for(
int i=0;
i< num_rows;
i++) {
2147seg_ranges.push_back((*iter)->GetSeqRange(
i));
2150 if(!last_seg_ranges.empty()) {
2157last_seg_ranges = seg_ranges;
2165 GetSegs().GetSpliced().GetExons()) {
2167 for(
unsigned r= 0;
r< 2; ++
r) {
2173length_range.
AddLength(ins_it->GetLength());
2183 "Can't get gap lengths for this type of alignment.");
2185 returnlength_range.
range;
2190 if(!
GetSegs().IsSpliced()) {
2192 "Requested exon lengths for a non-spliced alignment.");
2198 GetSegs().GetSpliced().GetExons()) {
2200 if(previous_exon) {
2203 if(descending_pos != minus_strand) {
2207 TSeqRangeintron((minus_strand ? exon : previous_exon)->GetGenomic_end() + 1,
2208(minus_strand ? previous_exon : exon)->GetGenomic_start() - 1);
2211previous_exon = exon;
2213 returnlength_range.
range;
2218 if(!
GetSegs().IsSpliced()) {
2220 "Requested exon lengths for a non-spliced alignment.");
2224 GetSegs().GetSpliced().GetExons()) {
2229 returnlength_range.
range;
2252 for(
i= from;
i<= to; ++
i) {
2281 const CObject_id& obj_type = (*it)->GetType();
2282 if( obj_type.
IsStr() && obj_type.
GetStr() == ext_type ) {
2283ret.
Reset(it->GetPointer());
2296 const CObject_id& obj_type = (*it)->GetType();
2297 if( obj_type.
IsStr() && obj_type.
GetStr() == ext_type ) {
2298ret.
Reset(it->GetPointer());
User-defined methods of the data storage class.
bool IsReverse(ENa_strand s)
User-defined methods of the data storage class.
static const bool sc_IsInteger[]
static TSeqPos s_Distance(const TSeqRange &range1, const TSeqRange &range2)
static vector< CSeq_align::SIndel > s_GetIndels(const CSeq_align &align, CSeq_align::TDim row, const CRangeCollection< TSeqPos > &ranges, bool include_frameshifts, bool include_non_frameshifts)
static const TScoreNamePair sc_ScoreNames[]
static TSeqPos s_GetGapCount(const CSeq_align &align, CSeq_align::TDim row, const CRangeCollection< TSeqPos > &ranges, bool get_total_count)
Retrieves the number of gaps in an alignment.
NCBI_RESUME_DEPRECATION_WARNINGS CRef< CSeq_align > RemapAlignToLoc(const CSeq_align &align, CSeq_align::TDim row, const CSeq_loc &loc)
Remap seq-align row to the seq-loc.
static const char *const sc_ScoreHelpText[]
static CRef< CSeq_align > s_GetJoinedAlignment(const CSeq_align_set &aligns)
Join the alignments in the set into one alignment.
static TSeqPos s_IntersectionLength(const CRangeCollection< TSeqPos > &ranges, const TSeqRange &range)
Get length of intersection between a range and a range collection.
static TSeqPos s_DenseSegLength(const CDense_seg &ds, CDense_seg::TNumseg seg, const CRangeCollection< TSeqPos > &ranges)
Get length of dense-seg alignment within range.
static TSeqPos s_GetAlignmentLength(const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, bool ungapped)
calculate the length of our alignment within given range
SStaticPair< CSeq_align::EScoreType, const char * > TScoreNamePair
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.
Seq-loc and seq-align mapper exceptions.
void TrimEndGaps()
Trim leading/training gaps if possible.
const CSeq_id & GetSeq_id(TDim row) const
ENa_strand GetSeqStrand(TDim row) const
TSeqPos GetSeqStop(TDim row) const
void Reverse(void)
Reverse the segments' orientation.
void OffsetRow(TDim row, TSignedSeqPos offset)
Offset row's coords.
TWidths & SetWidths(void)
void SwapRows(TDim row1, TDim row2)
Swap two rows (changing *order*, not content)
TSeqPos GetSeqStart(TDim row) const
TDim CheckNumRows(void) const
CRange< TSeqPos > GetSeqRange(TDim row) const
void Validate(bool full_test=false) const
void RemapToLoc(TDim row, const CSeq_loc &loc, bool ignore_strand=false)
const_iterator begin() const
position_type GetCoveredLength(void) const
Returns total length covered by ranges in this collection, i.e.
void SwapRows(TDim row1, TDim row2)
Swap two rows (changing *order*, not content)
CRef< CSeq_align > CreateTranslatedDensegFromNADenseg(void) const
Create a Dense-seg with widths from Dense-seg of nucleotides Used by AlnMgr to handle translated nucl...
EScoreType
enum controlling known named scores
@ eScore_PercentIdentity_GapOpeningOnly
@ eScore_PercentIdentity_Gapped
@ eScore_ConsensusSplices
@ eScore_PercentIdentity_Ungapped
@ eScore_HighQualityPercentCoverage
CRef< CSeq_align > CreateDensegFromDisc(SSeqIdChooser *SeqIdChooser=0) const
CRef< CScore > x_SetNamedScore(const string &name)
TSeqPos GetNumGapOpeningsWithinRanges(const CRangeCollection< TSeqPos > &ranges, TDim row=-1) const
CRef< CSeq_align > CreateDensegFromStdseg(SSeqIdChooser *SeqIdChooser=0) const
---------------------------------------------------------------------------- PRE : the Seq-align has ...
CRef< CSeq_align > x_CreateSubsegAlignment(int from, int to) const
Create a partial alignment containing the specified range of segments.
TSeqPos GetTotalGapCount(TDim row=-1) const
Retrieves the total number of gaps in the given row an alignment; all gaps by default.
TLengthRange ExonLengthRange() const
vector< SIndel > GetIndelsWithinRanges(const CRangeCollection< TSeqPos > &ranges, TDim row=-1) const
void OffsetRow(TDim row, TSignedSeqPos offset)
Offset row's coords.
CRangeCollection< TSeqPos > GetAlignedBases(TDim row) const
Retrieves the locations of aligned bases in the given row, excluding gaps and incontinuities.
vector< SIndel > GetNonFrameshiftsWithinRange(const TSeqRange &range, TDim row=-1) const
void Reverse(void)
Reverse the segments' orientation NOTE: currently *only* works for dense-seg.
TSeqPos GetNumGapOpeningsWithinRange(const TSeqRange &range, TDim row=-1) const
TLengthRange IntronLengthRange() const
static string ScoreName(EScoreType score)
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...
static string HelpText(EScoreType score)
CConstRef< CScore > x_GetNamedScore(const string &name) const
retrieve a named score object
vector< SIndel > GetNonFrameshifts(TDim row=-1) const
Retrieves descriptions of all non-frameshift indels on a given row; i.e.
TSeqPos GetNumFrameshiftsWithinRanges(const CRangeCollection< TSeqPos > &ranges, TDim row=-1) const
TSeqPos GetSeqStop(TDim row) const
CRef< CSeq_loc > CreateRowSeq_loc(TDim row) const
void SetNamedScore(const string &id, int score)
TDim CheckNumRows(void) const
Validatiors.
void SwapRows(TDim row1, TDim row2)
Swap the position of two rows in the alignment NOTE: currently *only* works for dense-seg & disc.
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.
TSeqPos GetTotalGapCountWithinRanges(const CRangeCollection< TSeqPos > &ranges, TDim row=-1) const
void ResetNamedScore(const string &name)
TSeqPos GetAlignLengthWithinRange(const TSeqRange &range, bool include_gaps=true) const
Get the length of this alignment within a specified range By default, this function computes an align...
void SplitOnLongDiscontinuity(list< CRef< CSeq_align > > &aligns, TSeqPos discontinuity_threshold) const
Split the alignment at any discontinuity greater than threshold; populate aligns list with new alignm...
vector< SIndel > GetFrameshiftsWithinRange(const TSeqRange &range, TDim row=-1) const
double AlignLengthRatio() const
vector< SIndel > GetIndelsWithinRange(const TSeqRange &range, TDim row=-1) const
TSeqPos GetTotalGapCountWithinRange(const TSeqRange &range, TDim row=-1) const
void RemapToLoc(TDim row, const CSeq_loc &dst_loc, bool ignore_strand=false)
TSeqPos GetSeqStart(TDim row) const
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
TSeqPos GetAlignLength(bool include_gaps=true) const
Get the length of this alignment.
vector< SIndel > GetFrameshifts(TDim row=-1) const
Retrieves descriptions of all frameshifts on a given row; i.e.
vector< SIndel > GetNonFrameshiftsWithinRanges(const CRangeCollection< TSeqPos > &ranges, TDim row=-1) const
TSeqPos GetNumFrameshiftsWithinRange(const TSeqRange &range, TDim row=-1) const
vector< SIndel > GetIndels(TDim row=-1) const
Retrieves descriptions of all indels on a given row.
TSeqPos GetNumFrameshifts(TDim row=-1) const
Retrieves the number of times a given row shifts frames; i.e.
TSeqPos GetAlignLengthWithinRanges(const CRangeCollection< TSeqPos > &ranges, bool include_gaps=true) const
Get the length of this alignment within a specified range By default, this function computes an align...
~CSeq_align(void)
destructor
static const TScoreNameMap & ScoreNameMap()
vector< SIndel > GetFrameshiftsWithinRanges(const CRangeCollection< TSeqPos > &ranges, TDim row=-1) const
void Validate(bool full_test=false) const
TLengthRange GapLengthRange() const
CConstRef< CUser_object > FindExt(const string &ext_type) const
Find extension by type in ext container.
static bool IsIntegerScore(EScoreType score)
pair< TSeqPos, TSeqPos > TLengthRange
TSeqPos GetNumGapOpenings(TDim row=-1) const
Retrieves the number of gap openings in a given row in an alignment (ignoring how many gaps are in th...
Seq-loc iterator class â iterates all intervals from a seq-loc in the correct order.
CSeq_loc_Mapper_Base â.
ENa_strand GetSeqStrand(TDim row) const
CRange< TSeqPos > GetSeqRange(TDim row) const
TDim CheckNumRows(void) const
void Validate(bool full_test=false) const
Validators.
TSeqPos GetSeqStart(TDim row) const
const CSeq_id & GetSeq_id(TDim row) const
TSeqPos GetSeqStop(TDim row) const
CRangeCollection< TSeqPos > GetRowSeq_insertions(CSeq_align::TDim row, const CSpliced_seg &seg) const
Return insertions within exon.
TSeqPos GetSeqStop(TDim row) const
CRange< TSeqPos > GetSeqRange(TDim row) const
GetSeqRange NB: In case the product-type is protein, these only return the amin part of Prot-pos.
TSeqPos GetSeqStart(TDim row) const
void Validate(bool full_test=false) const
Validators.
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
CRef< CSeq_align > AsDiscSeg() const
Convert this alignment to a discontinuous segment.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
#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.
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.
bool SerialEquals(const C &object1, const C &object2, ESerialRecursionMode how=eRecursive)
Compare serial objects.
C & SerialAssign(C &dest, const C &src, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators â.
const string AsFastaString(void) const
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
E_SIC Compare(const CSeq_id &sid2) const
Compare() - more general.
@ e_YES
SeqIds compared, but are different.
void SetPacked_int(TPacked_int &v)
ENa_strand GetStrand(void) const
Get the location's strand.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#define numeric_limits
Pre-declaration of the "numeric_limits<>" template Forcibly overrides (using preprocessor) the origin...
#define NCBI_RESUME_DEPRECATION_WARNINGS
#define NCBI_SUSPEND_DEPRECATION_WARNINGS
position_type GetLength(void) const
bool NotEmpty(void) const
bool IntersectingWith(const TThisType &r) const
TThisType & CombineWith(const TThisType &r)
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 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.
#define DEFINE_STATIC_FAST_MUTEX(id)
Define static fast mutex and initialize it.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
const TDenseg & GetDenseg(void) const
Get the variant data.
Tdata & Set(void)
Assign a value to data member.
TScore & SetScore(void)
Assign a value to Score data member.
vector< CRef< CSeq_loc > > TLoc
TSegs & SetSegs(void)
Assign a value to Segs data member.
TLens & SetLens(void)
Assign a value to Lens data member.
TDenseg & SetDenseg(void)
Select the variant.
E_Choice Which(void) const
Which variant is currently selected.
vector< CRef< CScore > > TScore
const TLoc & GetLoc(void) const
Get the Loc member data.
list< CRef< CStd_seg > > TStd
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
bool IsSetExt(void) const
extra info Check if a value has been assigned to Ext data member.
const TStarts & GetStarts(void) const
Get the Starts member data.
TDim GetDim(void) const
Get the Dim member data.
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
TGenomic_start GetGenomic_start(void) const
Get the Genomic_start member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
vector< ENa_strand > TStrands
const TLens & GetLens(void) const
Get the Lens member data.
void SetDim(TDim value)
Assign a value to Dim data member.
vector< TSignedSeqPos > TStarts
void SetDim(TDim value)
Assign a value to Dim data member.
list< CRef< CUser_object > > TExt
void SetType(TType value)
Assign a value to Type data member.
const TSpliced & GetSpliced(void) const
Get the variant data.
TDim GetDim(void) const
Get the Dim member data.
TExt & SetExt(void)
Assign a value to Ext data member.
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 CanGetDim(void) const
Check if it is safe to call GetDim method.
TDim GetDim(void) const
Get the Dim member data.
const TDendiag & GetDendiag(void) const
Get the variant data.
TDisc & SetDisc(void)
Select the variant.
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 TIds & GetIds(void) const
Get the Ids member data.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsSetScore(void) const
for whole alignment Check if a value has been assigned to Score data member.
TGenomic_end GetGenomic_end(void) const
Get the Genomic_end member data.
TNumseg GetNumseg(void) const
Get the Numseg 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.
const TScore & GetScore(void) const
Get the Score member data.
const TDisc & GetDisc(void) const
Get the variant data.
list< CRef< CDense_diag > > TDendiag
const TStrands & GetStrands(void) const
Get the Strands member data.
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
@ eType_partial
mapping pieces together
@ eType_disc
discontinuous alignment
bool IsEmpty(void) const
Check if variant Empty is selected.
ENa_strand
strand of nucleic acid
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
const TId & GetId(void) const
Get the Id member data.
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
TFrom GetFrom(void) const
Get the From member data.
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
TStrand GetStrand(void) const
Get the Strand member data.
TTo GetTo(void) const
Get the To member data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsPnt(void) const
Check if variant Pnt is selected.
unsigned int
A callback function used to compare two keys in a database.
const TYPE & Get(const CNamedParameterList *param)
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static const sljit_gpr r1
static const sljit_gpr r0
#define row(bind, expected)
string AsString(int row_pos) const
Create a Dense-seg from a Std-seg Used by AlnMgr to handle nucl2prot alignments.
virtual void ChooseSeqId(CSeq_id &id1, const CSeq_id &id2)=0
CSeq_align::TLengthRange range
void AddRange(CSeq_align::TLengthRange new_range)
void AddLength(TSeqPos length)
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
Strict weak ordering for pairs (by first) Used by CreateDensegFromDisc.
bool operator()(const T &x, const T &y)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4