yat  0.20.3pre
Public Member Functions | Related Functions | List of all members
theplu::yat::omic::GenomicPosition Class Reference

#include <yat/omic/GenomicPosition.h>

Inheritance diagram for theplu::yat::omic::GenomicPosition:

Public Member Functions

 GenomicPosition (void)
 
 GenomicPosition (unsigned short chr, unsigned long pos)
 Constructor. More...
 
 GenomicPosition (const std::string &chr, unsigned long pos)
 Constructor. More...
 
 GenomicPosition (const std::string &chr, const std::string &pos)
 Constructor. More...
 
unsigned short & chromosome (void)
 
const unsigned short & chromosome (void) const
 
unsigned long int & position (void)
 
const unsigned long int & position (void) const
 

Related Functions

(Note that these are not member functions.)

bool operator< (const GenomicPosition &lhs, const GenomicPosition &rhs)
 
bool operator== (const GenomicPosition &lhs, const GenomicPosition &rhs)
 

Detailed Description

Class used to hold genomic location, i.e., chromosome and position.

The class inherits from boost::operators, which means besides the operators directly implemented (operator== and operator<) also operator<=, operator>, operator>=, and operator!= are supported.

Since
New in yat 0.7

Constructor & Destructor Documentation

◆ GenomicPosition() [1/4]

theplu::yat::omic::GenomicPosition::GenomicPosition ( void  )

Creates a GenomicPosition with undefined values.

◆ GenomicPosition() [2/4]

theplu::yat::omic::GenomicPosition::GenomicPosition ( unsigned short  chr,
unsigned long  pos 
)

Constructor.

Parameters
chrchromosome
posnon-negative number describing location on chromosome

◆ GenomicPosition() [3/4]

theplu::yat::omic::GenomicPosition::GenomicPosition ( const std::string &  chr,
unsigned long  pos 
)

Constructor.

Parameters
chrchromosome
posnon-negative number describing location on chromosome

chr2int is used to translate chr into an unsigned short, and utility::convert is used to translate pos into an unsigned long.

See also
chr2int
Since
New in yat 0.18

◆ GenomicPosition() [4/4]

theplu::yat::omic::GenomicPosition::GenomicPosition ( const std::string &  chr,
const std::string &  pos 
)

Constructor.

Parameters
chrchromosome
posnon-negative number describing location on chromosome

chr2int is used to translate chr into an unsigned short, and utility::convert is used to translate pos into an unsigned long.

See also
chr2int

Member Function Documentation

◆ chromosome() [1/2]

unsigned short& theplu::yat::omic::GenomicPosition::chromosome ( void  )
Returns
reference to chr

◆ chromosome() [2/2]

const unsigned short& theplu::yat::omic::GenomicPosition::chromosome ( void  ) const
Returns
const reference to chr

◆ position() [1/2]

unsigned long int& theplu::yat::omic::GenomicPosition::position ( void  )
Returns
reference to position

◆ position() [2/2]

const unsigned long int& theplu::yat::omic::GenomicPosition::position ( void  ) const
Returns
const reference to position

Friends And Related Function Documentation

◆ operator<()

bool operator< ( const GenomicPosition lhs,
const GenomicPosition rhs 
)
related
Returns
true if chromosome of lhs is less than chromosome of rhs or if chromosome of lhs equals chromosome of rhs and position of lhs is less than position of rhs.
Since
New in yat 0.7

◆ operator==()

bool operator== ( const GenomicPosition lhs,
const GenomicPosition rhs 
)
related
Returns
true if chromosomes and positions are the same.
Since
New in yat 0.7

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

Generated on Sat Feb 18 2023 03:31:44 for yat by  doxygen 1.8.14