-
Notifications
You must be signed in to change notification settings - Fork 23
/
cross_genail.h
73 lines (56 loc) · 3.13 KB
/
cross_genail.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
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
// QTLCross class for general k-way advanced intercross lines
#ifndef CROSS_GENAIL_H
#define CROSS_GENAIL_H
#include <Rcpp.h>
#include "cross.h"
class GENAIL : public QTLCross
{
public:
int n_founders;
GENAIL(int nf){
crosstype = "genail";
phase_known_crosstype = "genailpk"; // this actually doesn't exist
if(nf < 2) {
throw std::range_error("general AIL should have >= 2 founders");
}
n_founders = nf;
};
~GENAIL(){};
const bool check_geno(const int gen, const bool is_observed_value,
const bool is_x_chr, const bool is_female, const Rcpp::IntegerVector& cross_info);
const double init(const int true_gen,
const bool is_x_chr, const bool is_female, const Rcpp::IntegerVector& cross_info);
const double emit(const int obs_gen, const int true_gen, const double error_prob,
const Rcpp::IntegerVector& founder_geno, const bool is_x_chr,
const bool is_female, const Rcpp::IntegerVector& cross_info);
const double step(const int gen_left, const int gen_right, const double rec_frac,
const bool is_x_chr, const bool is_female, const Rcpp::IntegerVector& cross_info);
const Rcpp::IntegerVector possible_gen(const bool is_x_chr, const bool is_female, const Rcpp::IntegerVector& cross_info);
const int ngen(const bool is_x_chr);
const int nalleles();
const Rcpp::NumericMatrix geno2allele_matrix(const bool is_x_chr);
const bool check_crossinfo(const Rcpp::IntegerMatrix& cross_info, const bool any_x_chr);
const bool check_founder_geno_size(const Rcpp::IntegerMatrix& founder_geno, const int n_markers);
const bool check_founder_geno_values(const Rcpp::IntegerMatrix& founder_geno);
const bool need_founder_geno();
const std::vector<std::string> geno_names(const std::vector<std::string> alleles, const bool is_x_chr);
const int nrec(const int gen_left, const int gen_right,
const bool is_x_chr, const bool is_female,
const Rcpp::IntegerVector& cross_info);
// check whether X chr can be handled
const bool check_handle_x_chr(const bool any_x_chr);
// tailored est_map that pre-calculates transition matrices, etc
const Rcpp::NumericVector est_map2(const Rcpp::IntegerMatrix& genotypes,
const Rcpp::IntegerMatrix& founder_geno,
const bool is_X_chr,
const Rcpp::LogicalVector& is_female,
const Rcpp::IntegerMatrix& cross_info,
const Rcpp::IntegerVector& cross_group,
const Rcpp::IntegerVector& unique_cross_group,
const Rcpp::NumericVector& rec_frac,
const double error_prob,
const int max_iterations,
const double tol,
const bool verbose);
};
#endif // CROSS_GENAIL_H