mapgd  0.4
A program for the Maximum-likelihood analysis of population genomic data.
 All Data Structures Functions Variables Friends Groups Pages
Public Member Functions | Data Fields | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
Locus Class Reference
Inheritance diagram for Locus:
Inheritance graph
[legend]
Collaboration diagram for Locus:
Collaboration graph
[legend]

Public Member Functions

void write_binary (std::ostream &out) const
 
void read_binary (std::istream &in)
 
 Locus (const count_t &)
 Locus is initialized to abs_pos_=0, id1=0, and set to contain 0 samples.
 
 Locus ()
 Locus is initialized to abs_pos_=0, id1=0, and set to contain 0 samples.
 
 Locus (const std::vector< std::string > &)
 
Locusoperator= (const Locus &)
 
Locusoperator+= (const Locus &)
 
const Locus operator+ (const Locus &) const
 
const count_t getindex (count_t) const
 Returns the index of the alleles in order a sorted order. More...
 
count_t getcoverage (count_t) const
 Returns coverage of population/individual N.
 
count_t getcoverage (void) const
 Returns total coverage.
 
count_t getcount (count_t) const
 Returns the count of allele in all individuals in the population.
 
count_t getcount (count_t, count_t) const
 Returns the count of individual a's b'th allele.
 
void swap (count_t, count_t)
 Exchange the alleles.
 
void sort (count_t)
 Sort counts from most common to least common (based on population N).
 
void sort (void)
 Sort counts from most common to least common (among all non-masked sites).
 
void set_quartet (const quartet_t &, const count_t &)
 Sets the quartet_t array (unsorted). More...
 
const quartet_tget_quartet (const count_t &) const
 Returns the N'th quartet at the Locus. More...
 
quartet_tget_quartet (const count_t &)
 Returns the N'th quartet at the Locus. More...
 
count_t maskedcount (void) const
 Returns the count of the number of individuals that are masked.
 
void maskall (void)
 Mask all lines. More...
 
void unmaskall (void)
 Unmask all lines. More...
 
void mask (const std::vector< size_t > &)
 Mask all lines. More...
 
void unmask (const std::vector< size_t > &)
 Unmask all lines. More...
 
void mask_low_cov (const count_t &dp)
 Mask site with coverage stricktly lt dp;.
 
char getname (const count_t &) const
 Get the nucleotide represented by the count at the N'th indexed quartet_t.
 
char getname_gt (const count_t &) const
 Get the nucleotide represented by the count at the N'th indexed quartet_t, return * if the count equals the N+1 indexed quartet.
 
count_t get_extraid (const size_t &) const
 Get the extraid of the Locus. Used to represent the reference call.
 
void set_extraid (const count_t &, const size_t &)
 Set the extraid of the Locus. Just used to represent the reference call.
 
void resize (const size_t &)
 < Set the absolute position of the Locus. More...
 
std::vector< quartet_t >::iterator begin (void)
 
std::vector< quartet_t >::iterator end (void)
 Return an iterator to the quartet_t s stored at this Locus. More...
 
std::vector< quartet_t >
::const_iterator 
cbegin (void) const
 Return an iterator to the quartet_t s stored at this Locus.
 
std::vector< quartet_t >
::const_iterator 
cend (void) const
 Return an iterator to the quartet_t s stored at this Locus.
 
std::vector< std::string > get_sample_names (void) const
 names of the samples sequenced
 
void set_sample_names (const std::vector< std::string > &sample_names)
 names of the samples sequenced.
 
std::string header (void) const
 
size_t size (void) const
 The size of the class in bytes.
 
const std::string get_file_name (void) const
 
const std::string get_table_name (void) const
 
const bool get_binary (void) const
 
const std::string sql_header (void) const
 Return the names of the columns, along with variable type.
 
const std::string sql_column_names (void) const
 Return the names of the columns.
 
const std::string sql_values (void) const
 Return the values to be placed in columns.
 
void sql_read (std::istream &) override
 Reads the values...
 
- Public Member Functions inherited from Indexed_data
void write_pos (std::ostream &str) const
 
void read_pos (std::istream &str)
 
 Indexed_data (std::vector< std::string > &)
 
id1_t get_abs_pos (void) const
 Indexed data needs to associate each datum with a position in the genome.
 
void set_abs_pos (const id1_t &)
 Indexed data needs to associate each datum with a position in the genome.
 
const bool indexed () const
 
- Public Member Functions inherited from Data
void read_binary (std::istream &str)
 
void write_binary (std::ostream &str) const
 
 Data (std::vector< std::string > &)
 

Data Fields

gt_t sorted_ [5]
 an array to allow sorted access to quartets.
 
std::vector< quartet_tsample
 The five bases A/C/G/T/N;.
 
Base ref
 

Static Public Attributes

static const gt_t default_order [5] = {0,1,2,3,4}
 
static const std::string file_name =".pro"
 
static const std::string table_name ="QUARTETS"
 
static const bool binary =true
 
- Static Public Attributes inherited from Data
static const std::string file_name =".txt"
 The read function must be defined in the child class. More...
 
static const std::string table_name ="NONE"
 The read function must be defined in the child class. More...
 

Private Member Functions

void write (std::ostream &out) const
 The write function must be defined in the child class.
 
void read (std::istream &in)
 The read function must be defined in the child class.
 

Static Private Member Functions

static Datacreate (const std::vector< std::string > &Columns)
 

Private Attributes

std::vector< std::string > sample_names_
 names of the samples sequenced.
 

Static Private Attributes

static const Registration registered =Registration(Locus::table_name, Locus::create)
 

Friends

std::istream & mpileup (std::istream &in, Locus &x, const int &, const int &)
 
void scan (const Locus &site, const std::string &str, quartet_t &q)
 

Additional Inherited Members

- Static Public Member Functions inherited from Data
static Datanew_from_str (const std::string &, const std::vector< std::string > &)
 Constructs an instance of the class Registered w/ string.
 
- Protected Attributes inherited from Indexed_data
id1_t abs_pos_
 

Member Function Documentation

std::vector<quartet_t>::iterator Locus::end ( void  )
inline

Return an iterator to the quartet_t s stored at this Locus.

Return an iterator to the quartet_t s stored at this Locus.

const quartet_t & Locus::get_quartet ( const count_t &  c) const

Returns the N'th quartet at the Locus.

returns quartet_t c.

quartet_t & Locus::get_quartet ( const count_t &  c)

Returns the N'th quartet at the Locus.

returns quartet_t c.

const count_t Locus::getindex ( count_t  c) const

Returns the index of the alleles in order a sorted order.

}

void Locus::mask ( const std::vector< size_t > &  s)

Mask all lines.

Mask all the quartets in the populations in the vector.

void Locus::maskall ( void  )

Mask all lines.

Mask all the quartets at this locus.

void Locus::resize ( const size_t &  c)

< Set the absolute position of the Locus.

sets the number of sampels to c.

Change the number of quartet_t s at the Locus.

void Locus::set_quartet ( const quartet_t q,
const count_t &  c 
)

Sets the quartet_t array (unsorted).

sets quartet_t c to q.

void Locus::unmask ( const std::vector< size_t > &  s)

Unmask all lines.

Unmask all the quartets in the populations in the vector.

void Locus::unmaskall ( void  )

Unmask all lines.

Unmask all the quartets at this locus.


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