/* --------------------------------------------------------------------- */ /* */ /* BAYESIAN MULTIMAPPER / INBRED LINE CROSSES Version 1.0 */ /* */ /* (c) Copyright 1996-2006 by Mikko J. Sillanpaa */ /* */ /* Rolf Nevanlinna Institute */ /* FIN-00014 University of Helsinki, FINLAND */ /* */ /* E-mail : mjs@rolf.helsinki.fi */ /* */ /* last updated : February 2002 */ /* */ /* --------------------------------------------------------------------- */ /* This file is part of the Multimapper software. */ /* The Multimapper software has been written only for scientific use. */ /* There is absolutely no warranty in the Multimapper software. */ /* You are using the Multimapper software completely at your own risk. */ /* Beware! this is the version 1.0, the Multimapper software might */ /* contain some errors or bugs! */ /* */ /* --------------------------------------------------------------------- */ /* */ /* file name: data_structure.h (header file) */ /* */ /* main datastructures for whole program */ /* */ /* */ /* --------------------------------------------------------------------- */ #define MAX_N_CHROMOS 50 /* max number of chromosomes */ #define MAX_N_MARKERS 50 /* max number of markers per chromosome */ #define MAX_N_BG_CONT 50 /* max number of background controls */ #define MAX_N_GENOTYP 50 /* max number of genotypes */ #define MAX_N_INDIVID 500 /* max number of individuals */ #define MAX_N_QTL 3 /* max number of QTLs */ #define MAX_N_COV 10 /* max number of covariates */ #define MAX_N_CLASSES 30 /* max number of classes in covariates */ long lrand48(void); #define rand() lrand48() #undef RAND_MAX #define RAND_MAX 2147483647 /* int Nind; */ /* number of individuals */ /* int Ngen; */ /* number of possible genotypes */ /* int N_bc; */ /* number of background controls */ /* double *alpha; */ /* vector (1..N_gen) of possible genotypes */ /* double *X; */ /* (N_bc x Nind) matrix of bc genotypes */ typedef struct regression_parameters { double a; /* mean */ double sigma; /* residual variance */ double b[MAX_N_QTL][MAX_N_GENOTYP]; /* vector for genotypic coeff. */ double bc[MAX_N_BG_CONT][MAX_N_GENOTYP]; /* matrix for bg. control coeff. */ double cov[MAX_N_COV][MAX_N_CLASSES]; /* r-coeff/classification covar */ } regpa; /* --------------------------------------------------------------------- */ /* support structure for markers and their order and */ /* recombination fractions between them */ /* --------------------------------------------------------------------- */ typedef struct mark { int marker; /* marker nro */ char *name; /* marker name */ double r; /* recomb. fract. between this and next marker */ double dist; /* same distance in centiMorgans */ struct mark *next; /* pointer to next marker */ } markers; typedef struct QTL { double l_x; /* location of QTL */ int ML; /* number-1 of left flanking marker */ int MR; /* number-1 of right flanking marker */ markers *g_l; /* pointer to left flanking marker */ markers *g_r; /* pointer to right flanking marker */ /* not used */ double r1; /* recombination fraction between QTL and left fl. m. */ double r2; /* recombination fraction between QTL and right fl. m. */ } QTL_type; typedef struct chromosome { int chromosome_number; /* chromosome number */ char *name; /* chromosome name */ markers *start; /* pointer to markers */ struct chromosome *next; /* pointer to next chromosome */ } chromosome_type; /* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */ /* support structure for individuals phenotypes and */ /* complete and incomplete genotypes */ /* --------------------------------------------------------------------- */ typedef struct geno { int genotype; /* coded individual genotype */ chromosome_type *chr; /* pointer telling which chromosome */ markers *marker; /* pointer telling which marker */ struct geno *next; /* pointer to next marker genotype */ } geno_type; typedef struct ind { int number; /* individual number */ double phenotype[10]; /* phenotype of this individual */ geno_type *start; /* pointer to start of incomplete genotypes */ struct ind *next; /* pointer to next individual */ } individuals; /* --------------------------------------------------------------------- */ /* following structure is not used in this implementation*/ typedef struct c_m { int genotype; /* coded individual genotype */ geno_type *info; /* pointer to location information */ struct c_m *next; /* pointer to next marker */ } complete_markers;