<
classTHit>
119 template<
classTHit>
145 for(
size_t i= 0;
i<
m_gaps->size(); ++
i) {
146 TCoordgfrom = (*m_gaps)[
i].first;
147 TCoordgto = (*m_gaps)[
i].second;
148 if( gfrom < to && from < gto ) {
160 constvector<pair<TCoord, TCoord> > *
m_gaps;
164 template<
classTHit>
184 typenameTHitRefs::const_iterator finish,
268 size_t Run(
boolcross_filter =
false);
403 typenameTHitRefs::iterator ihr,
404 typenameTHitRefs::iterator ihr_e,
406 size_tmin_compartment_hit_len);
417 template<
classTHit>
440 boolcross_filter =
false);
461 typenameTHitRefs::iterator finish,
465 boolcross_filter =
false,
CScope*scope =
NULL,
466 constvector<pair<TCoord, TCoord> > *gaps =
NULL);
476 void Run(
typenameTHitRefs::iterator start,
477 typenameTHitRefs::iterator finish,
CScope*scope =
NULL,
478 constvector<pair<TCoord, TCoord> > *gaps =
NULL);
522 size_tvalid_count (0);
527pair<size_t, size_t> rv (
m_pending.size(), valid_count);
567 TCoordmin_singleton_matches,
boolcross_filter);
599 template<
classTHit>
607 template<
classTHit>
610 if(m_members.size()) {
611 returnm_members.front()->GetSubjStrand();
616 "Strand requested on an empty compartment");
621 template<
classTHit>
623 typenameTHitRefs::const_iterator start,
624 typenameTHitRefs::const_iterator finish,
642 template<
classTHit>
653qmax (ph->GetQueryMax());
655 returnacm + ph->GetIdentity() * ((
m_Finish= qmax) - qmin + 1);
659 returnacm + ph->GetIdentity() * ((
m_Finish= qmax) - finish0);
673 template<
classTHit>
680THitComparator sorter (THitComparator::eQueryMin);
681stable_sort(hitrefs.begin(), hitrefs.end(), sorter);
683 const doublerv (accumulate(hitrefs.begin(), hitrefs.end(), 0.0,
689 template<
classTHit>
692 const doublekMinusInf (-1e12);
694m_compartments.clear();
695 const size_tdimhits = m_hitrefs.size();
705stable_sort(m_hitrefs.begin(), m_hitrefs.end(),
706THitComparator(THitComparator::eSubjMaxQueryMax));
714 typedefvector<SHitStatus> THitData;
715THitData hitstatus (dimhits);
717 const TCoordsubj_min_global (m_hitrefs.front()->GetSubjMin());
720 for(
int i(0); i < static_cast<int>(dimhits); ++
i) {
723 const doubleidentity (h->GetIdentity());
725h->GetQueryMin(), h->GetQueryMax(),
726h->GetSubjMin(), h->GetSubjMax()
731cerr << endl << *h << endl;
734 doublebest_ext_score (kMinusInf);
737 doublebest_open_score (identity*(hbox[1] - hbox[0] + 1) - m_penalty);
738 inti_best_open (-1);
740 if(hbox[2] + m_max_overlap > m_hitrefs[i_bestsofar]->GetSubjMax()) {
742 const doublescore_open (identity*(hbox[1] - hbox[0] + 1)
743+ hitstatus[i_bestsofar].m_score
746 if(score_open > best_open_score) {
747best_open_score = score_open;
748i_best_open = i_bestsofar;
753 for(
intj (
i- 1); j >= 0; --j) {
755 const doublescore_open (identity * (hbox[1] - hbox[0] + 1)
756+ hitstatus[j].m_score
759 if(score_open > best_open_score
760&& hbox[2] + m_max_overlap > m_hitrefs[j]->GetSubjMax())
762best_open_score = score_open;
768 for(
intj =
i; j >= 0; --j) {
775phcbox[0] = phc->GetQueryMin();
776phcbox[1] = phc->GetQueryMax();
777phcbox[2] = phc->GetSubjMin();
778phcbox[3] = phc->GetSubjMax();
781cerr <<
'\t'<< *phc << endl;
786cerr <<
"\t[Dummy]"<< endl;
799 if( ( phcbox[1] < hbox[1] && phcbox[0] < hbox[0] )
800&& phcbox[2] <= hbox[2]
803 if(hbox[0] <= phcbox[1] &&
804hbox[2] + phcbox[1] - hbox[0] >= phcbox[3]) {
807s0 = hbox[2] + phcbox[1] - hbox[0];
809 else if(phcbox[3] >= hbox[2]) {
812q0 = hbox[1] - (hbox[3] - s0);
819subj_space = s0 - phcbox[3] - 1;
826good = (subj_space <=
int(m_intron_max))
827&& (s0 < hbox[3] && q0 < hbox[1]);
831 if( phcbox[3] <= hbox[2] ) {
832 if( ( m_prec_gap_info && m_prec_gap_info->IntersectsNonBridgeableGap(phcbox[3], hbox[2]) ) ||
833( m_gap_info && m_gap_info->IntersectsNonBridgeableGap(phcbox[3], hbox[2]) ) ) {
840intron_start = phcbox[3];
847 const doublejscore (hitstatus[j].m_score);
848 const doubleintron_penalty ((subj_space > 0)?
852 const doubleext_score (jscore +
853identity * (hbox[1] - q0 + 1) + intron_penalty);
855 if(ext_score > best_ext_score) {
856best_ext_score = ext_score;
860cerr <<
"\tGood for extension with score = "<< ext_score << endl;
869 if(best_ext_score > best_open_score) {
871hit_type = SHitStatus::eExtension;
872prev_hit = i_best_ext;
873best_score = best_ext_score;
877hit_type = SHitStatus::eOpening;
878prev_hit = i_best_open;
879best_score = best_open_score;
882hitstatus[
i].m_type = hit_type;
883hitstatus[
i].m_prev = prev_hit;
884hitstatus[
i].m_score = best_score;
886 if(best_score > hitstatus[i_bestsofar].m_score) {
891cerr <<
"Status = "<< ((hit_type == SHitStatus::eOpening)?
"Open":
"Extend")
892<<
'\t'<< best_score << endl;
893 if(prev_hit == -1) {
894cerr <<
"[Dummy]"<< endl;
897cerr << *(m_hitrefs[prev_hit]) << endl;
903cerr <<
"\n\n--- BACKTRACE ---\n";
908 const doublescore_best (hitstatus[i_bestsofar].m_score);
909 const doublemin_matches (m_MinSingletonMatches < m_MinMatches?
910m_MinSingletonMatches: m_MinMatches);
912vector<bool> comp_status;
913 if(score_best + m_penalty >= min_matches) {
916 boolnew_compartment (
true);
920 if(new_compartment) {
922 const doublemp (GetTotalMatches<THit>(hitrefs));
926m_compartments.back().SetMembers() = hitrefs;
927comp_status.push_back(mp >= m_MinMatches);
931new_compartment =
false;
933hitrefs.push_back(m_hitrefs[
i]);
936cerr << *(m_hitrefs[
i]) << endl;
939 if(hitstatus[
i].m_type == SHitStatus::eOpening) {
940new_compartment =
true;
942 i= hitstatus[
i].m_prev;
945 const doublemp (GetTotalMatches<THit>(hitrefs));
947 boolstatus ( ( m_compartments.size() == 0 && mp >= m_MinSingletonMatches )
948|| mp >= m_MinMatches );
950m_compartments.back().SetMembers() = hitrefs;
951comp_status.push_back(status);
955 if(cross_filter && m_compartments.size()) {
957 const TCoordkMinCompartmentHitLength (8);
960 for(
size_ticn (m_compartments.size()), ic (0); ic < icn; ++ic) {
964 size_tnullified (0);
965 for(
int in(
static_cast<int>(hitrefs.size())),
i(
in- 1);
i> 0; --
i) {
968 while(j1 <
in&& hitrefs[j1].IsNull()) ++j1;
969 if(j1 ==
in)
continue;
974 if(h1.
IsNull())
continue;
976 const TCoord* box1o (h1->GetBox());
977 TCoordbox1 [4] = {box1o[0], box1o[1], box1o[2], box1o[3]};
978 const TCoord* box2o (h2->GetBox());
979 TCoordbox2 [4] = {box2o[0], box2o[1], box2o[2], box2o[3]};
981 const intqd (box1[1] - box2[0] + 1);
982 const intsd (box1[3] - box2[2] + 1);
983 if(qd > sd && qd > 0) {
985 if(box2[0] <= box1[0] + kMinCompartmentHitLength) {
987 #ifdef ALGOALIGNUTIL_COMPARTMENT_FINDER_KEEP_TERMINII 989 TCoordnew_coord (box1[0] + (box1[1] - box1[0])/2);
990 if(box1[0] + 1 <= new_coord) {
996h1->Modify(1, new_coord);
1006h1->Modify(1, box2[0] - 1);
1009 if(box2[1] <= box1[1] + kMinCompartmentHitLength) {
1011 #ifdef ALGOALIGNUTIL_COMPARTMENT_FINDER_KEEP_TERMINII 1013 TCoordnew_coord (box2[0] + (box2[1] - box2[0])/2);
1014 if(box2[1] >= new_coord + 1) {
1018new_coord = box2[1];
1020h2->Modify(0, new_coord);
1030h2->Modify(0, box1[1] + 1);
1035 if(box2[2] <= box1[2] + kMinCompartmentHitLength) {
1037 if(
i+ 1 ==
in) {
1038 TCoordnew_coord (box1[2] + (box1[3] - box1[2])/2);
1039 if(box1[2] + 1 <= new_coord) {
1043new_coord = box1[2];
1045h1->Modify(3, new_coord);
1053h1->Modify(3, box2[2] - 1);
1056 if(box2[3] <= box1[3] + kMinCompartmentHitLength) {
1059 TCoordnew_coord (box2[2] + (box2[3] - box2[2])/2);
1060 if(box2[3] >= new_coord + 1) {
1064new_coord = box2[3];
1067h2->Modify(2, new_coord);
1075h2->Modify(2, box1[3] + 1);
1080 if(nullified > 0) {
1081hitrefs.erase(
remove_if(hitrefs.begin(), hitrefs.end(),
1087 #define ALGO_ALIGN_COMPARTMENT_FINDER_USE_FULL_XFILTERING 1088 #ifdef ALGO_ALIGN_COMPARTMENT_FINDER_USE_FULL_XFILTERING 1090 typenameTHitRefs::iterator ihr_b (m_hitrefs.begin()),
1091ihr_e(m_hitrefs.end()), ihr (ihr_b);
1093stable_sort(ihr_b, ihr_e, THitComparator(THitComparator::eSubjMinSubjMax));
1096 for(
inticn (
static_cast<int>(m_compartments.size())), ic (icn - 1); ic >= 0; --ic) {
1101 if(hitrefs.size() < 3) {
1106(*ii)->SetScore(- (*ii)->GetScore());
1108hitrefs.front()->SetEValue(-1);
1109hitrefs.back()->SetEValue(-1);
1112 const TCoordcomp_subj_min (hitrefs.back()->GetSubjStart());
1113 const TCoordcomp_subj_max (hitrefs.front()->GetSubjStop());
1114 while(ihr != ihr_e && ((*ihr)->GetSubjStart() < comp_subj_min
1115|| (*ihr)->GetScore() < 0))
1120 if(ihr == ihr_e)
break;
1121 if((*ihr)->GetSubjStart() > comp_subj_max)
continue;
1122 typenameTHitRefs::iterator ihrc_b (ihr);
1124 typenameTHitRefs::iterator ihrc_e (ihr);
1125 while(ihrc_e != ihr_e && ((*ihrc_e)->GetSubjStart() < comp_subj_max
1126|| (*ihrc_e)->GetScore() < 0))
1131 size_tnullified (sx_XFilter(hitrefs, ihrc_b, ihrc_e, 1,
1132kMinCompartmentHitLength));
1133stable_sort(ihrc_b, ihrc_e, THitComparator (THitComparator::eQueryMinQueryMax));
1135nullified += sx_XFilter(hitrefs, ihrc_b, ihrc_e, 0,
1136kMinCompartmentHitLength);
1140 if(nullified > 0) {
1141hitrefs.erase(
remove_if(hitrefs.begin(), hitrefs.end(),
1147 for(
inticn (
static_cast<int>(m_compartments.size())), ic (icn - 1); ic >= 0; --ic) {
1152 const doublescore ((*ii)->GetScore());
1154(*ii)->SetScore(-score);
1156 const doubleeval ((*ii)->GetEValue());
1158(*ii)->SetEValue(0);
1166 for(
size_t i(0),
in(m_compartments.size());
i<
in; ++
i) {
1167 if(comp_status[
i] ==
false) {
1169 THitRefs& hitrefs (m_compartments[
i].SetMembers());
1172hr->SetScore(-hr->GetScore());
1177 returnm_compartments.size();
1181 template<
classTHit>
1184 typenameTHitRefs::iterator ihr,
1185 typenameTHitRefs::iterator ihr_e,
1187 size_tmin_compartment_hit_len)
1189 size_tnullified (0);
1190 for(
int in(
static_cast<int>(hitrefs.size())),
i(
in- 2);
i> 0 && ihr != ihr_e; --
i) {
1193 if(h1.
IsNull())
continue;
1195 const TCoord* box1o (h1->GetBox());
1196 TCoordbox1 [4] = {box1o[0], box1o[1], box1o[2], box1o[3]};
1199 for(; ihr != ihr_e; ++ihr) {
1202 if(hr.
IsNull())
continue;
1203 if(hr->GetScore() > 0 && hr->GetStop(w) >= box1[2*w]) {
1213 TCoordls0 (box1[2*w+1] + 1), cursegmax (0);
1214 TCoordsegmax_start(box1[2*w]), segmax_stop(box1[2*w+1]);
1216 if(box1[2*w] < (*ihr)->GetStart(w)) {
1218segmax_start = ls0 = box1[2*w];
1219segmax_stop = (*ihr)->GetStart(w) - 1;
1220cursegmax = segmax_stop - segmax_start + 1;
1224 TCoordshrsmax ((*ihr)->GetStop(w));
1225 for(++ihr; ihr != ihr_e; ++ihr) {
1228 if(hr.
IsNull() || hr->GetScore() < 0) {
1232 const TCoordhrs0 (hr->GetStart(w));
1233 if(hrs0 > box1[2*w+1]) {
1234segmax_stop = box1[2*w+1];
1238 if(hrs0 > shrsmax) {
1239segmax_stop = hrs0 - 1;
1243 const TCoordhrs1 (hr->GetStop(w));
1244 if(hrs1 > shrsmax) {
1249 if(shrsmax < box1[2*w+1]) {
1250segmax_start = ls0 = shrsmax + 1;
1251cursegmax = segmax_stop - segmax_start + 1;
1255 if(ls0 > box1[2*w+1]) {
1262 for(; ihr != ihr_e; ++ihr) {
1265 if(hr.
IsNull() || hr->GetScore() < 0) {
1269 const TCoordhrs0 (hr->GetStart(w));
1270 if(hrs0 > box1[2*w+1]) {
1271 if(ls0 <= box1[2*w+1] && box1[2*w+1] + 1 - ls0 > cursegmax) {
1273segmax_stop = box1[2*w+1];
1274cursegmax = segmax_stop - segmax_start + 1;
1280 if(hrs0 - ls0 > cursegmax) {
1282segmax_stop = hrs0 - 1;
1283cursegmax = segmax_stop - segmax_start + 1;
1286ls0 = hr->GetStop(w) + 1;
1288 else if(hr->GetStop(w) + 1 > ls0) {
1289ls0 = hr->GetStop(w) + 1;
1293 if(box1[2*w+1] > ls0 + cursegmax) {
1295segmax_stop = box1[2*w+1];
1296cursegmax = segmax_stop - segmax_start + 1;
1299 if(cursegmax < min_compartment_hit_len) {
1306 if(box1[2*w] < segmax_start) {
1307h1->Modify(2 * w, segmax_start);
1310 if(segmax_stop < box1[2*w+1]) {
1311h1->Modify(2 * w + 1, segmax_stop);
1315 if(ihr == ihr_e)
break;
1322 template<
classTHit>
1326 if(m_compartments.size()) {
1328 return&m_compartments[m_iter++];
1336 template<
classTHit>
1339 for(
size_t i= 0, dim = m_compartments.size();
i< dim; ++
i) {
1340m_compartments[
i].UpdateMinMax();
1343stable_sort(m_compartments.begin(), m_compartments.end(),
1347 template<
classTHit>
1351 const size_tdim = m_compartments.size();
1352 if(m_iter == -1 || m_iter >=
int(dim)) {
1357 return&m_compartments[m_iter++];
1362 template<
classTHit>
1365 TCoordmin_singleton_matches,
1368x_Init(comp_penalty, min_matches, min_singleton_matches, cross_filter);
1372 template<
classTHit>
1374 typenameTHitRefs::iterator istart,
1375 typenameTHitRefs::iterator ifinish,
1378 TCoordmin_singleton_matches,
1381 constvector<pair<TCoord, TCoord> > *gaps)
1383x_Init(comp_penalty, min_matches, min_singleton_matches, cross_filter);
1384 Run(istart, ifinish, scope, gaps);
1388 template<
classTHit>
1391 TCoordmin_singleton_matches,
1394m_Penalty = comp_penalty;
1395m_MinMatches = min_matches;
1396m_MinSingletonMatches = min_singleton_matches;
1397m_CrossFiltering = cross_filter;
1403 template<
classTHit>
1405 typenameTHitRefs::iterator ifinish,
1407 constvector<pair<TCoord, TCoord> > *gaps)
1410 if(istart == ifinish)
return;
1415 typenameTHitRefs::iterator ib = istart, ie = ifinish, ii = ib,
1418THitComparator sorter (THitComparator::eSubjStrand);
1419stable_sort(ib, ie, sorter);
1421 TCoordminus_subj_min = kMax_TCoord, minus_subj_max = 0;
1422 for(ii = ib; ii != ie; ++ii) {
1423 if((*ii)->GetSubjStrand()) {
1428 if((*ii)->GetSubjMin() < minus_subj_min) {
1429minus_subj_min = (*ii)->GetSubjMin();
1431 if((*ii)->GetSubjMax() > minus_subj_max) {
1432minus_subj_max = (*ii)->GetSubjMax();
1443gapi.
Flip(minus_subj_min, minus_subj_max);
1444prec_gapi.
Flip(minus_subj_min, minus_subj_max);
1445 for(ii = ib; ii != iplus_beg; ++ii) {
1447 const typename THit::TCoords0 = minus_subj_min + minus_subj_max
1448- (*ii)->GetSubjMax();
1449 const typename THit::TCoords1 = minus_subj_min + minus_subj_max
1450- (*ii)->GetSubjMin();
1451(*ii)->SetSubjStart(s0);
1452(*ii)->SetSubjStop(s1);
1461finder.
Run(m_CrossFiltering);
1464 for(ii = ib; ii != iplus_beg; ++ii) {
1466 const typename THit::TCoords0 = minus_subj_min + minus_subj_max
1467- (*ii)->GetSubjMax();
1468 const typename THit::TCoords1 = minus_subj_min + minus_subj_max
1469- (*ii)->GetSubjMin();
1470(*ii)->SetSubjStart(s1);
1471(*ii)->SetSubjStop(s0);
1474x_Copy2Pending(finder);
1487finder.
Run(m_CrossFiltering);
1488x_Copy2Pending(finder);
1493 template<
classTHit>
1505 if(compartment->GetMembers().size() > 0) {
1507m_pending.push_back(
THitRefs(0));
1510 for(
THitRefph (compartment->GetFirst()); ph; ph = compartment->GetNext())
1515 const TCoord* box = compartment->GetBox();
1516m_ranges.push_back(box[0]);
1517m_ranges.push_back(box[1]);
1518m_ranges.push_back(box[2]);
1519m_ranges.push_back(box[3]);
1521m_strands.push_back(compartment->GetStrand());
1522m_status.push_back(compartment->GetFirst()->GetScore() > 0);
1528 template<
classTHit>
1532 returnGetNext(compartment);
1536 template<
classTHit>
1539compartment.clear();
1540 if(m_iter < m_pending.size()) {
1541compartment = m_pending[m_iter++];
1550 template<
classTHit>
1559 if(m_pending.size()) {
1560 if(m_pending.front().size()) {
1561 const THit& h (*m_pending.front().front());
1569 for(
size_t i(0), idim(m_pending.size());
i< idim; ++
i) {
1571 if(m_status[
i]) {
1574 TCoordrange_min (
i> 0 && m_strands[
i-1] == m_strands[
i]
1575? m_ranges[4*
i- 1]
1578 TCoordrange_max (
i+ 1 < idim && m_strands[
i+1] == m_strands[
i]
1579? m_ranges[4*
i+ 6]
1591range_max, subj_strand));
1592 bounds.push_back(seq_loc);
1598 const THit& h (**ii);
1602 if(transcript.empty()) {
1604sa3->
SetSegs().SetStd().push_back(sg);
1610sg->SetLoc().push_back(query_loc);
1611sg->SetLoc().push_back(subj_loc);
1617ds.
SetIds().push_back(seqid_query);
1618ds.
SetIds().push_back(seqid_subj);
1620sas2_data.push_back(sa3);
1624sas1_data.push_back(sa2);
User-defined methods of the data storage class.
void remove_if(Container &c, Predicate *__pred)
TCoord GetQueryStart(void) const
const TId & GetSubjId(void) const
TCoord GetQueryMin(void) const
TCoord GetSubjStart(void) const
const TId & GetQueryId(void) const
TCoord GetSubjMin(void) const
TCoord GetQueryMax(void) const
TCoord GetSubjMax(void) const
const TTranscript & GetTranscript(void) const
void Run(typename THitRefs::iterator start, typename THitRefs::iterator finish, CScope *scope=NULL, const vector< pair< TCoord, TCoord > > *gaps=NULL)
Execute: identify compartments.
bool GetStrand(size_t i) const
void SetMaxIntron(TCoord mi)
Assign the maximum intron length, in base pairs.
bool GetFirst(THitRefs &compartment)
Initialize iteration over the results.
CRef< objects::CSeq_align_set > AsSeqAlignSet(void) const
Retrieve all valid compartments in a seq-align-set.
TCoord m_MinSingletonMatches
void x_Init(TCoord comp_penalty, TCoord min_matches, TCoord min_singleton_matches, bool cross_filter)
void Get(size_t idx, THitRefs &compartment) const
Retrieve a compartment by index.
const TCoord * GetBox(size_t i) const
TCompartmentFinder::THitRefs THitRefs
CCompartmentAccessor(TCoord comp_penalty_bps, TCoord min_matches, TCoord min_singleton_matches=numeric_limits< TCoord >::max(), bool cross_filter=false)
Construct the object and assign the parameters of the algorithm.
TCompartmentFinder::TCoord TCoord
void SetMaxOverlap(TCoord max_overlap)
Assign the maximum length for compartments to overlap on the subject.
vector< TCoord > m_ranges
vector< THitRefs > m_pending
bool GetNext(THitRefs &compartment)
Proceed with iteration over the results.
bool GetStatus(size_t i) const
TCoord GetMaxIntron(void) const
Retrieve the maximum intron length, in base pairs.
pair< size_t, size_t > GetCounts(void) const
Retrieve the compartment counts.
CCompartmentFinder< THit > TCompartmentFinder
void x_Copy2Pending(TCompartmentFinder &finder)
Individual compartment representation.
const THitRef GetNext(void) const
Retrieve the next member.
void AddMember(const THitRef &hitref)
Add a new member into the compartment.
const TCoord * GetBox(void) const
Retrieve the compartment's box.
const THitRefs & GetMembers(void)
Retrieve compartment's members.
static bool s_PLowerSubj(const CCompartment &c1, const CCompartment &c2)
bool GetStrand(void) const
Retrieve the compartment's strand (true == plus)
void UpdateMinMax(void)
Make sure the compartment's box is up-to-date.
CCompartment(void)
Create an empty compartment.
THitRefs & SetMembers(void)
Assign all members of the compartment.
const THitRef GetFirst(void) const
Retrieve the first member.
void SetMaxIntron(TCoord intr_max)
Set the maximum length of an intron.
static TCoord s_GetDefaultMaxOverlap(void)
Retrieve the default compartment overlap behaviour (no overlap).
static TCoord s_GetDefaultMinCoverage(void)
Retrieve the default minimum coverage, in base pairs.
void SetMinMatches(TCoord min_matches)
Set the minimum matching residues per compartment.
void SetPenalty(TCoord penalty)
Set the penalty to open a compartment.
vector< CCompartment > m_compartments
static TCoord s_GetDefaultPenalty(void)
Retrieve the default compartment penalty, in base pairs.
size_t Run(bool cross_filter=false)
Identify compartments.
vector< THitRef > THitRefs
CCompartment * GetNext(void)
TCoord m_MinSingletonMatches
CPrecalcGapInfo< THit > * m_prec_gap_info
static TCoord s_GetDefaultMaxIntron(void)
Retrieve the default maximum length of an intron.
void SetMinSingletonMatches(TCoord min_matches)
Set the minimum matching residues per singleton compartment.
CCompartmentFinder(typename THitRefs::const_iterator start, typename THitRefs::const_iterator finish, CGapInfo< THit > *gap_info=NULL, CPrecalcGapInfo< THit > *prec_gap_info=NULL)
Create the object from the complete set of local alignments (hits) between the transcript and the gen...
static bool s_PNullRef(const THitRef &hr)
CGapInfo< THit > * m_gap_info
void OrderCompartments(void)
Order compartments by lower subj coordinate.
void SetMaxOverlap(TCoord max_overlap)
Set compartment overlap behaviour.
static size_t sx_XFilter(THitRefs &hitrefs, typename THitRefs::iterator ihr, typename THitRefs::iterator ihr_e, Uint1 w, size_t min_compartment_hit_len)
CCompartment * GetFirst(void)
void FromTranscript(TSeqPos query_start, ENa_strand query_strand, TSeqPos subj_start, ENa_strand subj_strand, const string &transcript)
Initialize from pairwise alignment transcript (a string representation produced by CNWAligner)
void Flip(TCoord subj_min, TCoord subj_max)
CGapInfo(const CSeq_id &id, CScope *scope)
CConstRef< CSeqMap > m_seq_map
bool IntersectsNonBridgeableGap(TCoord from, TCoord to)
CPrecalcGapInfo(const vector< pair< TCoord, TCoord > > *gaps)
const vector< pair< TCoord, TCoord > > * m_gaps
bool IntersectsNonBridgeableGap(TCoord from, TCoord to)
void Flip(TCoord subj_min, TCoord subj_max)
CQueryMatchAccumulator(void)
double operator()(double acm, CRef< THit > ph)
const double kPenaltyPerIntronPos
double GetTotalMatches(const typename CCompartmentFinder< THit >::THitRefs &hitrefs0)
const double kPenaltyPerIntronBase
IMPLEMENTATION.
CSplign::THitRefs THitRefs
static const char * bounds[]
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
const CSeqMap & GetSeqMap(void) const
Get sequence map.
CConstRef< CSeq_literal > GetRefGapLiteral(void) const
return CSeq_literal with gap data, or null if either the segment is not a gap, or an unspecified gap
CSeqMap_CI ResolvedRangeIterator(CScope *scope, TSeqPos from, TSeqPos length, ENa_strand strand=eNa_strand_plus, size_t maxResolve=size_t(-1), TFlags flags=fDefaultFlags) const
Iterate segments in the range with specified strand coordinates.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
uint8_t Uint1
1-byte (8-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void Run(void)
Enter the main loop.
Tdata & Set(void)
Assign a value to data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
void SetType(TType value)
Assign a value to Type data member.
list< CRef< CSeq_loc > > TBounds
list< CRef< CSeq_align > > Tdata
TIds & SetIds(void)
Assign a value to Ids data member.
TBounds & SetBounds(void)
Assign a value to Bounds data member.
@ eType_disc
discontinuous alignment
ENa_strand
strand of nucleic acid
unsigned int
A callback function used to compare two keys in a database.
std::istream & in(std::istream &in_, double &x_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
SHitStatus(EType type, int prev, double score)
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