pwlib (C component)

Documentation for data structrs, constants, and functionsdefined in the C component.

Constants

enum alnmode

Indicates which of the pairwise alignment algorithms should be used, see dptable.

There are two available variations of the standard dynamic programming algorithm.

First, the “standard” mode, in which time and space are quadratic in sequence lengths. Second, the “banded” mode, in which both time and space complexity are linear in sequence lengths (in fact, the shorter of the sequence lengths). This mode is not well-posed for local alignments.

Values:

STD_MODE

Standard alignment algorithm.

BANDED_MODE

Banded alignment algorithm.

enum std_alntype

Defines the boundary conditions (i.e where an alignment can start and where it can end) on the dynamic programming table for standard alignments.

Values:

GLOBAL

Solve for optimal global alignments, equivalent to the Needleman-Wunsch algorithm.

LOCAL

Solve for optimal local alignments, equivalent to the Smith-Waterman algorithm.

START_ANCHORED

Solve for optimal local alignments starting at the start of alignment frame for both sequences.

END_ANCHORED

Solve for optimal local alignments ending at the end of alignment frame for both sequences.

OVERLAP

Solve for suffix-prefix alignments of either direction (including substring alignments).

START_ANCHORED_OVERLAP

Solve or suffix-prefix alignments starting at the start of alignment frame for both sequences.

END_ANCHORED_OVERLAP

Solve or suffix-prefix alignments ending at the end of alignment frame for both sequences.

enum banded_alntype

Defines the boundary conditions (i.e where an alignment can start and where it can end) on the dynamic programming table for banded alignments.

Values:

B_GLOBAL

Solve for banded global alignments.

B_LOCAL

Solve for banded local alignments.

B_OVERLAP

Solve for banded suffix-prefix alignments of either direction (including substring alignments, if within band).

Functions

int dptable_init(dptable * T)

Given a dptable containing the alignment problem definition and the mode of alignment, the table’s dimensions are calculated and the appropriate amount of memory is allocated with initialized dpcell entries.

In banded mode the region of interest, which is not rectangular in the default (x,y) coordinate system, is mapped to an alternative coordinate system (refered to as (d,a)-coordinates).

Return
0 if successful and -1 if an error occurs.
Parameters
  • T: Table to be initialized. The only fields that must be already populated are the alignment mode and the problem definition.

void dptable_free(dptable * T)

Frees the allocated memory for the cells of a given dptable.

Parameters
  • T: the dynamic programming table containing all the info.

alignment* dptable_traceback(dptable * T, intpair end)

Traces back an alignment (and not all alignments with identical scores) from a given cell all the way back to a cell with a NULL base (i.e an alignment start cell).

Note
Finding more than one optimal alignment is a nontrivial search problem, and requires some sort of global state keeping to avoid convoluted recursions. I couldn’t get it right in the first go; leave for later.
Parameters
  • T: The solved dynamic programming table.
  • end: The desired ending point of alignment which becomes the starting point of traceback.

intpair dptable_solve(dptable * T)

Given an alignment with allocated DP table, solves the alignment problem (i.e populates the alignment table) and returns the optimal ending point for the alignment.

The optimal score and edit transcript can then be obtained by using dptable_traceback. Half of the constraints imposed by an alignment type are implemented here where we decide what positions on the table can be starting positions of alignments. The other half of the constraints concerning the ending position of the alignment on the table are enforced in dptable_traceback.

Return
The optimal cell for the alignment to end at or {-1,-1} if error.
Parameters
  • T: The dynamic programming table.

void* safe_malloc(int n, char * file, int line)

Safe handler for memory allocation.

If memory cannot be allocated prints an error message with coordinates of caller and crashes.

Data Structures

struct intpair

Any pair of integers.

Public Members

int i

The “first” element.

int j

The “second” element.

digraph "intpair"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="intpair",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" i\nj" ,fontname="Helvetica"];
  Node2 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
}
struct alnscores

Groups together the parameters for a pairwise alignment algorithm used to solve an alignment problem.

Public Members

double** subst_scores

The substitution score matrix, ordered the same as letters in the alphabet.

double gap_open_score

The gap open score in the affine gap penalty scheme, use 0 for a linear gap model.

double gap_extend_score

The gap extension score, or the linear gap score when using a linear gap model.

digraph "alnscores"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="alnscores",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" gap_extend_score\ngap_open_score" ,fontname="Helvetica"];
  Node2 [label="double",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" subst_scores" ,fontname="Helvetica"];
  Node3 [label="double **",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
}
struct alnframe

Defines the skeleton of a pairwise alignment problem: two sequences and their start/end of frame positions.

Public Members

int* origin

The “from” sequence as an array of integers.

int* mutant

The “to” sequence as an array of integers.

intpair origin_range

Vertical span of the frame in [min, max) format.

intpair mutant_range

Horizontal span of the frame in [min, max) format.

