A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/compartment__finder_8hpp_source.html below:

NCBI C++ ToolKit: include/algo/align/util/compartment_finder.hpp Source File

1 #ifndef ALGO_ALIGN_UTIL_COMPARTMENT_FINDER__HPP 2 #define ALGO_ALIGN_UTIL_COMPARTMENT_FINDER__HPP 70 template

<

class

THit>

119 template

<

class

THit>

145  for

(

size_t i

= 0;

i

<

m_gaps

->size(); ++

i

) {

146  TCoord

gfrom = (*m_gaps)[

i

].first;

147  TCoord

gto = (*m_gaps)[

i

].second;

148  if

( gfrom < to && from < gto ) {

160  const

vector<pair<TCoord, TCoord> > *

m_gaps

;

164 template

<

class

THit>

184  typename

THitRefs::const_iterator finish,

268  size_t Run

(

bool

cross_filter =

false

);

403  typename

THitRefs::iterator ihr,

404  typename

THitRefs::iterator ihr_e,

406  size_t

min_compartment_hit_len);

417 template

<

class

THit>

440  bool

cross_filter =

false

);

461  typename

THitRefs::iterator finish,

465  bool

cross_filter =

false

,

CScope

*scope =

NULL

,

466  const

vector<pair<TCoord, TCoord> > *gaps =

NULL

);

476  void Run

(

typename

THitRefs::iterator start,

477  typename

THitRefs::iterator finish,

CScope

*scope =

NULL

,

478  const

vector<pair<TCoord, TCoord> > *gaps =

NULL

);

522  size_t

valid_count (0);

527

pair<size_t, size_t> rv (

m_pending

.size(), valid_count);

567  TCoord

min_singleton_matches,

bool

cross_filter);

599 template

<

class

THit>

607 template

<

class

THit>

610  if

(m_members.size()) {

611  return

m_members.front()->GetSubjStrand();

616  "Strand requested on an empty compartment"

);

621 template

<

class

THit>

623  typename

THitRefs::const_iterator start,

624  typename

THitRefs::const_iterator finish,

642 template

<

class

THit>

653

qmax (ph->GetQueryMax());

655  return

acm + ph->GetIdentity() * ((

m_Finish

= qmax) - qmin + 1);

659  return

acm + ph->GetIdentity() * ((

m_Finish

= qmax) - finish0);

673 template

<

class

THit>

680

THitComparator sorter (THitComparator::eQueryMin);

681

stable_sort(hitrefs.begin(), hitrefs.end(), sorter);

683  const double

