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/merge__tree__app_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/align/mergetree/app/merge_tree_app.cpp Source File

65 #define MARKLINE cerr << __LINE__ << endl; 98

cerr <<

"s_TimerCallback "

<< Diff.

GetAsDouble

() << endl;

119  virtual void

*

Main

(

void

);

125

list< CRef<CSeq_align> > MergedAligns;

127

cerr <<

"Merge Thread Starting : "

<<

TId

<< endl;

145

}

catch

(

CException

& e) { cerr <<__LINE__<<

"Thread Queue Exception: "

<< e.

ReportAll

() << endl;

break

; }

147

list< CRef<CSeq_align> > In,

Out

;

148

In.insert(In.end(), InAligns.begin(), InAligns.end());

152

cerr <<

"T: "

<<

TId

<<

" : " 155

<<

" : "

<< In.size() <<

" aligns"

<< endl;

164

OutAligns.push_back(*OutIter);

169

cerr <<

"Merge Thread Finished : "

<<

TId

<< endl;

183  virtual void

*

Main

(

void

);

191  size_t

GroupCount = 0, AlignCount=0;

198

}

catch

(

CException

& e) { cerr <<

"Thread Output Queue Timeout, repeat."

<< endl;

continue

; }

209

cerr <<

"Output Thread Finished, Wrote "

<<GroupCount<<

" sets for "

<< AlignCount<<

" alignments"

<<endl;

216  virtual void Init

(

void

);

234

argList->AddDefaultKey(

"threads"

,

"integer"

,

"thread count. core logic is sequential, but seperate seq-id-pairs can thread."

,

CArgDescriptions::eInteger

,

"1"

);

260

list<CRef<CSeq_align> > OrigAligns;

265

}

catch

(...) {

break

; }

266

OrigAligns.push_back(Align);

268  if

(OrigAligns.empty()) {

276

}

catch

(...) {

break

; }

277

OrigAligns.push_back(Align);

280  if

(OrigAligns.empty()) {

288

}

catch

(...) {

break

; }

289

OrigAligns.insert(OrigAligns.end(), AlignSet->

Get

().begin(), AlignSet->

Get

().end());

388

cerr <<

"OrigAligns.size: "

<< OrigAligns.size() << endl;

389  if

