-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsnp.h
66 lines (58 loc) · 1.89 KB
/
snp.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
/*
* Copyright (c) 2011-2012 Genome Research Ltd. All rights reserved.
*
* This file is part of Gftools.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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 for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GFTOOLS_SNP_H
#define GFTOOLS_SNP_H
namespace gftools {
/** A SNP.
*
* A named, bi-allelic SNP with chromsomal location.
*/
class snp {
public:
/// The position of the SNP
int genetic_position, physical_position;
/// The SNP name.
std::string name;
/// The name of the chromosome on which the SNP is located.
std::string chromosome;
// The alleles of the SNP
std::string allele_a, allele_b;
/** Creates a new, named SNP and genetic and physical positions = 0.
*
* @param name The SNP name.
*/
snp(std::string name) {
this->name = name;
genetic_position = 0;
physical_position = 0;
}
/** Creates a new, unnamed SNP and genetic and physical positions = 0.
*/
snp() {
genetic_position = 0;
physical_position = 0;
}
/** Returns true if both alleles of the SNP have been assigned.
*/
bool is_known() {
return (!allele_a.empty() || !allele_b.empty());
}
};
}
#endif // GFTOOLS_SNP_H