digraph "alnframe"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="alnframe",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mutant_range\norigin_range" ,fontname="Helvetica"];
  Node2 [label="intpair",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structintpair.html",tooltip="Any pair of integers. "];
  Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" i\nj" ,fontname="Helvetica"];
  Node3 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" origin\nmutant" ,fontname="Helvetica"];
}
struct std_alnparams

Groups together all parameters of a standard pairwise alignment problem: for now only an alignment type.

Public Members

std_alntype type

The subtype of standard algorithms.

digraph "std_alnparams"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="std_alnparams",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" type" ,fontname="Helvetica"];
  Node2 [label="std_alntype",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
}
struct banded_alnparams

Groups together all parameters of a banded pairwise alignment problem: alignment type, scores, and bounding diagonals.

Public Members

banded_alntype type

The subtype of banded algorithms.

int dmin

The upper diagonal bounding the band.

int dmax

The lower diagonal bounding the band.

digraph "banded_alnparams"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="banded_alnparams",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dmin\ndmax" ,fontname="Helvetica"];
  Node2 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" type" ,fontname="Helvetica"];
  Node3 [label="banded_alntype",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
}
struct alnprob

The definition of a pairwise alignment problem the contents of which is enough to define and solve an alignment.

Public Members

alnframe* frame

The skeleton of the DP table.

alnscores* scores

The parameters defining an optimal solution.

int max_new_mins

Maximum number of times a new minimum score is tolerated before alignment is aborted (only operative if positive).

alnmode mode

Indicates which of standard or banded alignment this is.

std_alnparams* std_params

The parameters for standard algorithms.

banded_alnparams* banded_params

The parameters for banded algorithms.

union alnprob::@0 alnprob::@1
digraph "alnprob"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="alnprob",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" frame" ,fontname="Helvetica"];
  Node2 [label="alnframe",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnframe.html",tooltip="Defines the skeleton of a pairwise alignment problem: two sequences and their start/end of frame posi..."];
  Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mutant_range\norigin_range" ,fontname="Helvetica"];
  Node3 [label="intpair",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structintpair.html",tooltip="Any pair of integers. "];
  Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" i\nj" ,fontname="Helvetica"];
  Node4 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" origin\nmutant" ,fontname="Helvetica"];
  Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" @1" ,fontname="Helvetica"];
  Node5 [label="anonymous:@1",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node6 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mode" ,fontname="Helvetica"];
  Node6 [label="alnmode",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node7 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" std_params" ,fontname="Helvetica"];
  Node7 [label="std_alnparams",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structstd__alnparams.html",tooltip="Groups together all parameters of a standard pairwise alignment problem: for now only an alignment ty..."];
  Node8 -> Node7 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" type" ,fontname="Helvetica"];
  Node8 [label="std_alntype",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" max_new_mins" ,fontname="Helvetica"];
  Node9 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scores" ,fontname="Helvetica"];
  Node9 [label="alnscores",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnscores.html",tooltip="Groups together the parameters for a pairwise alignment algorithm used to solve an alignment problem..."];
  Node10 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" gap_extend_score\ngap_open_score" ,fontname="Helvetica"];
  Node10 [label="double",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node11 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" subst_scores" ,fontname="Helvetica"];
  Node11 [label="double **",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node12 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" banded_params" ,fontname="Helvetica"];
  Node12 [label="banded_alnparams",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structbanded__alnparams.html",tooltip="Groups together all parameters of a banded pairwise alignment problem: alignment type, scores, and bounding diagonals. "];
  Node4 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dmin\ndmax" ,fontname="Helvetica"];
  Node13 -> Node12 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" type" ,fontname="Helvetica"];
  Node13 [label="banded_alntype",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
}
struct alnchoice

The fundamental unit of solving pairwise alignment problems.

Each cell of the dynamic programming table corrsponds to a subproblem of the overall alignment problem. For each subproblem, a “choice” corresponds to a single edit operation (which applies to the very last positions of the subproblem) and a “base” which is a choice residing at the cell to which the op points (the “base” is NULL for the choice of starting an alignment at a given position).

Each choice can thus be traced all the way back via the chain of “base” pointers to the beginning of the alignment to which it belongs. It is the total score of this alignment that is stored at each cell for each choice.

This architecture allows us to easily capture path-dependent scoring schemes, for example, the affine gap penalty.

Public Members

char op

Either of M for match, origin for substitution, I for insertion, and D for deletion.

double score

The overall score of the alignment corresponding to the chain of bases leading to here.

struct alnchoice* base

The choice for the consequent subproblem on which this choice and its score depends.

int mins_cd

The countdown of the number of new score minima encountered along the path leading to this choice.

int cur_min

The current minimum score along the path leading to this choice.

digraph "alnchoice"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="alnchoice",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" score" ,fontname="Helvetica"];
  Node2 [label="double",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" op" ,fontname="Helvetica"];
  Node3 [label="char",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cur_min\nmins_cd" ,fontname="Helvetica"];
  Node4 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"];
}
struct dpcell

A single cell of the dynamic programming table.

Each cell has an array of optimal choices linking to choices in dependent cells.

Public Members

int num_choices