rv (accumulate(hitrefs.begin(), hitrefs.end(), 0.0,

689 template

<

class

THit>

692  const double

kMinusInf (-1e12);

694

m_compartments.clear();

695  const size_t

dimhits = m_hitrefs.size();

705

stable_sort(m_hitrefs.begin(), m_hitrefs.end(),

706

THitComparator(THitComparator::eSubjMaxQueryMax));

714  typedef

vector<SHitStatus> THitData;

715

THitData hitstatus (dimhits);

717  const TCoord

subj_min_global (m_hitrefs.front()->GetSubjMin());

720  for

(

int i

(0); i < static_cast<int>(dimhits); ++

i

) {

723  const double

identity (h->GetIdentity());

725

h->GetQueryMin(), h->GetQueryMax(),

726

h->GetSubjMin(), h->GetSubjMax()

731

cerr << endl << *h << endl;

734  double

best_ext_score (kMinusInf);

737  double

best_open_score (identity*(hbox[1] - hbox[0] + 1) - m_penalty);

738  int

i_best_open (-1);

740  if

(hbox[2] + m_max_overlap > m_hitrefs[i_bestsofar]->GetSubjMax()) {

742  const double

score_open (identity*(hbox[1] - hbox[0] + 1)

743

+ hitstatus[i_bestsofar].m_score

746  if

(score_open > best_open_score) {

747

best_open_score = score_open;

748

i_best_open = i_bestsofar;

753  for

(

int

j (

i

- 1); j >= 0; --j) {

755  const double

score_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())

762

best_open_score = score_open;

768  for

(

int

j =

i

; j >= 0; --j) {

775

phcbox[0] = phc->GetQueryMin();

776

phcbox[1] = phc->GetQueryMax();

777

phcbox[2] = phc->GetSubjMin();

778

phcbox[3] = phc->GetSubjMax();

781

cerr <<

'\t'

<< *phc << endl;

786

cerr <<

"\t[Dummy]"

<< endl;

799  if

( ( phcbox[1] < hbox[1] && phcbox[0] < hbox[0] )

800

&& phcbox[2] <= hbox[2]

803  if

(hbox[0] <= phcbox[1] &&

804

hbox[2] + phcbox[1] - hbox[0] >= phcbox[3]) {

807

s0 = hbox[2] + phcbox[1] - hbox[0];

809  else if

(phcbox[3] >= hbox[2]) {

812

q0 = hbox[1] - (hbox[3] - s0);

819

subj_space = s0 - phcbox[3] - 1;

826

good = (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]) ) ) {

840

intron_start = phcbox[3];

847  const double

jscore (hitstatus[j].m_score);

848  const double

intron_penalty ((subj_space > 0)?

852  const double

ext_score (jscore +

853

identity * (hbox[1] - q0 + 1) + intron_penalty);

855  if

(ext_score > best_ext_score) {

856

best_ext_score = ext_score;

860

cerr <<

"\tGood for extension with score = "

<< ext_score << endl;

869  if

(best_ext_score > best_open_score) {

871

hit_type = SHitStatus::eExtension;

872

prev_hit = i_best_ext;

873

best_score = best_ext_score;

877

hit_type = SHitStatus::eOpening;

878

prev_hit = i_best_open;

879

best_score = best_open_score;

882

hitstatus[

i

].m_type = hit_type;

883

hitstatus[

i

].m_prev = prev_hit;

884

hitstatus[

i

].m_score = best_score;

886  if

(best_score > hitstatus[i_bestsofar].m_score) {

891

cerr <<

"Status = "

<< ((hit_type == SHitStatus::eOpening)?

"Open"

:

"Extend"

)

892

<<

'\t'

<< best_score << endl;

893  if

(prev_hit == -1) {

894

cerr <<

"[Dummy]"

<< endl;

897

cerr << *(m_hitrefs[prev_hit]) << endl;

903

cerr <<

"\n\n--- BACKTRACE ---\n"

;

908  const double

score_best (hitstatus[i_bestsofar].m_score);

909  const double

min_matches (m_MinSingletonMatches < m_MinMatches?

910

m_MinSingletonMatches: m_MinMatches);

912

vector<bool> comp_status;

913  if

(score_best + m_penalty >= min_matches) {

916  bool

new_compartment (

true

);

920  if

(new_compartment) {

922  const double

mp (GetTotalMatches<THit>(hitrefs));

926

m_compartments.back().SetMembers() = hitrefs;

927

comp_status.push_back(mp >= m_MinMatches);

931

new_compartment =

false

;

933

hitrefs.push_back(m_hitrefs[

i

]);

936

cerr << *(m_hitrefs[

i

]) << endl;

939  if

(hitstatus[

i

].m_type == SHitStatus::eOpening) {

940

new_compartment =

true

;

942  i

= hitstatus[

i

].m_prev;

945  const double

mp (GetTotalMatches<THit>(hitrefs));

947  bool

status ( ( m_compartments.size() == 0 && mp >= m_MinSingletonMatches )

948

|| mp >= m_MinMatches );

950

m_compartments.back().SetMembers() = hitrefs;

951

comp_status.push_back(status);

955  if

(cross_filter && m_compartments.size()) {

957  const TCoord

kMinCompartmentHitLength (8);

960  for

(

size_t

icn (m_compartments.size()), ic (0); ic < icn; ++ic) {

964  size_t

nullified (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  TCoord

box1 [4] = {box1o[0], box1o[1], box1o[2], box1o[3]};

978  const TCoord

* box2o (h2->GetBox());

979  TCoord

box2 [4] = {box2o[0], box2o[1], box2o[2], box2o[3]};

981  const int

qd (box1[1] - box2[0] + 1);

982  const int

sd (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  TCoord

new_coord (box1[0] + (box1[1] - box1[0])/2);

990  if

(box1[0] + 1 <= new_coord) {

996

h1->Modify(1, new_coord);

1006

h1->Modify(1, box2[0] - 1);

1009  if

(box2[1] <= box1[1] + kMinCompartmentHitLength) {

1011 #ifdef ALGOALIGNUTIL_COMPARTMENT_FINDER_KEEP_TERMINII 1013  TCoord

new_coord (box2[0] + (box2[1] - box2[0])/2);

1014  if

(box2[1] >= new_coord + 1) {

1018

new_coord = box2[1];

1020

h2->Modify(0, new_coord);

1030

h2->Modify(0, box1[1] + 1);

1035  if

(box2[2] <= box1[2] + kMinCompartmentHitLength) {

1037  if

(

i

+ 1 ==

in

) {

1038  TCoord

new_coord (box1[2] + (box1[3] - box1[2])/2);

1039  if

(box1[2] + 1 <= new_coord) {

1043

new_coord = box1[2];

1045

h1->Modify(3, new_coord);

1053

h1->Modify(3, box2[2] - 1);

1056  if

(box2[3] <= box1[3] + kMinCompartmentHitLength) {

1059  TCoord

new_coord (box2[2] + (box2[3] - box2[2])/2);

1060  if

(box2[3] >= new_coord + 1) {

1064

new_coord = box2[3];

1067

h2->Modify(2, new_coord);

1075

h2->Modify(2, box1[3] + 1);

1080  if

(nullified > 0) {

1081

hitrefs.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  typename

THitRefs::iterator ihr_b (m_hitrefs.begin()),

1091

ihr_e(m_hitrefs.end()), ihr (ihr_b);

1093

stable_sort(ihr_b, ihr_e, THitComparator(THitComparator::eSubjMinSubjMax));

1096  for

(

int

icn (

static_cast<int>

(m_compartments.size())), ic (icn - 1); ic >= 0; --ic) {

1101  if

(hitrefs.size() < 3) {

1106

(*ii)->SetScore(- (*ii)->GetScore());

1108

hitrefs.front()->SetEValue(-1);

1109

hitrefs.back()->SetEValue(-1);

1112  const TCoord

comp_subj_min (hitrefs.back()->GetSubjStart());

1113  const TCoord

comp_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  typename

THitRefs::iterator ihrc_b (ihr);

1124  typename

THitRefs::iterator ihrc_e (ihr);

1125  while

(ihrc_e != ihr_e && ((*ihrc_e)->GetSubjStart() < comp_subj_max

1126

|| (*ihrc_e)->GetScore() < 0))

1131  size_t

nullified (sx_XFilter(hitrefs, ihrc_b, ihrc_e, 1,

1132

kMinCompartmentHitLength));

1133

stable_sort(ihrc_b, ihrc_e, THitComparator (THitComparator::eQueryMinQueryMax));

1135

nullified += sx_XFilter(hitrefs, ihrc_b, ihrc_e, 0,

1136

kMinCompartmentHitLength);

1140  if

(nullified > 0) {

1141

hitrefs.erase(

remove_if

(hitrefs.begin(), hitrefs.end(),

1147  for

(

int

icn (

static_cast<int>

(m_compartments.size())), ic (icn - 1); ic >= 0; --ic) {

1152  const double

score ((*ii)->GetScore());

1154

(*ii)->SetScore(-score);

1156  const double

eval ((*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());

1172

hr->SetScore(-hr->GetScore());

1177  return

m_compartments.size();

1181 template

<

class

THit>

1184  typename

THitRefs::iterator ihr,

1185  typename

THitRefs::iterator ihr_e,

1187  size_t

min_compartment_hit_len)

1189  size_t

nullified (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  TCoord

box1 [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  TCoord

ls0 (box1[2*w+1] + 1), cursegmax (0);

1214  TCoord

segmax_start(box1[2*w]), segmax_stop(box1[2*w+1]);

1216  if

(box1[2*w] < (*ihr)->GetStart(w)) {

1218

segmax_start = ls0 = box1[2*w];

1219

segmax_stop = (*ihr)->GetStart(w) - 1;

1220

cursegmax = segmax_stop - segmax_start + 1;

1224  TCoord

shrsmax ((*ihr)->GetStop(w));

1225  for

(++ihr; ihr != ihr_e; ++ihr) {

1228  if

(hr.

IsNull

() || hr->GetScore() < 0) {

1232  const TCoord

hrs0 (hr->GetStart(w));

1233  if

(hrs0 > box1[2*w+1]) {

1234

segmax_stop = box1[2*w+1];

1238  if

(hrs0 > shrsmax) {

1239

segmax_stop = hrs0 - 1;

1243  const TCoord

hrs1 (hr->GetStop(w));

1244  if

(hrs1 > shrsmax) {

1249  if

(shrsmax < box1[2*w+1]) {

1250

segmax_start = ls0 = shrsmax + 1;

1251

cursegmax = 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 TCoord

hrs0 (hr->GetStart(w));

1270  if

(hrs0 > box1[2*w+1]) {

1271  if

(ls0 <= box1[2*w+1] && box1[2*w+1] + 1 - ls0 > cursegmax) {

1273

segmax_stop = box1[2*w+1];

1274

cursegmax = segmax_stop - segmax_start + 1;

1280  if

(hrs0 - ls0 > cursegmax) {

1282

segmax_stop = hrs0 - 1;

1283

cursegmax = segmax_stop - segmax_start + 1;

1286

ls0 = hr->GetStop(w) + 1;

1288  else if

(hr->GetStop(w) + 1 > ls0) {

1289

ls0 = hr->GetStop(w) + 1;

1293  if

(box1[2*w+1] > ls0 + cursegmax) {

1295

segmax_stop = box1[2*w+1];

1296

cursegmax = segmax_stop - segmax_start + 1;

1299  if

(cursegmax < min_compartment_hit_len) {

1306  if

(box1[2*w] < segmax_start) {

1307

h1->Modify(2 * w, segmax_start);

1310  if

(segmax_stop < box1[2*w+1]) {

1311

h1->Modify(2 * w + 1, segmax_stop);

1315  if

(ihr == ihr_e)

break

;

1322 template

<

class

THit>

1326  if

(m_compartments.size()) {

1328  return

&m_compartments[m_iter++];

1336 template

<

class

THit>

1339  for

(

size_t i

= 0, dim = m_compartments.size();

i

< dim; ++

i

) {

1340

m_compartments[

i

].UpdateMinMax();

1343

stable_sort(m_compartments.begin(), m_compartments.end(),

1347 template

<

class

THit>

1351  const size_t

dim = m_compartments.size();

1352  if

(m_iter == -1 || m_iter >=

int

(dim)) {

1357  return

&m_compartments[m_iter++];

1362 template

<

class

THit>

1365  TCoord

min_singleton_matches,

1368

x_Init(comp_penalty, min_matches, min_singleton_matches, cross_filter);

1372 template

<

class

THit>

1374  typename

THitRefs::iterator istart,

1375  typename

THitRefs::iterator ifinish,

1378  TCoord

min_singleton_matches,

1381  const

vector<pair<TCoord, TCoord> > *gaps)

1383

x_Init(comp_penalty, min_matches, min_singleton_matches, cross_filter);

1384  Run

(istart, ifinish, scope, gaps);

1388 template

<

class

THit>

1391  TCoord

min_singleton_matches,

1394

m_Penalty = comp_penalty;

1395

m_MinMatches = min_matches;

1396

m_MinSingletonMatches = min_singleton_matches;

1397

m_CrossFiltering = cross_filter;

1403 template

<

class

THit>

1405  typename

THitRefs::iterator ifinish,

1407  const

vector<pair<TCoord, TCoord> > *gaps)

1410  if

(istart == ifinish)

return

;

1415  typename

THitRefs::iterator ib = istart, ie = ifinish, ii = ib,

1418

THitComparator sorter (THitComparator::eSubjStrand);

1419

stable_sort(ib, ie, sorter);

1421  TCoord

minus_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) {

1429

minus_subj_min = (*ii)->GetSubjMin();

1431  if

((*ii)->GetSubjMax() > minus_subj_max) {

1432

minus_subj_max = (*ii)->GetSubjMax();

1443

gapi.

Flip

(minus_subj_min, minus_subj_max);

1444

prec_gapi.

Flip

(minus_subj_min, minus_subj_max);

1445  for

(ii = ib; ii != iplus_beg; ++ii) {

1447  const typename THit::TCoord

s0 = minus_subj_min + minus_subj_max

1448

- (*ii)->GetSubjMax();

1449  const typename THit::TCoord

s1 = minus_subj_min + minus_subj_max

1450

- (*ii)->GetSubjMin();

1451

(*ii)->SetSubjStart(s0);

1452

(*ii)->SetSubjStop(s1);

1461

finder.

Run

(m_CrossFiltering);

1464  for

(ii = ib; ii != iplus_beg; ++ii) {

1466  const typename THit::TCoord

s0 = minus_subj_min + minus_subj_max

1467

- (*ii)->GetSubjMax();

1468  const typename THit::TCoord

s1 = minus_subj_min + minus_subj_max

1469

- (*ii)->GetSubjMin();

1470

(*ii)->SetSubjStart(s1);

1471

(*ii)->SetSubjStop(s0);

1474

x_Copy2Pending(finder);

1487

finder.

Run

(m_CrossFiltering);

1488

x_Copy2Pending(finder);

1493 template

<

class

THit>

1505  if

(compartment->GetMembers().size() > 0) {

1507

m_pending.push_back(

THitRefs

(0));

1510  for

(

THitRef

ph (compartment->GetFirst()); ph; ph = compartment->GetNext())

1515  const TCoord

* box = compartment->GetBox();

1516

m_ranges.push_back(box[0]);

1517

m_ranges.push_back(box[1]);

1518

m_ranges.push_back(box[2]);

1519

m_ranges.push_back(box[3]);

1521

m_strands.push_back(compartment->GetStrand());

1522

m_status.push_back(compartment->GetFirst()->GetScore() > 0);

1528 template

<

class

THit>

1532  return

GetNext(compartment);

1536 template

<

class

THit>

1539

compartment.clear();

1540  if

(m_iter < m_pending.size()) {

1541

compartment = m_pending[m_iter++];

1550 template

<

class

THit>

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  TCoord

range_min (

i

> 0 && m_strands[

i

-1] == m_strands[

i

]

1575

? m_ranges[4*

i

- 1]

1578  TCoord

range_max (

i

+ 1 < idim && m_strands[

i

+1] == m_strands[

i

]

1579

? m_ranges[4*

i

+ 6]

1591

range_max, subj_strand));

1592  bounds

.push_back(seq_loc);

1598  const THit

& h (**ii);

1602  if

(transcript.empty()) {

1604

sa3->

SetSegs

().SetStd().push_back(sg);

1610

sg->SetLoc().push_back(query_loc);

1611

sg->SetLoc().push_back(subj_loc);

1617

ds.

SetIds

().push_back(seqid_query);

1618

ds.

SetIds

().push_back(seqid_subj);

1620

sas2_data.push_back(sa3);

1624

sas1_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