本文整理汇总了C++中Trace::AutoDestroy方法的典型用法代码示例。如果您正苦于以下问题:C++ Trace::AutoDestroy方法的具体用法?C++ Trace::AutoDestroy怎么用?C++ Trace::AutoDestroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trace
的用法示例。
在下文中一共展示了Trace::AutoDestroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TraceDiffExecute
/**
Executes the trace difference algorithm optionally followed by the
mutation detection algorithm.
*/
mutlib_result_t TraceDiffExecute( tracediff_t* td, tracediff_algorithm_t a )
{
enum { STATE_INITIALISE, STATE_VALIDATE_INPUT, STATE_TRACE_ALIGN,
STATE_TRACE_DIFFERENCE, STATE_MUTATION_ANALYSIS, STATE_EXIT };
int n;
mutlib_strand_t Strand = MUTLIB_STRAND_FORWARD;
TraceDiffParameters Parameter;
Trace AlignedTrace[2];
int AlignedTraceClipL[2];
int AlignedTraceClipR[2];
List<MutTag> DiffTagList;
Trace* DiffTrace = 0;
bool Done = false;
int State = STATE_INITIALISE;
assert(td != NULL);
try
{
while(!Done)
{
switch(State)
{
case STATE_INITIALISE:
// Destroy old results
TraceDiffDestroyResults( td );
Strand = td->Alignment.Input.Strand;
State = STATE_VALIDATE_INPUT;
break;
case STATE_VALIDATE_INPUT:
// Check input values
State = STATE_EXIT;
for( n=0; n<TRACEDIFF_PARAMETERS; n++ )
Parameter[n].Value( td->Parameter[n] );
if( TraceDiffValidateParameters(td,Parameter) != MUTLIB_RESULT_SUCCESS )
break;
if( TraceAlignValidateInput(&td->Alignment) != MUTLIB_RESULT_SUCCESS )
{
td->ResultCode = td->Alignment.ResultCode;
std::strcpy( td->ResultString, td->Alignment.ResultString );
break;
}
State = STATE_TRACE_ALIGN;
break;
case STATE_TRACE_ALIGN:
// Align the reference and input traces
if( TraceAlignExecute(&td->Alignment) != MUTLIB_RESULT_SUCCESS )
{
td->ResultCode = TraceAlignGetResultCode( &td->Alignment );
std::strcpy( td->ResultString, TraceAlignGetResultString(&td->Alignment) );
State = STATE_EXIT;
break;
}
for( int n=0; n<2; n++ )
AlignedTrace[n].Wrap(TraceAlignGetAlignment(&td->Alignment,static_cast<mutlib_input_t>(n),&AlignedTraceClipL[n],&AlignedTraceClipR[n]),false);
State = STATE_TRACE_DIFFERENCE;
break;
case STATE_TRACE_DIFFERENCE: {
// Scale & Subtract the two traces to obtain the difference trace
State = (a&TRACEDIFF_ALGORITHM_DEFAULT_DIFFERENCE_ONLY) ? STATE_EXIT : STATE_MUTATION_ANALYSIS;
if( Parameter[TRACEDIFF_PARAMETER_YSCALE].Value() > 0.0 )
AlignedTrace[MUTLIB_INPUT].ScaleTo( AlignedTrace[MUTLIB_INPUT_REFERENCE] );
DiffTrace = AlignedTrace[MUTLIB_INPUT].Subtract( AlignedTrace[MUTLIB_INPUT_REFERENCE] );
if( !DiffTrace )
throw std::bad_alloc();
DiffTrace->AutoDestroy( false );
td->Difference = DiffTrace->Raw();
td->DifferenceLeft = AlignedTraceClipL[MUTLIB_INPUT];
td->DifferenceRight = AlignedTraceClipR[MUTLIB_INPUT];
break; }
case STATE_MUTATION_ANALYSIS:
// Analyse the difference trace for possible mutations
TraceDiffScanForMutations( *DiffTrace, Strand, DiffTrace->IntervalMode(),
AlignedTraceClipL[MUTLIB_INPUT], Parameter, DiffTagList );
if( DiffTagList.Count() > 0 )
{
// Construct output mutation tag list
TagArray OutTags;
bool bComplementBases = Parameter[TRACEDIFF_PARAMETER_COMPLEMENT_TAGS].Value()>0.0 ? true : false;
OutTags.Create( DiffTagList.Count() );
OutTags.ReadTags( DiffTagList, 1, bComplementBases );
OutTags.AutoDestroy( false );
td->Tag = OutTags.Raw();
td->TagCount = DiffTagList.Count();
}
State = STATE_EXIT;
//.........这里部分代码省略.........