yat/omic/VcfCompare.h

Code
Comments
Other
Rev Date Author Line
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 4 // $Id$
3759 17 Oct 18 peter 5
3759 17 Oct 18 peter 6 /*
4359 23 Aug 23 peter 7   Copyright (C) 2018 Peter Johansson
3759 17 Oct 18 peter 8
3759 17 Oct 18 peter 9   The yat library is free software; you can redistribute it and/or
3759 17 Oct 18 peter 10   modify it under the terms of the GNU General Public License as
3759 17 Oct 18 peter 11   published by the Free Software Foundation; either version 3 of the
3759 17 Oct 18 peter 12   License, or (at your option) any later version.
3759 17 Oct 18 peter 13
3759 17 Oct 18 peter 14   The yat library is distributed in the hope that it will be useful,
3759 17 Oct 18 peter 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
3759 17 Oct 18 peter 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3759 17 Oct 18 peter 17   General Public License for more details.
3759 17 Oct 18 peter 18
3759 17 Oct 18 peter 19   You should have received a copy of the GNU General Public License
3759 17 Oct 18 peter 20   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 35      Functor used to compare to VCF objects with respect to their
3759 17 Oct 18 peter 36      genomic position.
3759 17 Oct 18 peter 37
3759 17 Oct 18 peter 38      \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 44        Default constructor
3759 17 Oct 18 peter 45
3759 17 Oct 18 peter 46        \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 51        Constructs an object using chromosomes as defoined in \c contig
3759 17 Oct 18 peter 52        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 57        \return \c true if \a lhs is less than \a rhs
3759 17 Oct 18 peter 58
3759 17 Oct 18 peter 59        The following criteria are used to compare the two objects:
4308 10 Feb 23 peter 60        1) chromosome (as defined in constructor)
3759 17 Oct 18 peter 61        2) position \c POS
3759 17 Oct 18 peter 62        3) reference allele \c REF
3759 17 Oct 18 peter 63        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