The number of optimal scoring choices for the corresponding subproblem (i.e number of elements in choices).

struct alnchoice* choices

The optimal scoring choices.

We need to keep all in case of path-dependent scoring schemes, e.g affine gap.

digraph "dpcell"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="dpcell",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" choices" ,fontname="Helvetica"];
  Node2 [label="alnchoice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnchoice.html",tooltip="The fundamental unit of solving pairwise alignment problems. "];
  Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" score" ,fontname="Helvetica"];
  Node3 [label="double",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" op" ,fontname="Helvetica"];
  Node4 [label="char",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node5 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cur_min\nmins_cd" ,fontname="Helvetica"];
  Node5 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node2 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"];
  Node5 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" num_choices" ,fontname="Helvetica"];
}
struct dptable

The full dynamic programming table for a standard or banded alignment.

Public Members

dpcell** cells

The DP table in (i,j) or (d,a) coordinates.

int num_rows

The height of the DP table in memory.

int* row_lens

Row lengths (width) in the DP table at each row.

alnprob* prob

The alignment problem.

digraph "dptable"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="dptable",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" row_lens\nnum_rows" ,fontname="Helvetica"];
  Node2 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" prob" ,fontname="Helvetica"];
  Node3 [label="alnprob",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnprob.html",tooltip="The definition of a pairwise alignment problem the contents of which is enough to define and solve an..."];
  Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" frame" ,fontname="Helvetica"];
  Node4 [label="alnframe",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnframe.html",tooltip="Defines the skeleton of a pairwise alignment problem: two sequences and their start/end of frame posi..."];
  Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mutant_range\norigin_range" ,fontname="Helvetica"];
  Node5 [label="intpair",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structintpair.html",tooltip="Any pair of integers. "];
  Node2 -> Node5 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" i\nj" ,fontname="Helvetica"];
  Node2 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" origin\nmutant" ,fontname="Helvetica"];
  Node6 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" @1" ,fontname="Helvetica"];
  Node6 [label="anonymous:@1",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node7 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mode" ,fontname="Helvetica"];
  Node7 [label="alnmode",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node8 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" std_params" ,fontname="Helvetica"];
  Node8 [label="std_alnparams",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structstd__alnparams.html",tooltip="Groups together all parameters of a standard pairwise alignment problem: for now only an alignment ty..."];
  Node9 -> Node8 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" type" ,fontname="Helvetica"];
  Node9 [label="std_alntype",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node2 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" max_new_mins" ,fontname="Helvetica"];
  Node10 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" scores" ,fontname="Helvetica"];
  Node10 [label="alnscores",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnscores.html",tooltip="Groups together the parameters for a pairwise alignment algorithm used to solve an alignment problem..."];
  Node11 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" gap_extend_score\ngap_open_score" ,fontname="Helvetica"];
  Node11 [label="double",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node12 -> Node10 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" subst_scores" ,fontname="Helvetica"];
  Node12 [label="double **",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node13 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" banded_params" ,fontname="Helvetica"];
  Node13 [label="banded_alnparams",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structbanded__alnparams.html",tooltip="Groups together all parameters of a banded pairwise alignment problem: alignment type, scores, and bounding diagonals. "];
  Node2 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" dmin\ndmax" ,fontname="Helvetica"];
  Node14 -> Node13 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" type" ,fontname="Helvetica"];
  Node14 [label="banded_alntype",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node15 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cells" ,fontname="Helvetica"];
  Node15 [label="dpcell",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structdpcell.html",tooltip="A single cell of the dynamic programming table. "];
  Node16 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" choices" ,fontname="Helvetica"];
  Node16 [label="alnchoice",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$structalnchoice.html",tooltip="The fundamental unit of solving pairwise alignment problems. "];
  Node11 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" score" ,fontname="Helvetica"];
  Node17 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" op" ,fontname="Helvetica"];
  Node17 [label="char",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node2 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" cur_min\nmins_cd" ,fontname="Helvetica"];
  Node16 -> Node16 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" base" ,fontname="Helvetica"];
  Node2 -> Node15 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" num_choices" ,fontname="Helvetica"];
}
struct alignment

Represents a solution to an alignment problem.

Public Members

int origin_idx

The starting position of the alignment along the original sequence.

This is not relative to the start of alignment frame.

int mutant_idx

The starting position of the alignment along the “to” sequence.

This is not relative to the start of alignment frame.

double score

The score of the alignment according to the corresponding alnscores.

char* transcript

The sequence of edit operations, as in alnchoice that defines the alignment.

digraph "alignment"
{
  edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"];
  node [fontname="Helvetica",fontsize="10",shape=record];
  Node1 [label="alignment",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled", fontcolor="black"];
  Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" score" ,fontname="Helvetica"];
  Node2 [label="double",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" transcript" ,fontname="Helvetica"];
  Node3 [label="char",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
  Node4 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" mutant_idx\norigin_idx" ,fontname="Helvetica"];
  Node4 [label="int",height=0.2,width=0.4,color="grey75", fillcolor="white", style="filled"];
}