(OrigAligns.empty()) {

390

cerr <<

"No alignments read in."

<< endl;

411

list< CRef<CSeq_align> > MergedAligns;

413  int

ThreadCount = args[

"threads"

].AsInteger();

414  double

Timer = args[

"timer"

].AsDouble();

415  int

Ratio = args[

"ratio"

].AsInteger();

418

Scoring.

Match

= Ratio;

425  if

(ThreadCount > 0) {

426  typedef

pair<objects::CSeq_id_Handle, objects::ENa_strand> TSeqIdPair;

427  typedef

pair<TSeqIdPair, TSeqIdPair> TMapKey;

428  typedef

vector<CRef<objects::CSeq_align> >

TAlignVec

;

430  typedef

pair<TMapKey, TAlignVec> TAlignGroupPair;

431

TAlignGroupMap AlignGroupMap;

439

AlignGroupMap[Key].push_back(*AlignIter);

441

cerr <<

"Thread Queue Length: "

<< AlignGroupMap.size() << endl;

444  ITERATE

(TAlignGroupMap, AlignGroupIter, AlignGroupMap) {

445

ThreadQueue.

Push

(AlignGroupIter->second);

449

list< CMergeTreeThread* > Threads;

450  for

(

int i

= 0;

i

< ThreadCount;

i

++) {

461

Threads.push_back(New);

466

FileOutThread->

InQueue

= &ThreadResults;

470  ITERATE

(list< CMergeTreeThread* >, ThreadIter, Threads) {

471

(*ThreadIter)->Run();

473

FileOutThread->

Run

();

474

cerr<<

"Threads Launched, Joining"

<< endl;

475  ITERATE

(list< CMergeTreeThread* >, ThreadIter, Threads) {

476

(*ThreadIter)->Join();

479

FileOutThread->

Join

();

480

cerr<<

"Threads Joined, Exiting."

<< endl;

490  else if

(ThreadCount == 0) {

500

TreeMerger.

Merge

(OrigAligns, MergedAligns);

502

cerr <<

"MergedAligns.size: "

<< MergedAligns.size() << endl;

518 main

(

int

argc,

const char

* argv[])

static void AddArgumentDescriptions(CArgDescriptions &arg_desc, TLoaders loaders=fDefault)

Add a standard set of arguments used to configure the object manager.

static CRef< objects::CScope > GetDefaultScope(const CArgs &args)

virtual void * Main(void)

Derived (user-created) class must provide a real thread function.

CMergeTree::SScoring Scoring

virtual void * Main(void)

Derived (user-created) class must provide a real thread function.

virtual int Run()

Run the application.

virtual void Init(void)

Initialize the application.

const CSeq_id & GetSeq_id(TDim row) const

Get seq-id (the first one if segments have different ids).

ENa_strand GetSeqStrand(TDim row) const

Get strand (the first one if segments have different strands).

Convenience trait implementation which tells that the queue can be used from many threads.

Thread-safe queue object with a blocking mechanism.

void Push(const TValue &elem, const CTimeSpan *timeout=NULL)

Add new element to the end of queue.

bool IsEmpty(void) const

Check if the queue is empty.

TValue Pop(const CTimeSpan *timeout=NULL)

Retrieve an element from the queue.

void Merge(const list< CRef< objects::CSeq_align > > &Input, list< CRef< objects::CSeq_align > > &Output)

void SetScope(objects::CScope *Scope)

void SetScoring(CMergeTree::SScoring Scoring)

CMergeTree::TInterruptFnPtr SetInterruptCallback(CMergeTree::TInterruptFnPtr callback, void *callback_data)

Include a standard set of the NCBI C++ Toolkit most basic headers.

The NCBI C++ standard methods for dealing with std::string.

virtual const CArgs & GetArgs(void) const

Get parsed command line arguments.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

@ eInputFile

Name of file (must exist and be readable)

@ eDouble

Convertible into a floating point number (double)

@ eOutputFile

Name of file (must be writable)

@ eInteger

Convertible into an integer number (int or Int8)

@ eDS_Default

Try standard log file (app.name + ".log") in /log/, use stderr on failure.

string ReportAll(TDiagPostFlags flags=eDPF_Exception) const

Report all exceptions.

#define MSerial_AsnBinary

#define MSerial_AsnText

I/O stream manipulators –.

const string AsFastaString(void) const

static CSeq_id_Handle GetHandle(const CSeq_id &id)

Normal way of getting a handle, works for any seq-id.

static CRef< CObjectManager > GetInstance(void)

Return the existing object manager or create one.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

bool Run(TRunMode flags=fRunDefault)

Run the thread.

void Join(void **exit_data=0)

Wait for the thread termination.

double GetAsDouble(void) const

Return time span as number of seconds.

@ eCurrent

Use current time. See also CCurrentTime.

void CORE_SetLOCK(MT_LOCK lk)

Set the MT critical section lock/unlock handler – to be used by the core internals for protection of ...

MT_LOCK MT_LOCK_cxx2c(CRWLock *lock=0, bool pass_ownership=false)

Convert a C++ Toolkit lock object to an MT_LOCK lock.

const Tdata & Get(void) const

Get the member data.

ENa_strand

strand of nucleic acid

@ eNa_strand_both

in forward orientation

bool s_TimerCallback(void *Data)

CSyncQueue< TAlignVec, deque< TAlignVec >, CSyncQueue_Traits_ConcurrencyOn > TSyncQueue

string s_Strand(ENa_strand strand)

vector< CRef< objects::CSeq_align > > TAlignVec

int main(int argc, const char *argv[])

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Defines NCBI C++ diagnostic APIs, classes, and macros.

Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.

Multi-threading – classes, functions, and features.

Useful/utility classes and methods.

void Out(T t, int w, CNcbiOstream &to=cout)

Definition of synchronized queue (CSyncQueue template) and templates related to it.


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