1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
/* "SeqQueueTypes.h" */
#include <stdio.h>
#include <stdlib.h>
#include "array.h"
typedef int IdType;
#define MAX_VERTICES 100 /* ie the number of contigs */
/* most of the time we need the address of the AdjacencyRec for each mate
so store them in mates_ad
*/
typedef struct _Mates {
IdType m;
double weight;
} Mates;
typedef struct _id_wt {
int id;
double weight;
} id_wt;
typedef struct _cnt_comp {
int cnt;
int comp;
int orig;
} cnt_comp;
typedef struct _id_dir {
int id;
int dir;
} id_dir;
typedef struct _AdjacencyRec {
IdType id; /* contig id */
int direction; /* the final direction +/- 1 */
int degree; /* number of mates */
Mates *mates; /* array of mate ids */
struct _AdjacencyRec **mates_ad;/* array of pointers to mates */
int visited; /* flag to say we have been here */
double weight; /* weight to define position in SP */
struct _AdjacencyRec *left; /* pointer to left neighbour in tree */
struct _AdjacencyRec *right; /* pointer to right neighbour in tree */
} AdjacencyRec;
typedef struct { /* our graph structure */
int number_of_verts; /* number of vertices (contigs) */
AdjacencyRec **recs;
} Graph;
typedef struct { /* a temporary structure for sorting */
AdjacencyRec *adrec; /* the non-SP contigs into left-right */
double weight; /* order, prior to intercalation */
} AdRecSort;
typedef AdjacencyRec *ItemType;
typedef struct {
/* our queue for the breadth */
/* first search */
int Count; /* number of queue items */
int Front; /* front of queue */
int Rear; /* rear of queue */
Array Items; /* array of 'ItemType', queued items */
} Queue;
|