3759 |
17 Oct 18 |
peter |
1 |
#ifndef theplu_yat_omic_vcf_compare |
3759 |
17 Oct 18 |
peter |
2 |
#define theplu_yat_omic_vcf_compare |
3759 |
17 Oct 18 |
peter |
3 |
|
3759 |
17 Oct 18 |
peter |
// $Id$ |
3759 |
17 Oct 18 |
peter |
5 |
|
3759 |
17 Oct 18 |
peter |
6 |
/* |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2018 Peter Johansson |
3759 |
17 Oct 18 |
peter |
8 |
|
3759 |
17 Oct 18 |
peter |
The yat library is free software; you can redistribute it and/or |
3759 |
17 Oct 18 |
peter |
modify it under the terms of the GNU General Public License as |
3759 |
17 Oct 18 |
peter |
published by the Free Software Foundation; either version 3 of the |
3759 |
17 Oct 18 |
peter |
License, or (at your option) any later version. |
3759 |
17 Oct 18 |
peter |
13 |
|
3759 |
17 Oct 18 |
peter |
The yat library is distributed in the hope that it will be useful, |
3759 |
17 Oct 18 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3759 |
17 Oct 18 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3759 |
17 Oct 18 |
peter |
General Public License for more details. |
3759 |
17 Oct 18 |
peter |
18 |
|
3759 |
17 Oct 18 |
peter |
You should have received a copy of the GNU General Public License |
3759 |
17 Oct 18 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
3759 |
17 Oct 18 |
peter |
21 |
*/ |
3759 |
17 Oct 18 |
peter |
22 |
|
3759 |
17 Oct 18 |
peter |
23 |
#include <cstddef> |
3759 |
17 Oct 18 |
peter |
24 |
#include <map> |
3759 |
17 Oct 18 |
peter |
25 |
#include <string> |
3759 |
17 Oct 18 |
peter |
26 |
|
3759 |
17 Oct 18 |
peter |
27 |
namespace theplu { |
3759 |
17 Oct 18 |
peter |
28 |
namespace yat { |
3759 |
17 Oct 18 |
peter |
29 |
namespace omic { |
3759 |
17 Oct 18 |
peter |
30 |
|
3759 |
17 Oct 18 |
peter |
31 |
class VcfHeader; |
3759 |
17 Oct 18 |
peter |
32 |
class VCF; |
3759 |
17 Oct 18 |
peter |
33 |
|
3759 |
17 Oct 18 |
peter |
34 |
/** |
3759 |
17 Oct 18 |
peter |
Functor used to compare to VCF objects with respect to their |
3759 |
17 Oct 18 |
peter |
genomic position. |
3759 |
17 Oct 18 |
peter |
37 |
|
3759 |
17 Oct 18 |
peter |
\since New in yat 0.16 |
3759 |
17 Oct 18 |
peter |
39 |
*/ |
3759 |
17 Oct 18 |
peter |
40 |
class VcfCompare |
3759 |
17 Oct 18 |
peter |
41 |
{ |
3759 |
17 Oct 18 |
peter |
42 |
public: |
3759 |
17 Oct 18 |
peter |
43 |
/** |
3759 |
17 Oct 18 |
peter |
Default constructor |
3759 |
17 Oct 18 |
peter |
45 |
|
3759 |
17 Oct 18 |
peter |
\note Constructed object is useless as no chromosomes are defined |
3759 |
17 Oct 18 |
peter |
47 |
*/ |
3759 |
17 Oct 18 |
peter |
48 |
VcfCompare(void); |
3759 |
17 Oct 18 |
peter |
49 |
|
3759 |
17 Oct 18 |
peter |
50 |
/** |
3759 |
17 Oct 18 |
peter |
Constructs an object using chromosomes as defoined in \c contig |
3759 |
17 Oct 18 |
peter |
entries in header \a hdr. |
3759 |
17 Oct 18 |
peter |
53 |
*/ |
3759 |
17 Oct 18 |
peter |
54 |
VcfCompare(const VcfHeader& hdr); |
3759 |
17 Oct 18 |
peter |
55 |
|
3759 |
17 Oct 18 |
peter |
56 |
/** |
3759 |
17 Oct 18 |
peter |
\return \c true if \a lhs is less than \a rhs |
3759 |
17 Oct 18 |
peter |
58 |
|
3759 |
17 Oct 18 |
peter |
The following criteria are used to compare the two objects: |
4308 |
10 Feb 23 |
peter |
1) chromosome (as defined in constructor) |
3759 |
17 Oct 18 |
peter |
2) position \c POS |
3759 |
17 Oct 18 |
peter |
3) reference allele \c REF |
3759 |
17 Oct 18 |
peter |
4) alternative sequence \c ALT |
3759 |
17 Oct 18 |
peter |
64 |
*/ |
3759 |
17 Oct 18 |
peter |
65 |
bool operator()(const VCF& lhs, const VCF& rhs) const; |
3759 |
17 Oct 18 |
peter |
66 |
|
3759 |
17 Oct 18 |
peter |
67 |
private: |
3759 |
17 Oct 18 |
peter |
68 |
std::map<std::string, size_t> chr2tid_; |
3759 |
17 Oct 18 |
peter |
69 |
}; |
3759 |
17 Oct 18 |
peter |
70 |
|
3759 |
17 Oct 18 |
peter |
71 |
}}} |
3759 |
17 Oct 18 |
peter |
72 |
|
3759 |
17 Oct 18 |
peter |
73 |
#endif |