indels = GetInDels(fs_only);
54 if(
i->IntersectingWith(
a,
b))
55selected_indels.push_back( *
i);
58 returnselected_indels;
66 if(!
i->IsMismatch())
67selected_indels.push_back(*
i);
70TExons::const_iterator e =
Exons().begin();
72 if(
i->IsMismatch() ||
i->Len()%3 == 0)
75 for( ;e !=
Exons().end() && (e->Limits().Empty() || !
i->IntersectingWith(e->GetFrom(),e->GetTo())); ++e);
76 if(
i->InDelEnd() > e->GetTo() && e !=
Exons().end()) {
77TInDels::const_iterator
next=
i;
79 int len=
i->Len() + (
i->GetType() ==
next->GetType() ?
next->Len() : -
next->Len());
87selected_indels.push_back(*
i);
91 returnselected_indels;
128 if(
Exons().back().Limits().NotEmpty()) {
135 if(
Exons().front().Limits().NotEmpty()) {
141 if(
Exons().back().Limits().NotEmpty()) {
165 for(
int i= (
int)
Exons().
size()-1;
i> 0; --
i) {
166 if(
Exons()[
i].m_fsplice &&
Exons()[
i-1].m_ssplice &&
Exons()[
i].m_fsplice_sig !=
"XX"&&
Exons()[
i-1].m_ssplice_sig !=
"XX") {
172 for(
int i= 0;
i< (
int)
Exons().size()-1; ++
i) {
173 if(
Exons()[
i].m_ssplice &&
Exons()[
i+1].m_fsplice &&
Exons()[
i].m_ssplice_sig !=
"XX"&&
Exons()[
i+1].m_fsplice_sig !=
"XX") {
179 return l> cds.
GetTo()+limit;
187 if(it->m_fsplice_sig !=
"XX")
189 if(it->m_ssplice_sig !=
"XX")
202 for(
intie = 0; ie < (
int)
Exons().size(); ++ie) {
203 if(
Exons()[ie].Limits().Empty())
204diff +=
Exons()[ie].m_seq.size();
206diff +=
Exons()[ie].Limits().GetLength();
211 if(
i->IsDeletion())
213 else if(
i->IsInsertion())
220 if(
a.Orientation() !=
g.Strand())
236vector<TSignedSeqRange> transcript_exons;
237 for(
intie = 0; ie < (
int)
Exons().size(); ++ie) {
245transcript_exons.push_back(texon);
254 return "UnknownTarget";
434 if(
r.NotEmpty()) {
500*s =
SPStop(mapper(*s,
false), s->m_status);
513new_cds_info = another_cds_info;
515new_cds_info = *
this;
558*
this= new_cds_info;
686 boolmodified =
false;
687 for(
unsigned int i= 1;
i<
Exons().size(); ++
i) {
688 boolhole = !
Exons()[
i-1].m_ssplice || !
Exons()[
i].m_fsplice;
689 intintron =
Exons()[
i].GetFrom()-
Exons()[
i-1].GetTo()-1;
692new_exons.back().m_ssplice =
Exons()[
i].m_ssplice;
693new_exons.back().AddTo(
Exons()[
i].GetTo()-
Exons()[
i-1].GetTo());
696 intloc =
Exons()[
i-1].GetTo() + 1 + (intron-
len)/2;
700new_exons.push_back(
Exons()[
i]);
785 if(intersection.
Empty())
790 MyExons()[
i].m_ssplice_sig.clear();
792 MyExons()[
i+1].m_fsplice=
false;
797 MyExons()[
i].m_fsplice_sig.clear();
799 MyExons()[
i-1].m_ssplice=
false;
803 MyExons()[
i-1].m_ssplice=
false;
807 MyExons()[
i+1].m_fsplice=
false;
823cds_clip_limits &= clip_limits;
826intersection =
Exons().front().Limits() & clip_limits;
829intersection =
Exons().back().Limits() & clip_limits;
831cds_clip_limits.
SetTo(intersection.
GetTo());
836precise_cds_clip_limits += e->Limits() & cds_clip_limits;
837cds_clip_limits = precise_cds_clip_limits;
851 if( cds_clip_limits.
NotEmpty()) {
857cds_clip_limits.
SetTo(
tmp.GetTo());
868 swap(left_determinant, right_determinant);
872 for(
auto& exon :
MyExons()) {
875 if(exon.GetFrom() <= clip_limits.
GetFrom()) {
876exon.m_fsplice =
false;
877exon.m_fsplice_sig.clear();
879 if(exon.GetTo() >= clip_limits.
GetTo()) {
880exon.m_ssplice =
false;
881exon.m_ssplice_sig.clear();
883exon.Limits() = clip;
914 MyExons().front().m_fsplice =
false;
916 MyExons().back().m_ssplice =
false;
924 Status() &= ~left_determinant;
926 Status() &= ~right_determinant;
933TInDels::const_iterator indl =
m_fshifts.begin();
935 for(CGeneModel::TExons::const_iterator e =
Exons().begin(); e !=
Exons().end() && indl !=
m_fshifts.end(); ++e) {
936 if(e->Limits().Empty())
939 for( ;indl !=
m_fshifts.end() && indl->InDelEnd() < (indl->IsDeletion() ? e->GetFrom() : e->GetFrom()+1); ++indl);
940 for( ;indl !=
m_fshifts.end() && e->GetFrom() == left && indl->IsDeletion() && indl->Loc() == left; ++indl);
942 if(indl !=
m_fshifts.end() && indl->Loc() < e->GetFrom()) {
944 intextra = e->GetFrom()-indl->Loc();
949 for( ; indl !=
m_fshifts.end() && indl->Loc() <= e->GetTo(); ++indl)
950indels.push_back(*indl);
952 for( ; indl !=
m_fshifts.end() && e->GetTo() != right && indl->IsDeletion() && indl->Loc() == e->GetTo()+1; ++indl)
953indels.push_back(*indl);
955 if(!indels.empty() && indels.back().InDelEnd() > e->GetTo()+1) {
956 _ASSERT(indels.back().IsMismatch());
957 intextra = indels.back().InDelEnd()-e->GetTo()-1;
958indels.back() =
CInDelInfo(indels.back().Loc(),indels.back().Len()-extra,
CInDelInfo::eMism,indels.back().GetInDelV().substr(0,indels.back().Len()-extra));
971 if(
i->IntersectingWith(
a,
b))
972fshifts.push_back( *
i);
1004 if(intersection==0 || intersection==
limits.GetLength() || intersection==alimits.
GetLength())
1021 return limits.IntersectingWith(alimits) &&
limits!= alimits;
1026pair<int, int> rslt(-1, -1);
1027 intlast_exon =
a.Exons().size()-1;
1030 if(last_exon == 0 ||
a.Limits().GetFrom() == intersect.
GetFrom())
1032 else if(last_exon == 1)
1033aleft = intersect.
GetFrom() >
a.Exons()[0].GetTo() ? 1 : 0;
1037aleft = std::lower_bound(
a.Exons().begin(),
a.Exons().end(), intersect.
GetFrom(), [](
const CModelExon& e,
TSignedSeqPosp){ return e.GetTo() < p; })-
a.Exons().begin();
1038 if(intersect.
GetFrom() <
a.Exons()[aleft].GetFrom())
1042 if(aleft == last_exon ||
a.Limits().GetTo() == intersect.
GetTo())
1044 else if(aleft == last_exon-1)
1045aright = intersect.
GetTo() >
a.Exons()[aleft].GetTo() ? last_exon : aleft;
1049aright = std::lower_bound(
a.Exons().begin()+aleft,
a.Exons().end(), intersect.
GetTo(), [](
const CModelExon& e,
TSignedSeqPosp){ return e.GetTo() < p; })-
a.Exons().begin();
1050 if(intersect.
GetTo() <
a.Exons()[aright].GetFrom())
1054rslt.second = aright;
1061 if(
b.Strand() !=
a.Strand())
1065 boolaflex =
false;
1076 boolbflex =
false;
1087 if(intersect.
GetLength() < min_overlap)
1097aright = rslt.second;
1107bright = rslt.second;
1110 if(aright-aleft != bright-bleft)
1113 for(
intea = aleft, eb = bleft; ea < aright; ++ea, ++eb) {
1114 if(
a.Exons()[ea].GetTo() !=
b.Exons()[eb].GetTo())
1116 if(
a.Exons()[ea+1].GetFrom() !=
b.Exons()[eb+1].GetFrom())
1120 return2*(aright-aleft)+1;
1130 if(intersect.
GetLength() <= 1)
return0;
1132 intanum = (
int)
a.Exons().size()-1;
1133 for(; intersect.
GetFrom() <
a.Exons()[anum].GetFrom() ; --anum);
1134 boolaexon = intersect.
GetFrom() <=
a.Exons()[anum].GetTo();
1135 if(!aexon && intersect.
GetTo() <
a.Exons()[anum+1].GetFrom())
return0;
1137 intbnum = (
int)
b.Exons().size()-1;
1138 for(; intersect.
GetFrom() <
b.Exons()[bnum].GetFrom(); --bnum);
1139 boolbexon = intersect.
GetFrom() <=
b.Exons()[bnum].GetTo();
1140 if(!bexon && intersect.
GetTo() <
b.Exons()[bnum+1].GetFrom())
return0;
1146 intfirstcommonpoint = -1;
1148unique_ptr<CAlignMap> pmapa, pmapb;
1150 while(left <= intersect.
GetTo())
1152 TSignedSeqPosaright = aexon ?
a.Exons()[anum].GetTo() :
a.Exons()[anum+1].GetFrom()-1;
1153 TSignedSeqPosbright = bexon ?
b.Exons()[bnum].GetTo() :
b.Exons()[bnum+1].GetFrom()-1;
1156 if(!aexon && bexon)
1158 if(
a.Exons()[anum].m_ssplice &&
a.Exons()[anum+1].m_fsplice)
return0;
1159 if(left ==
a.Exons()[anum].GetTo()+1 &&
a.Exons()[anum].m_ssplice)
return0;
1160 if(right == aright &&
a.Exons()[anum+1].m_fsplice)
return0;
1162 if(aexon && !bexon)
1164 if(
b.Exons()[bnum].m_ssplice &&
b.Exons()[bnum+1].m_fsplice)
return0;
1165 if(left ==
b.Exons()[bnum].GetTo()+1 &&
b.Exons()[bnum].m_ssplice)
return0;
1166 if(right == bright &&
b.Exons()[bnum+1].m_fsplice)
return0;
1169 if(aexon && bexon) {
1170 if(firstcommonpoint < 0) {
1171firstcommonpoint = left;
1172}
else if((anum > 0 && left ==
a.Exons()[anum].GetFrom() && !
a.Exons()[anum].m_fsplice) ||
1173(bnum > 0 && left ==
b.Exons()[bnum].GetFrom() && !
b.Exons()[bnum].m_fsplice)) {
1176pmapa.reset(
new CAlignMap(
a.Exons(),
a.FrameShifts(),
a.Strand()));
1177pmapb.reset(
new CAlignMap(
b.Exons(),
b.FrameShifts(),
b.Strand()));
1178afirst = pmapa->MapOrigToEdited(firstcommonpoint);
1179bfirst = pmapb->MapOrigToEdited(firstcommonpoint);
1180 if(afirst < 0 || bfirst < 0)
return0;
1185 if(asecond < 0 || bsecond < 0 || (asecond-afirst)%3 != (bsecond-bfirst)%3)
return0;
1189 if(aexon && aright == right &&
a.Exons()[anum].m_ssplice &&
1190bexon && bright == right &&
b.Exons()[bnum].m_ssplice) ++commonspl;
1191 if(!aexon && aright == right &&
a.Exons()[anum+1].m_fsplice &&
1192!bexon && bright == right &&
b.Exons()[bnum+1].m_fsplice) ++commonspl;
1196 if(right == aright)
1202 if(right == bright)
1209 returnfirstcommonpoint >= 0 ? commonspl+1 : 0;
1217 for(
unsigned int i= 1;
i<
a.Exons().
size(); ++
i) {
1218 if(!
a.Exons()[
i-1].m_ssplice || !
a.Exons()[
i].m_fsplice){
1221 if(k->Limits().IntersectingWith(hole)) {
1242 MyExons().back().m_ssplice =
true;
1248 MyExons().front().m_fsplice =
true;
1269 else if(!infront) {
1271 MyExons().back().m_ssplice =
true;
1277 MyExons().front().m_fsplice =
true;
1293 else if(!infront) {
1295 MyExons().back().m_ssplice =
true;
1297 MyExons().back().m_ssplice_sig =
"XX";
1303 MyExons().front().m_fsplice =
true;
1305 MyExons().front().m_fsplice_sig =
"XX";
1341 for(
int i= 0;
i<
int(exons_with_gaps.size())-1; ++
i) {
1342 if(exons_with_gaps[
i].GetTo() < left_edge && left_edge < exons_with_gaps[
i+1].GetFrom()) {
1343 _ASSERT( !exons_with_gaps[
i].m_ssplice && !exons_with_gaps[
i+1].m_fsplice );
1344 _ASSERT( right_edge >= exons_with_gaps[
i+1].GetFrom() );
1350 for(
inttpos = tlim.
GetFrom()+del; left_edge < 0 && tpos <= tlim.
GetTo(); tpos += 3) {
1358 if(exons_with_gaps[
i].GetTo() < right_edge && right_edge < exons_with_gaps[
i+1].GetFrom()) {
1359 _ASSERT( !exons_with_gaps[
i].m_ssplice && !exons_with_gaps[
i+1].m_fsplice );
1360 _ASSERT( left_edge <= exons_with_gaps[
i].GetTo() );
1366 for(
inttpos = tlim.
GetTo()-del; right_edge < 0 && tpos >= tlim.
GetFrom(); tpos -= 3) {
1393 for(
i=0,j=0;
i<
a.size() || j<
b.size(); ) {
1394 if(
i==
a.size())
1396 else if(j==
b.size())
1398 else if(
a[
i].GetTo()+1<
b[j].GetFrom())
1400 else if(
b[j].GetTo()+1<
a[
i].GetFrom())
1403 b[j].Extend(
a[
i++]);
1404 while(j+1<
b.size() &&
b[j].GetTo()+1>=
b[j+1].GetFrom()) {
1405 b[j+1].Extend(
b[j]);
1410 MyExons().back().m_ident = 0;
1422 if(indl->IsDeletion())
1424TInDels::const_iterator
next= indl;
1441 if(
Exons()[0].Limits().NotEmpty()) {
1460 MyExons().front().AddFrom(-amount);
1467 MyExons().back().AddTo(amount);
1503 #ifdef HAVE_IOS_REGISTER_CALLBACK 1507 T&
slot(ios_base& iob)
1509 void*&p = iob.pword(m_index);
1510 T*c =
static_cast<T*
>(p);
1513iob.register_callback(ios_callback, m_index);
1519 static voidios_callback(ios_base::event e, ios_base& iob,
intindex)
1521 if(e == ios_base::erase_event) {
1522 delete static_cast<T*
>(iob.pword(index));
1523}
else if(e == ios_base::copyfmt_event) {
1524 void*&p = iob.pword(index);
1526 T*old =
static_cast<T*
>(p);
1599is.setstate(ios::failbit);
1645 r.print(os);
returnos;
1649 const char* dot =
".";
1655os << (
seqid.empty()?dot:
seqid) <<
'\t';
1657os << (
type.empty()?dot:
type) <<
'\t';
1659os << (
start+1) <<
'\t';
1663os << (
end+1) <<
'\t';
1668 if(
phase< 0) os << dot;
elseos <<
phase; os <<
'\t';
1670os <<
"model="<<
model;
1672 if(!
i->second.empty())
1673os <<
';'<<
i->first <<
'='<<
i->second;
1700rec.
start= NStr::StringToNumeric<int>(v[3])-1;
1703rec.
end= NStr::StringToNumeric<int>(v[4])-1;
1704rec.
score= v[5]==dot?
BadScore():NStr::StringToNumeric<double>(v[5]);
1706rec.
phase= v[7]==dot?-1:NStr::StringToNumeric<int>(v[7]);
1710 boolmodel_id_present =
false;
1716 if(
key==
"model") {
1717rec.
model= NStr::StringToNumeric<Int8>(
value);
1718model_id_present =
true;
1719}
else if(
key==
"Target") {
1722rec.
tstart= NStr::StringToNumeric<int>(tt[1])-1;
1723rec.
tend= NStr::StringToNumeric<int>(tt[2])-1;
1724 if(tt.size() > 3 && tt[3] ==
"-")
1731 if(!model_id_present)
1744 if(prev_pos < indel.
Loc())
1763 intprev_pos = start;
1766 if(indel.
Loc() < start)
1776 if(prev_pos < end+1)
1787vector<string> operations;
1792 if((*o)[0] ==
'c') {
1794o->erase(o->begin());
1795}
else if((*o)[0] ==
'n') {
1797o->erase(o->begin());
1800 if((*o)[0] ==
'M') {
1802}
else if((*o)[0] ==
'D') {
1804indels.back().SetStatus(status);
1806}
else if((*o)[0] ==
'I') {
1808 len= (
int)o->length()-1;
1811indels.back().SetStatus(status);
1815 len= (
int)o->length()-1;
1818indels.back().SetStatus(status);
1829 if((
type&
eProt)!=0)
return "ProSplign";
1837 if(
a.GeneID()!=0)
1839 if(
a.RankInGene()!=0)
1841 if(
a.TrustedGroup()!=0)
1867 if(
a.TargetLen() > 0)
1870 if(
a.Ident() > 0)
1873 if(
a.Weight() > 1)
1876 if(!
a.ProteinHit().empty())
1901 if(
a.GetCdsInfo().ReadingFrame().NotEmpty()) {
1920 booltCoords =
false;
1926 if(protcds.
NotEmpty() && protcds != rf) {
1935 else if(cds_info.
OpenCds())
1937 attributes[
"flags"] +=
","+adj+
"Start";
1955 if(
a.isNMD(50))
attributes[
"flags"] +=
",NMD";
1984 return TSignedSeqRange(NStr::StringToNumeric<TSignedSeqPos>(start)-1,NStr::StringToNumeric<TSignedSeqPos>(stop)-1);
1989 boolopen_cds =
false;
1990 boolconfirmed_start =
false;
1991 boolconfirmed_stop =
false;
1992 boolhas_start =
false;
1993 boolhas_stop =
false;
1994 booltcoords =
false;
1996vector<string>
flags;
2021 else if(*
f==
"ConfirmedStart") { confirmed_start =
true; has_start =
true; }
2022 else if(*
f==
"PutativeStart") { open_cds =
true; has_start =
true; }
2023 else if(*
f==
"Start") has_start =
true;
2024 else if(*
f==
"ConfirmedStop") { confirmed_stop =
true; has_stop =
true; }
2025 else if(*
f==
"Stop") has_stop =
true;
2026 else if(*
f==
"tCoords") tcoords =
true;
2032 a.SetRankInGene(NStr::StringToNumeric<int>(
attributes[
"rankInGene"]));
2035 a.SetTrustedGroup(NStr::StringToNumeric<int>(
attributes[
"TrustedGroup"]));
2046target =
"gnl|GNOMON|"+target.substr(4);
2048target =
"pir||"+target;
2052 a.SetTargetId(*target_id);
2056vector<string> support;
2058 ITERATE(vector<string>, s, support) {
2059 boolcore = (*s)[0] ==
'*';
2060 Int8 id= NStr::StringToNumeric<Int8>(core ? s->substr(1) : *s);
2065vector<string> trustedmrna;
2067 ITERATE(vector<string>, s, trustedmrna) {
2071vector<string> trustedprot;
2073 ITERATE(vector<string>, s, trustedprot) {
2080 a.SetIdent(NStr::StringToNumeric<double>(
attributes[
"Ident"]));
2083 a.SetWeight(NStr::StringToNumeric<double>(
attributes[
"Weight"]));
2096protcds =
a.GetAlignMap().MapRangeOrigToEdited(protcds,
false);
2103 swap(has_start, has_stop);
2114reading_frame.
SetTo(reading_frame.
GetTo()-3);
2118 swap(has_start, has_stop);
2123cds_info.
SetStart(start,confirmed_start);
2125cds_info.
SetStop(stop,confirmed_stop);
2128vector<string> stops;
2130 ITERATE(vector<string>, s, stops) {
2131vector<string> parts;
2135pstop =
a.GetAlignMap().MapRangeOrigToEdited(pstop,
false);
2137 if(parts.size() > 2) {
2138 if(parts[2] ==
"C")
2140 else if(parts[2] ==
"N")
2142 else if(parts[2] ==
"S")
2147cds_info.
AddPStop(pstop, status);
2154max_cds_limits = tlim;
2166max_cds_limits =
a.GetAlignMap().MapRangeOrigToEdited(max_cds_limits,
false);
2170 if(max_cds_limits.
GetTo() < tlim.
GetTo())
2180 a.SetCdsInfo(cds_info);
2188 a.SetCdsInfo(cds_info);
2197 if(
a.Strand() ==
ePlus)
2199 else if(
a.Strand() ==
eMinus)
2203mrna.
type=
"mRNA";
2204mrna.
start=
a.Limits().GetFrom();
2205mrna.
end=
a.Limits().GetTo();
2206mrna.
score=
a.Score();
2213vector<SGFFrec> exons,cdss;
2217exon.
type=
"exon";
2236 TInDelscorrections =
a.FrameShifts();
2237 for(
unsigned int i= 0;
i<
a.Exons().
size(); ++
i) {
2266exon.
attributes[
"Target"] = targetid+target;
2279 if(
a.Strand() ==
ePlus) {
2280exon.
attributes[
"Splices"] = fs+
".."+ss;
2282exon.
attributes[
"Splices"] = ss+
".."+fs;
2286exons.push_back(exon);
2299 TSignedSeqRangecds_limits =
a.GetAlignMap().MapRangeEditedToOrig(tcds,
true);
2310cds.
attributes[
"Target"] = targetid+ctarget;
2311cdss.push_back(cds);
2316 if(!
a.Continuous()) {
2319 if(exons.front().start >= 0) {
2320rec.
start= exons.front().start;
2322 _ASSERT(exons.size() > 1 && exons[1].start >= 0);
2323rec.
start= exons[1].start;
2325 if(exons.back().end >= 0) {
2326rec.
end= exons.back().end;
2328 _ASSERT(exons.size() > 1 && exons[exons.size()-2].end >= 0);
2329rec.
end= exons[exons.size()-2].end;
2331rec.
type=
"mRNA_part";
2336e->attributes[
"Parent"] += suffix;
2342 if(
a.Strand()==
ePlus)
2345phase = (e->tend - e->tstart+1 - phase)%3;
2348phase = (3-phase)%3;
2350e->attributes[
"Parent"] += suffix;
2363{
return Precede( __x, __y ); }
2371 if(
a.GetFrom()==
b.GetFrom())
2372 a.SetFrom(
b.GetTo()+1);
2373 else if(
a.GetTo()==
b.GetTo())
2374 a.SetTo(
b.GetFrom()-1);
2392vector<SGFFrec> recs;
2395recs.push_back(rec);
2396}
while(is >> rec && rec.
seqid== recs.front().seqid && rec.
model==
id&& rec.
type!=
"mRNA");
2409 booltcoords =
false;
2411vector<CModelExon> exons;
2412vector<TSignedSeqRange> transcript_exons;
2423 else if(rec.
strand==
'-')
2430 if(
r->type ==
"mRNA") {
2433}
else if(
r->type ==
"exon") {
2434 if(
r->tstart >= 0 &&
r->tstrand ==
'-') {
2439 if(!
r->attributes[
"Splices"].empty()) {
2440 stringsplices =
r->attributes[
"Splices"];
2441 autoispl = splices.find(
"..");
2442 if(ispl != string::npos) {
2444fs = splices.substr(0,2);
2445 if(ispl+4 == splices.length())
2446ss = splices.substr(ispl+2,2);
2453 if(!
r->attributes[
"Ident"].empty()) {
2454eident = NStr::StringToNumeric<double>(
r->attributes[
"Ident"]);
2457 if(
r->start >= 0 &&
r->end >= 0)
2458exons.push_back(
CModelExon(
r->start,
r->end,
false,
false,fs,ss,eident));
2461 if(!
r->attributes[
"Source"].empty()) {
2464 _ASSERT((
int)v.size() == 4);
2466src.
m_range.
SetFrom(NStr::StringToNumeric<TSignedSeqPos>(v[1])-1);
2467src.
m_range.
SetTo(NStr::StringToNumeric<TSignedSeqPos>(v[2])-1);
2473exons.push_back(
CModelExon(1,-1,
false,
false,fs,ss,eident,
r->attributes[
"Seq"],src));
2477transcript_exons.push_back(texon);
2478 readGFF3Gap(
r->attributes[
"Gap"],
r->start,
r->end, indels);
2479 if(!
r->attributes[
"Target"].empty())
2480 attributes[
"Target"] =
r->attributes[
"Target"];
2481}
else if(
r->type ==
"CDS") {
2484 if(
r->strand==
'+') {
2490 if(
r->tstart < 0) {
2499}
else if(
r->type ==
"mRNA_part") {
2504 for(
int i= 0;
i< (
int)exons.size(); ++
i) {
2506 if(
a.Limits().IntersectingWith(e.
Limits())) {
2509 if(
i> 0 && exons[
i-1].Limits().NotEmpty()) {
2517 sort(indels.begin(),indels.end());
2519 if(!transcript_exons.empty())
2520amap =
CAlignMap(
a.Exons(), transcript_exons, indels,
a.Orientation(), NStr::StringToNumeric<int>(
attributes[
"TargetLen"]));
2522amap =
CAlignMap(
a.Exons(), indels,
a.Strand());
2524 a.FrameShifts() = indels;
2579os.setstate(ios::failbit);
2590is.setstate(ios::failbit);
2596: m_id( model_id), m_core_align(core)
void remove_if(Container &c, Predicate *__pred)
TSignedSeqPos FShiftedMove(TSignedSeqPos orig_pos, int len) const
TSignedSeqRange MapRangeEditedToOrig(TSignedSeqRange edited_range, bool withextras=true) const
TSignedSeqPos MapOrigToEdited(TSignedSeqPos orig_pos) const
TSignedSeqPos MapEditedToOrig(TSignedSeqPos edited_pos) const
TSignedSeqRange ShrinkToRealPoints(TSignedSeqRange orig_range, bool snap_to_codons=false) const
int FShiftedLen(TSignedSeqRange ab, ERangeEnd lend, ERangeEnd rend) const
TSignedSeqRange MapRangeOrigToEdited(TSignedSeqRange orig_range, ERangeEnd lend, ERangeEnd rend) const
string TargetAccession() const
void RecalculateAlignMap(int left, int right)
CConstRef< objects::CSeq_id > GetTargetId() const
virtual CAlignMap GetAlignMap() const
void SetTargetId(const objects::CSeq_id &id)
void Cut(TSignedSeqRange hole)
CCDSInfo MapFromEditedToOrig(const CAlignMap &amap) const
bool PStop(bool includeall=true) const
void SetStart(TSignedSeqRange r, bool confirmed=false)
CCDSInfo MapFromOrigToEdited(const CAlignMap &amap) const
TSignedSeqRange MaxCdsLimits() const
void Set5PrimeCdsLimit(TSignedSeqPos p)
void Remap(const CRangeMapper &mapper)
bool IsMappedToGenome() const
void SetScore(double score, bool open=false)
bool m_genomic_coordinates
TSignedSeqRange m_reading_frame_from_proteins
TSignedSeqRange Start() const
bool ConfirmedStart() const
TSignedSeqRange m_reading_frame
void Clip(TSignedSeqRange limits)
void AddPStop(SPStop stp)
TSignedSeqRange Cds() const
void CombineWith(const CCDSInfo &another_cds_info)
TSignedSeqRange ReadingFrame() const
TSignedSeqRange m_max_cds_limits
TSignedSeqRange ProtReadingFrame() const
void SetStop(TSignedSeqRange r, bool confirmed=false)
const TPStops & PStops() const
bool ConfirmedStop() const
void Clear5PrimeCdsLimit()
void SetReadingFrame(TSignedSeqRange r, bool protein=false)
bool operator==(const CCDSInfo &another) const
TSignedSeqRange Stop() const
void AddExon(TSignedSeqRange exon, const string &fs="", const string &ss="", double ident=0, const string &seq="", const CInDelInfo::SSource &src=CInDelInfo::SSource())
TSignedSeqPos FShiftedMove(TSignedSeqPos pos, int len) const
void ExtendRight(int amount)
void RemoveExtraFShifts(int left, int right)
bool isNMD(int limit=50) const
void TrimEdgesToFrameInOtherAlignGaps(const TExons &exons_with_gaps)
void AddNormalExon(TSignedSeqRange exon, const string &fs, const string &ss, double ident, bool infront)
virtual void CutExons(TSignedSeqRange hole)
int MutualExtension(const CGeneModel &a) const
TSignedSeqRange TranscriptLimits() const
void Extend(const CGeneModel &a, bool ensure_cds_invariant=true)
EStrand Orientation() const
int FShiftedLen(TSignedSeqRange ab, bool withextras=true) const
const TExons & Exons() const
TSignedSeqRange ReadingFrame() const
virtual CAlignMap GetAlignMap() const
TSignedSeqRange RealCdsLimits() const
TSignedSeqRange TranscriptExon(int i) const
void ReverseComplementModel()
void CombineCdsInfo(const CGeneModel &a, bool ensure_cds_invariant=true)
void SetStrand(EStrand s)
void RemoveShortHolesAndRescore(const CGnomonEngine &gnomon)
virtual void Clip(TSignedSeqRange limits, EClipMode mode, bool ensure_cds_invariant=true)
void SetCdsInfo(const CCDSInfo &cds_info)
void AddGgapExon(double ident, const string &seq, const CInDelInfo::SSource &src, bool infront)
TSignedSeqRange Limits() const
bool IsSubAlignOf(const CGeneModel &a) const
int HasCompatibleOverlap(const CGeneModel &a, int min_overlap=2) const
const CCDSInfo & GetCdsInfo() const
vector< CModelExon > TExons
bool CdsInvariant(bool check_start_stop=true) const
TSignedSeqRange MaxCdsLimits() const
bool ConfirmedStart() const
void ExtendLeft(int amount)
TInDels GetInDels(bool fs_only) const
static string TypeToString(int type)
void Remap(const CRangeMapper &mapper)
int isCompatible(const CGeneModel &a) const
void GetScore(CGeneModel &model, bool extend5p=false, bool obeystart=false, bool extend_max_cds=false) const
int GetMinIntronLen() const
static CRef< CSeq_id > GnomonMRNA(Int8 id)
static CRef< CSeq_id > ToSeq_id(const string &str)
static string ToString(const CSeq_id &id)
TSignedSeqPos Loc() const
EStatus GetStatus() const
CInDelInfo::SSource m_source
TSignedSeqPos GetFrom() const
const TSignedSeqRange & Limits() const
TSignedSeqPos GetTo() const
void Extend(const CModelExon &e)
map< IOS_BASE *, T > TMap
CStreamState(const T &deflt)
bool operator==(const CSupportInfo &s) const
CSupportInfo(Int8 model_id, bool core=false)
bool operator<(const CSupportInfo &s) const
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
parent_type::iterator iterator
const_iterator end() const
const_iterator lower_bound(const key_type &key) const
bool Empty(const CNcbiOstrstream &src)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const struct attribute attributes[]
static const TDS_WORD limits[]
CNcbiIstream & Getline(CNcbiIstream &is, string &line)
CStreamState< string > contig_stream_state(kEmptyStr)
CNcbiOstream & printGFF3(CNcbiOstream &os, CAlignModel a)
TSignedSeqRange StringToRange(const string &s)
void readGFF3Gap(const string &gap, TSignedSeqPos start, TSignedSeqPos end, TInDels &indels)
void ParseAttributes(map< string, string > &attributes, CAlignModel &a)
CNcbiOstream & operator<<(CNcbiOstream &s, const setcontig &c)
CStreamState< EModelFileFormat > model_file_format_state(eGFF3FileFormat)
CNcbiIstream & InputError(CNcbiIstream &is)
CStreamState< pair< string, string > > line_buffer(make_pair(kEmptyStr, kEmptyStr))
void CollectAttributes(const CAlignModel &a, map< string, string > &attributes)
TSignedSeqRange operator-(TSignedSeqRange a, TSignedSeqRange b)
void Ungetline(CNcbiIstream &is)
CNcbiIstream & operator>>(CNcbiIstream &is, const getcontig &c)
pair< int, int > ExonNumsForInterval(const CGeneModel &a, TSignedSeqRange &intersect)
string BuildGFF3Gap(int &prev_pos, const CInDelInfo &indel)
CNcbiIstream & readGFF3(CNcbiIstream &is, CAlignModel &align)
bool Precede(TSignedSeqRange l, TSignedSeqRange r)
bool Include(TSignedSeqRange big, TSignedSeqRange small)
void ReverseComplement(const BidirectionalIterator &first, const BidirectionalIterator &last)
vector< CInDelInfo > TInDels
#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 VECTOR_ERASE(Var, Cont)
Use this macro inside body of ERASE_ITERATE cycle to erase from vector-like container.
#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)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Error(CExceptionArgs_Base &args)
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
int64_t Int8
8-byte (64-bit) signed integer
position_type GetLength(void) const
bool NotEmpty(void) const
bool IntersectingWith(const TThisType &r) const
TThisType & CombineWith(const TThisType &r)
static TThisType GetEmpty(void)
static position_type GetWholeFrom(void)
CRange< TSignedSeqPos > TSignedSeqRange
static TThisType GetWhole(void)
static position_type GetWholeTo(void)
#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.
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
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.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ fAllowLeadingSymbols
Ignore leading non-numeric characters.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
#define NCBI_XALGOGNOMON_EXPORT
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTo(TTo value)
Assign a value to To data member.
unsigned int
A callback function used to compare two keys in a database.
constexpr auto sort(_Init &&init)
constexpr auto front(list< Head, As... >, T=T()) noexcept -> Head
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Useful/utility classes and methods.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
bool operator()(const TSignedSeqRange &__x, const TSignedSeqRange &__y) const
void print(CNcbiOstream &os) const
map< string, string > attributes
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
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