eXpress “1.5”

Fragment Class Reference

The Fragment class stores information for all alignments of a single fragment. More...

#include <fragments.h>

List of all members.

Public Member Functions

 Fragment (Library *lib)
 Fragment Constructor.
 ~Fragment ()
 Fragment destructor deletes all FragHit and ReadHit objects pointed to by the Fragment.
const Librarylib ()
 Accessor for the global variables associated with the library this fragment is from.
bool add_map_end (ReadHit *r)
 A member function that adds a new ReadHit to the Fragment.
const std::string & name () const
 A member function that returns a reference to the "Query Template Name".
size_t num_hits () const
 An accessor for the number of valid alignments of the fragment.
FragHitoperator[] (size_t i) const
 An accessor for a pointer to the FragHit at the given index.
const std::vector< FragHit * > & hits () const
 Accessor for the FragHit objects associated with the fragment.
const FragHitsample_hit () const
 A member function that returns a single FragHit of the fragment sampled at random based on the probabalistic assignments.
void mass (double m)
 Mutator for the mass of the fragment according to the forgetting factor.
double mass () const
 An accessor for the mass of the fragment according to the forgetting factor.
void sort_hits ()
 A member function that sorts the FragHits by the TargID of the targets they are aligned to.
bool paired () const
 An accessor that returns true iff the Fragment has paired alignments.

Detailed Description

The Fragment class stores information for all alignments of a single fragment.

By design, only paired-end mappings of paired-end reads will be accepted. All mappings of single-end reads will be accepted.

Author:
Adam Roberts
Date:
2011 Artistic License 2.0

Definition at line 384 of file fragments.h.


Member Function Documentation

bool Fragment::add_map_end ( ReadHit r)

A member function that adds a new ReadHit to the Fragment.

If it is the first ReadHit, it sets the Fragment name. If the fragment is not paired, a FragHit is created and added to _frag_hits. Otherwise, add_open_mate is called.

Parameters:
ra pointer to the ReadHit to be added.
Returns:
True iff the read name matches the Fragment name or it is the first read.

Definition at line 28 of file fragments.cpp.

const std::vector<FragHit*>& Fragment::hits ( ) const [inline]

Accessor for the FragHit objects associated with the fragment.

Returned value does not outlive this.

Returns:
Reference to a vector containing pointers to the FragHits.

Definition at line 464 of file fragments.h.

const Library* Fragment::lib ( ) [inline]

Accessor for the global variables associated with the library this fragment is from.

Pointer outlives this.

Definition at line 432 of file fragments.h.

void Fragment::mass ( double  m) [inline]

Mutator for the mass of the fragment according to the forgetting factor.

Parameters:
ma double representing the value to set to the mass to.

Definition at line 476 of file fragments.h.

double Fragment::mass ( ) const [inline]

An accessor for the mass of the fragment according to the forgetting factor.

Returns:
The mass of the fragment.

Definition at line 482 of file fragments.h.

const std::string& Fragment::name ( ) const [inline]

A member function that returns a reference to the "Query Template Name".

Returns:
Reference to the SAM "Query Template Name" (fragment name).

Definition at line 447 of file fragments.h.

size_t Fragment::num_hits ( ) const [inline]

An accessor for the number of valid alignments of the fragment.

Returns:
Number of valid alignments for fragment.

Definition at line 452 of file fragments.h.

FragHit* Fragment::operator[] ( size_t  i) const [inline]

An accessor for a pointer to the FragHit at the given index.

Parameters:
iindex of the FragHit requested.
Returns:
A pointer to the FragHit at the given index.

Definition at line 458 of file fragments.h.

bool Fragment::paired ( ) const [inline]

An accessor that returns true iff the Fragment has paired alignments.

Returns:
True iff the Fragment has paired alignments.

Definition at line 492 of file fragments.h.

const FragHit * Fragment::sample_hit ( ) const

A member function that returns a single FragHit of the fragment sampled at random based on the probabalistic assignments.

Returned value does not outlive this.

Returns:
A randomly sampled FragHit.

Definition at line 75 of file fragments.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables