A library for working with phylogenetic and population genetic data.
v0.32.0
GenomeLocus Struct Reference

#include <genesis/population/genome_locus.hpp>

Detailed Description

A single locus, that is, a position (or coordinate) on a chromosome.

For our purposes here, we define a locus to be one position (1-based) on one chromosome exactly.

When working with multiple loci, we here often expect their chromosome names to be sorted in lexicographical order. Hence, for example, when comparing two loci on different chromosomes, we also take the ordering of their chromosome names into account.

There are some special cases:

  • We use an empty chromosome with position 0 to denote an empty(), unspecified locus.
  • A non-empty chromosome with position 0 means "any position" on the chromosome; this is however not considered to be a specified() locus.
  • An empty chromosome with a position other than 0 is an invalid state, and will throw.
See also
GenomeLocusSet
GenomeRegion
GenomeRegionList

Definition at line 64 of file genome_locus.hpp.

Public Member Functions

 GenomeLocus (GenomeLocus &&)=default
 
 GenomeLocus (GenomeLocus const &)=default
 
 GenomeLocus (std::string const &chr="", size_t pos=0)
 
 ~GenomeLocus ()=default
 
void clear ()
 
bool empty () const
 
GenomeLocusoperator= (GenomeLocus &&)=default
 
GenomeLocusoperator= (GenomeLocus const &)=default
 
bool specified () const
 

Public Attributes

std::string chromosome
 
size_t position = 0
 

Constructor & Destructor Documentation

◆ GenomeLocus() [1/3]

GenomeLocus ( std::string const &  chr = "",
size_t  pos = 0 
)
inline

Definition at line 69 of file genome_locus.hpp.

◆ ~GenomeLocus()

~GenomeLocus ( )
default

◆ GenomeLocus() [2/3]

GenomeLocus ( GenomeLocus const &  )
default

◆ GenomeLocus() [3/3]

GenomeLocus ( GenomeLocus &&  )
default

Member Function Documentation

◆ clear()

void clear ( )
inline

Definition at line 96 of file genome_locus.hpp.

◆ empty()

bool empty ( ) const
inline

Definition at line 84 of file genome_locus.hpp.

◆ operator=() [1/2]

GenomeLocus& operator= ( GenomeLocus &&  )
default

◆ operator=() [2/2]

GenomeLocus& operator= ( GenomeLocus const &  )
default

◆ specified()

bool specified ( ) const
inline

Definition at line 90 of file genome_locus.hpp.

Member Data Documentation

◆ chromosome

std::string chromosome

Definition at line 66 of file genome_locus.hpp.

◆ position

size_t position = 0

Definition at line 67 of file genome_locus.hpp.


The documentation for this struct was generated from the following file: