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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
/**********************************************************************
*
* scantwo_binary_hk.h
*
* copyright (c) 2010, Karl W Broman
*
* last modified Jun, 2010
* first written Jun, 2010
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License,
* version 3, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty; without even the implied warranty of
* merchantability or fitness for a particular purpose. See the GNU
* General Public License, version 3, for more details.
*
* A copy of the GNU General Public License, version 3, is available
* at http://www.r-project.org/Licenses/GPL-3
*
* C functions for the R/qtl package
*
* These functions are for performing a two-dimensional genome scan with
* a two-QTL model by Haley-Knott regression
*
* Contains: R_scantwo_1chr_binary_hk, scantwo_1chr_binary_hk,
* R_scantwo_2chr_binary_hk, scantwo_2chr_binary_hk
*
**********************************************************************/
/**********************************************************************
*
* R_scantwo_1chr_binary_hk
*
* Wrapper for call from R; reorganizes genotype prob and result matrix
* and calls scantwo_1chr_binary_hk.
*
**********************************************************************/
void R_scantwo_1chr_binary_hk(int *n_ind, int *n_pos, int *n_gen,
double *genoprob, double *pairprob,
double *addcov, int *n_addcov,
double *intcov, int *n_intcov,
double *pheno,
double *result, int *n_col2drop, int *col2drop,
double *tol, int *maxit, int *verbose);
/**********************************************************************
*
* scantwo_1chr_binary_hk
*
* Performs a 2-dimensional genome scan using the Haley-Knott
* regression method (regressing phenotypes on conditional genotype
* probabilities) for a two-QTL model with the two QTL residing on
* the same chromosome.
*
* n_ind Number of individuals
*
* n_pos Number of marker positions
*
* n_gen Number of different genotypes
*
* Genoprob Array of conditional genotype probabilities
* Indexed as Genoprob[gen][pos][ind]
*
* Pairprob Array of joint genotype probabilities for QTL
* pairs; indexed as Pairprob[gen1][gen2][pos1][pos2][ind]
* where pos2 > pos1 (for pos2 <= pos1, points to nothing)
*
* Addcov Matrix of additive covariates: Addcov[cov][ind]
*
* n_addcov Number of columns of Addcov
*
* Intcov Number of interactive covariates: Intcov[cov][ind]
*
* n_intcov Number of columns of Intcov
*
* pheno Phenotype data, as a vector
*
* Result vector to contain LOD scores
* triangle (row > col) contains the joint LODs while
* the upper triangle (row < col) contains the LODs for
* testing epistasis.
* Note: indexed as Result[col][row]
*
* n_col2drop For X chromosome, number of columns to drop
*
* col2drop For X chromosome, indicates which columns to drop
*
**********************************************************************/
void scantwo_1chr_binary_hk(int n_ind, int n_pos, int n_gen, double ***Genoprob,
double *****Pairprob, double **Addcov, int n_addcov,
double **Intcov, int n_intcov, double *pheno,
double **Result, int n_col2drop,
int *col2drop, double tol, int maxit, int verbose);
/**********************************************************************
*
* R_scantwo_2chr_binary_hk
*
* Wrapper for call from R; reorganizes genotype prob and result matrix
* and calls scantwo_2chr_binary_hk.
*
**********************************************************************/
void R_scantwo_2chr_binary_hk(int *n_ind, int *n_pos1, int *n_pos2,
int *n_gen1, int *n_gen2,
double *genoprob1, double *genoprob2,
double *addcov, int *n_addcov,
double *intcov, int *n_intcov,
double *pheno,
double *result_full, double *result_add,
double *tol, int *maxit, int *verbose);
/**********************************************************************
*
* scantwo_2chr_binary_hk
*
* Performs a 2-dimensional genome scan using the Haley-Knott
* regression method (regressing phenotypes on conditional genotype
* probabilities) for a two-QTL model with the two QTL residing on
* the different chromosomes.
*
* n_ind Number of individuals
*
* n_pos1 Number of marker positions on first chromosome
*
* n_pos2 Number of marker positions on second chromosome
*
* n_gen1 Number of different genotypes for first chromosome
*
* n_gen2 Number of different genotypes for second chromosome
*
* Genoprob1 Array of conditional genotype probs for 1st chr
* Indexed as Genoprob[gen][pos][ind]
*
* Genoprob2 Array of conditional genotype probs for 2nd chr
*
* Addcov Matrix of additive covariates: Addcov[cov][ind]
*
* n_addcov Number of columns of Addcov
*
* Intcov Number of interactive covariates: Intcov[cov][ind]
*
* n_intcov Number of columns of Intcov
*
* pheno Phenotype data, as a vector
*
* Result_full Result matrix of size [n_pos1 x n_pos2]
* containing the joint LODs
* Note: indexed as Result[pos1][pos2]
*
* Result_add Result matrix of size [n_pos2 x n_pos1]
* containing the LODs for add've models
* also indexed as Result[pos2][pos1]
*
**********************************************************************/
void scantwo_2chr_binary_hk(int n_ind, int n_pos1, int n_pos2, int n_gen1,
int n_gen2, double ***Genoprob1,
double ***Genoprob2,
double **Addcov, int n_addcov,
double **Intcov, int n_intcov, double *pheno,
double **Result_full, double **Result_add,
double tol, int maxit, int verbose);
/* end of scantwo_binary_hk.h */
|