ContextSV 0.0.1
Integrative SV calling.
All Classes Files Functions Variables Typedefs Macros
cnv_caller.h
Go to the documentation of this file.
1// CNVCaller: Detect CNVs and return the state sequence by SNP position
2// (key = [chromosome, SNP position], value = state)
3
4#ifndef CNV_CALLER_H
5#define CNV_CALLER_H
6
7#include "khmm.h"
8#include "input_data.h"
9#include "cnv_data.h"
10
12#include <string>
13#include <vector>
15
16
17class CNVCaller {
18 private:
21
22 public:
24
25 // Detect CNVs and return the state sequence by SNP position
26 // (key = [chromosome, SNP position], value = state)
27 CNVData run();
28
29 // Calculate Log R Ratios
30 std::vector<double> calculateLogRRatiosAtSNPS(std::vector<int> snp_positions);
31
32 // Calculate the mean chromosome coverage
34
35 // Calculate region mean coverage
36 double calculateWindowLogRRatio(double mean_chr_cov, int start_pos, int end_pos);
37
38 // Read SNP positions and BAF values from the VCF file
39 std::pair<std::vector<int>, std::vector<double>> readSNPBAFs();
40
41 // Read SNP population frequencies from the PFB file and return a vector
42 // of population frequencies for each SNP location
43 std::vector<double> getSNPPopulationFrequencies(std::vector<int> snp_locations);
44
45 // Save a CSV with SNP positions, BAF values and Log R Ratios
46 void saveToTSV(std::string filepath, std::vector<int> snp_locations, std::vector<double> bafs, std::vector<double> logr_ratios, std::vector<int> state_sequence);
47};
48
49#endif // CNV_CALLER_H
Definition cnv_caller.h:17
std::vector< double > calculateLogRRatiosAtSNPS(std::vector< int > snp_positions)
Definition cnv_caller.cpp:119
void saveToTSV(std::string filepath, std::vector< int > snp_locations, std::vector< double > bafs, std::vector< double > logr_ratios, std::vector< int > state_sequence)
Definition cnv_caller.cpp:508
CNVData run()
Definition cnv_caller.cpp:30
double chr_mean_coverage
Definition cnv_caller.h:20
std::vector< double > getSNPPopulationFrequencies(std::vector< int > snp_locations)
Definition cnv_caller.cpp:370
std::pair< std::vector< int >, std::vector< double > > readSNPBAFs()
Definition cnv_caller.cpp:263
double calculateWindowLogRRatio(double mean_chr_cov, int start_pos, int end_pos)
Definition cnv_caller.cpp:220
double calculateMeanChromosomeCoverage()
Calculate the mean chromosome coverage.
Definition cnv_caller.cpp:175
InputData * input_data
Definition cnv_caller.h:19
Definition cnv_data.h:11
Definition input_data.h:16