-
Notifications
You must be signed in to change notification settings - Fork 2
/
anal.h
47 lines (39 loc) · 1.45 KB
/
anal.h
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
#pragma once
#include <vector>
#include "analysisFunction.h"
#include "readplink.h"
#include "kstring.h"
void wrap(const plink *p,const std::vector<double> &phe,const std::vector<double> &ad,Matrix<double> &freq,int model,std::vector<double> start,Matrix<double> &cov,int,double,std::vector<char*> &loci,int nThreads,FILE *outFile);
/*
Below is the pars.
This will contain all data needed for analyzing one site.
The idea is that we allocate pars[nthreads].
The internal arrays are nsites long. And will therefore not require reallocating.
We assume no missing data (samples are filteret in the set_pars)
*/
typedef struct{
int len; //length
Matrix<double> *covs;//covs is a design matrix.
int ncov; //number of covariates <ncov_max
char *gs;//genotypes gs \in {0,1,2,3},counts of allele2, 3=NA/missing
double *ys;//pheno
double *qvec;//admix prop
double *start0;//start. Initialized as long as len. Just to be sure.
double *start;//start. Initialized as long as len. Just to be sure.
double *mafs;//freqs <- this is never allocated but points to the Matrix<double> freq;
int model;// 0=add 1=
int quant;
int maxIter;
double tol;
int doOptim;
int retPrior;
int doLean;
double *res;//should contain the per site results. Takes from Line this is a double[47]
//tmp structs to avoid overusing stack
double *pheno;
double *p_sCg;
Matrix<double> *design;
Matrix<double> *ysCgs;
kstring_t bufstr;
kstring_t tmpstr;
}pars;