~ubuntu-branches/ubuntu/trusty/libbpp-popgen/trusty

« back to all changes in this revision

Viewing changes to src/Bpp/PopGen/MultiAlleleMonolocusGenotype.h

  • Committer: Package Import Robot
  • Author(s): Julien Dutheil
  • Date: 2013-03-07 10:51:00 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130307105100-7ij3w7iyab9t2mbt
Tags: 2.1.0-1
Bug fixed and warnings removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
//
6
6
 
7
7
/*
8
 
   Copyright or © or Copr. CNRS, (November 17, 2004)
 
8
   Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
9
9
 
10
10
   This software is a computer program whose purpose is to provide classes
11
11
   for population genetics analysis.
12
12
 
13
13
   This software is governed by the CeCILL  license under French law and
14
 
   abiding by the rules of distribution of free software.  You can  use, 
 
14
   abiding by the rules of distribution of free software.  You can  use,
15
15
   modify and/ or redistribute the software under the terms of the CeCILL
16
16
   license as circulated by CEA, CNRS and INRIA at the following URL
17
 
   "http://www.cecill.info". 
 
17
   "http://www.cecill.info".
18
18
 
19
19
   As a counterpart to the access to the source code and  rights to copy,
20
20
   modify and redistribute granted by the license, users are provided only
21
21
   with a limited warranty  and the software's author,  the holder of the
22
22
   economic rights,  and the successive licensors  have only  limited
23
 
   liability. 
 
23
   liability.
24
24
 
25
25
   In this respect, the user's attention is drawn to the risks associated
26
26
   with loading,  using,  modifying and/or developing or reproducing the
29
29
   therefore means  that it is reserved for developers  and  experienced
30
30
   professionals having in-depth computer knowledge. Users are therefore
31
31
   encouraged to load and test the software's suitability as regards their
32
 
   requirements in conditions enabling the security of their systems and/or 
33
 
   data to be ensured and,  more generally, to use and operate it in the 
34
 
   same conditions as regards security. 
 
32
   requirements in conditions enabling the security of their systems and/or
 
33
   data to be ensured and,  more generally, to use and operate it in the
 
34
   same conditions as regards security.
35
35
 
36
36
   The fact that you are presently reading this means that you have had
37
37
   knowledge of the CeCILL license and that you accept its terms.
38
 
   */
 
38
 */
39
39
// Secured inclusion of header's file
40
40
#ifndef _MULTIALLELEMONOLOCUSGENOTYPE_H_
41
41
#define _MULTIALLELEMONOLOCUSGENOTYPE_H_
45
45
 
46
46
#include <Bpp/Exceptions.h>
47
47
 
48
 
//From local
 
48
// From local
49
49
#include "MonolocusGenotype.h"
50
50
 
51
51
namespace bpp
52
52
{
53
 
 
54
 
  /**
55
 
   * @brief The MultiAlleleMonolocusGenotype class.
56
 
   *
57
 
   * This class is intended to handle monolocus genotype with many alleles
58
 
   * like polyploid loci or loci obtained by trace file without cutoff on
59
 
   * peaks or other filter.
60
 
   *
61
 
   * @author Sylvain Gaillard
62
 
   */
63
 
  class MultiAlleleMonolocusGenotype:
64
 
    public MonolocusGenotype
65
 
  {
66
 
    private:
67
 
      std::vector<unsigned int> allele_index_;
68
 
 
69
 
    public: // Constructors and destructor
70
 
 
71
 
      /**
72
 
       * @brief Build a monolocus genotype containing many alleles.
73
 
       */
74
 
      MultiAlleleMonolocusGenotype(std::vector<unsigned int> allele_index);
75
 
 
76
 
      /**
77
 
       * @brief Copy constructor.
78
 
       */
79
 
      MultiAlleleMonolocusGenotype(const MultiAlleleMonolocusGenotype& mmg);
80
 
 
81
 
      /**
82
 
       * @brief Destroy the MultiAlleleMonolocusGenotype.
83
 
       */
84
 
      ~MultiAlleleMonolocusGenotype();
85
 
 
86
 
    public: // Other methodes
87
 
      /**
88
 
       * @brief The affectation operator.
89
 
       */
90
 
      MultiAlleleMonolocusGenotype& operator= (const MultiAlleleMonolocusGenotype& mmg);
91
 
 
92
 
      /**
93
 
       * @brief The == operator.
94
 
       */
95
 
      bool operator== (const MultiAlleleMonolocusGenotype& mmg) const;
96
 
 
97
 
      /**
98
 
       * @brief Test the homozygozity of the locus (i.e. all allele are identical).
99
 
       */
100
 
      bool isHomozygous() const;
101
 
 
102
 
      /**
103
 
       * @name The MonolocusGenotype interface:
104
 
       *
105
 
       * @{
106
 
       */
107
 
      std::vector<unsigned int> getAlleleIndex() const;
108
 
      /** @} */
109
 
 
110
 
      /**
111
 
       * @name The Clonable interface:
112
 
       *
113
 
       * @{
114
 
       */
115
 
      MultiAlleleMonolocusGenotype* clone() const;
116
 
      /** @} */
117
 
  };
118
 
 
119
 
} //end of namespace bpp;
 
53
/**
 
54
 * @brief The MultiAlleleMonolocusGenotype class.
 
55
 *
 
56
 * This class is intended to handle monolocus genotype with many alleles
 
57
 * like polyploid loci or loci obtained by trace file without cutoff on
 
58
 * peaks or other filter.
 
59
 *
 
60
 * @author Sylvain Gaillard
 
61
 */
 
62
class MultiAlleleMonolocusGenotype :
 
63
  public MonolocusGenotype
 
64
{
 
65
private:
 
66
  std::vector<size_t> allele_index_;
 
67
 
 
68
public:
 
69
  // Constructors and destructor
 
70
  /**
 
71
   * @brief Build a monolocus genotype containing many alleles.
 
72
   */
 
73
  MultiAlleleMonolocusGenotype(std::vector<size_t> allele_index);
 
74
 
 
75
  /**
 
76
   * @brief Copy constructor.
 
77
   */
 
78
  MultiAlleleMonolocusGenotype(const MultiAlleleMonolocusGenotype& mmg);
 
79
 
 
80
  /**
 
81
   * @brief Destroy the MultiAlleleMonolocusGenotype.
 
82
   */
 
83
  ~MultiAlleleMonolocusGenotype();
 
84
 
 
85
public:
 
86
  // Other methodes
 
87
  /**
 
88
   * @brief The affectation operator.
 
89
   */
 
90
  MultiAlleleMonolocusGenotype& operator=(const MultiAlleleMonolocusGenotype& mmg);
 
91
 
 
92
  /**
 
93
   * @brief The == operator.
 
94
   */
 
95
  bool operator==(const MultiAlleleMonolocusGenotype& mmg) const;
 
96
 
 
97
  /**
 
98
   * @brief Test the homozygozity of the locus (i.e. all allele are identical).
 
99
   */
 
100
  bool isHomozygous() const;
 
101
 
 
102
  /**
 
103
   * @name The MonolocusGenotype interface:
 
104
   *
 
105
   * @{
 
106
   */
 
107
  std::vector<size_t> getAlleleIndex() const;
 
108
  /** @} */
 
109
 
 
110
  /**
 
111
   * @name The Clonable interface:
 
112
   *
 
113
   * @{
 
114
   */
 
115
  MultiAlleleMonolocusGenotype* clone() const;
 
116
  /** @} */
 
117
};
 
118
} // end of namespace bpp;
120
119
 
121
120
#endif // _MULTIALLELEMONOLOCUSGENOTYPE_H_
122
121