text
stringlengths 0
14.1k
|
---|
#define SAVE_EXONSCORE_ALLOWED_DIFFERENCE 30
|
typedef enum
|
{
|
MERGEABLE_LEFTSIDE_A_BEFORE_B = 0,
|
MERGEABLE_LEFTSIDE_A_EQUALS_B,
|
MERGEABLE_LEFTSIDE_A_AFTER_B,
|
NON_MERGEABLE_LEFTSIDE,
|
} Leftsidestatus;
|
typedef enum
|
{
|
MERGEABLE_RIGHTSIDE_A_BEFORE_B = 0,
|
MERGEABLE_RIGHTSIDE_A_EQUALS_B,
|
MERGEABLE_RIGHTSIDE_A_AFTER_B,
|
NON_MERGEABLE_RIGHTSIDE,
|
} Rightsidestatus;
|
/*
|
The following function returns the core of an Exonnode.
|
That is, the node without the pointers to the successors of this node.
|
The input is the spliced alignment \textit{sa}, and the index <exonindex>
|
of the exon to be processed.
|
*/
|
Exonnode getcoreExonnodefromSA(GthSA *sa, unsigned long exonindex)
|
{
|
Exonnode node;
|
Exonscoreinfo scoreinfo;
|
/* alignment contains at least one exon */
|
gt_assert(gth_sa_num_of_exons(sa));
|
/* number of exons minus 1 equals number of introns */
|
gt_assert(gth_sa_num_of_exons(sa) - 1 ==
|
gth_sa_num_of_introns(sa));
|
/* exonindex is valid */
|
gt_assert(exonindex < gth_sa_num_of_exons(sa));
|
node.exonscores = gt_array_new(sizeof (Exonscoreinfo));
|
node.range.start = gth_sa_get_exon(sa, exonindex)->leftgenomicexonborder;
|
node.range.end = gth_sa_get_exon(sa, exonindex)->rightgenomicexonborder;
|
if (exonindex == 0) /* this is the first exon */
|
node.leftmergeable = true;
|
else
|
node.leftmergeable = false;
|
if (exonindex == gth_sa_num_of_exons(sa) - 1) {
|
/* this is the last exon */
|
node.rightmergeable = true;
|
}
|
else
|
node.rightmergeable = false;
|
/* save successor intron */
|
if (exonindex < gth_sa_num_of_exons(sa) - 1) {
|
/* exon has successor intron */
|
node.successorintron = gth_sa_get_intron(sa, exonindex);
|
}
|
else {
|
/* exon has no successor intron */
|
node.successorintron = NULL;
|
}
|
/* save exonscore */
|
scoreinfo.exonscore = gth_sa_get_exon(sa, exonindex)->exonscore;
|
scoreinfo.lengthofscoringexon = node.range.end - node.range.start + 1;
|
gt_array_add(node.exonscores, scoreinfo);
|
return node;
|
}
|
static void freecoreExonnode(Exonnode *node)
|
{
|
if (!node) return;
|
gt_array_delete(node->exonscores);
|
}
|
static Leftsidestatus getleftsidestatus(Exonnode *nodeA, Exonnode *nodeB)
|
{
|
/* -------...
|
]-----... */
|
if (nodeA->range.start < nodeB->range.start && nodeB->leftmergeable)
|
return MERGEABLE_LEFTSIDE_A_BEFORE_B;
|
/* -------...
|
-------... */
|
if (nodeA->range.start == nodeB->range.start)
|
return MERGEABLE_LEFTSIDE_A_EQUALS_B;
|
/* ]-----...
|
-------... */
|
if (nodeA->range.start > nodeB->range.start && nodeA->leftmergeable)
|
return MERGEABLE_LEFTSIDE_A_AFTER_B;
|
return NON_MERGEABLE_LEFTSIDE;
|
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.