-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtajima.cuh
167 lines (148 loc) · 5.97 KB
/
tajima.cuh
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
#pragma once
#include <iostream>
#include <future>
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <thread>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
using namespace std;
class tajima
{
/**
* Execution of the Tajima's D function.
* Execution of GENE mode and WINDOW mode.
* Execution of NORMAL mode and PROMETHEUS mode.
**/
private:
/**
* @param calc_Mode acts as a boolean variable to determine between GENE(FILE) mode or WINDOW mode.
**/
string calc_Mode = "FILE";
/**
* @param window_Size defines the base pair (bp) size of the query window for analysis. Used with WINDOW mode.
**/
int window_Size = 0;
/**
* @param step_Size defines the number of bps to skip to reach the next query window. Used with WINDOW mode.
**/
int step_Size = 0;
/**
* @param gene_List defines the CATE compatible GENE list file. Used with GENE mode.
**/
string gene_List;
/**
* @param input_Folder defines the path of the CATE indexed VCF folder.
**/
string input_Folder;
/**
* @param ouput_Path defines the path of the directory to which the outputs will be written to.
**/
string ouput_Path;
/**
* @param intermediate_Path defines the intermediate folder path.
**/
string intermediate_Path;
/**
* @param ploidy defines number of sets of chromosomes per individual organism.
**/
int ploidy;
/**
* @param tot_Blocks defines number of GPU blocks that are available
**/
int tot_Blocks;
/**
* @param tot_ThreadsperBlock defines number of threads that are available per GPU block.
**/
int tot_ThreadsperBlock;
/**
* ! Parameters used to configure PROMETHEUS mode.
* These parameters are considered only when Prometheus is activated.
**/
/**
* @param prometheus_Activate acts as a boolean variable and is used to activate Prometheus.
**/
string prometheus_Activate = "NO";
/**
* @param Multi_read acts as a boolean variable and is used to enable SSD based multiple reading of multiple files at once.
**/
string Multi_read = "NO";
/**
* @param number_of_genes defines the number of query regions Prometheus should handle at once.
**/
int number_of_genes = 0;
/**
* @param CPU_cores defines the number of CPU cores that are available at Prometheus's disposal.
**/
int CPU_cores = 0;
/**
* @param SNPs_per_Run defines the number of SNP sites the GPU will process at a time.
**/
int SNPs_per_Run = 0;
public:
/**
* Tajima has 4 constructor Functions.
* They are for the 4 separate modal combinations that Tajima can be configured to. Namely:
* 1. NORMAL - GENE MODE
* 2. NORMAL - WINDOW MODE
* 3. PROMETHEUS - GENE MODE
* 4. PROMETHEUS - WINDOW MODE
* All serve the common function of assigning passed variables to the classes' private variable.
**/
tajima();
/**
* NORMAL - GENE MODE constructor
**/
tajima(string gene_List, string input_Folder, string ouput_Path, int cuda_ID, string intermediate_Path, int ploidy);
/**
* NORMAL - WINDOW MODE constructor
**/
tajima(string calc_Mode, int window_Size, int step_Size, string input_Folder, string ouput_Path, int cuda_ID, int ploidy);
/**
* PROMETHEUS - GENE MODE constructor
**/
tajima(string gene_List, string input_Folder, string ouput_Path, int cuda_ID, string intermediate_Path, int ploidy, string prometheus_Activate, string Multi_read, int number_of_genes, int CPU_cores, int SNPs_per_Run);
/**
* PROMETHEUS - WINDOW MODE constructor
**/
tajima(string calc_Mode, int window_Size, int step_Size, string input_Folder, string ouput_Path, int cuda_ID, int ploidy, string prometheus_Activate, string Multi_read, int number_of_genes, int CPU_cores, int SNPs_per_Run);
/**
* This function is used in conjunction with the constructors to set the common private variables.
**/
void set_Values(string gene_List, string input_Folder, string ouput_Path, int cuda_ID, string intermediate_Path, int ploidy);
/**
* Execution function.
**/
void ingress();
/**
* This is the normal WINDOW FUNCTION. Where there is a fixed step size.
**/
void window(string output_File, float a1, float e1, float e2, int N, long int combinations, vector<pair<string, string>> &folder_Index);
/**
* This is the sliding WINDOW FUNCTION. Where there is a not a fixed step size. But the WINDOW slides from one SNP to the next in the VCF file.
* This is activated by setting the step_Size to 0.
**/
void window_Sliding(string output_File, float a1, float e1, float e2, int N, long int combinations, vector<pair<string, string>> &folder_Index);
// vector<string> get_Countries();
// vector<pair<string, string>> index_Folder(string &country);
// vector<string> compound_interpolationSearch(vector<pair<string, string>> &folder_Index, int &start_Co, int &end_Co);
// vector<int> forward_Search(int pos, vector<pair<string, string>> folder_Index, int start_Co, int end_Co);
// vector<int> backward_Search(int pos, vector<pair<string, string>> folder_Index, int start_Co, int end_Co);
// int getN_Split(string file);
/**
* This function is used to calculate the prerequisites using the sample size required for calculating Tajima's D.
**/
void calc_Pre(int &N_tot, float &a1, float &e1, float &e2); // calc a1 to e2
// int calc_Pairwise(string &line, int pair_Count);
// void split(vector<string> &line_Data, string line, string delim);
// void split_Convert(int *line_temp, string line, string delim);
// void split_getPos(vector<string> &line_Data, string line, string delim);
// long int fact_half(int count);
// long int combos_N(int count);
// void createFile(string path, string text);
// void createFile(string path);
};