#include <Range.h>

Public Types | |
| typedef list< Range * > ::const_iterator | const_iterator |
Public Member Functions | |
| RangeChain () | |
| RangeChain (const RangeChain &ch) | |
| RangeChain (const string &raw) | |
| RangeChain (const Range &r) | |
| ~RangeChain () | |
| RangeChain & | operator= (const RangeChain &rc) |
| void | add (const Range &r, bool sd=true) |
| int | getOverlap () const |
| bool | exonMerge (const RangeChain &rc) |
| pair< int, int > | length () const |
| int | outerLength () const |
| Range | outerRange () const |
| int | sumLength () const |
| int | exonLength () const |
| pair< int, int > | intronLength () const |
| int | maxIntronLength () const |
| int | begin () const |
| int | end () const |
| pair< int, int > | exonOverlap (const RangeChain &rc) const |
| int | numberOfRanges () const |
| char | direction () const |
| void | order () |
| ostream & | tableRows (ostream &ous, const string &prefix) const |
| const_iterator | itbegin () const |
| const_iterator | itend () const |
Protected Attributes | |
| list< Range * > | chain |
| int | sumolp |
Friends | |
| ostream & | operator<< (ostream &ous, const RangeChain &rc) |
Derive this class from the base class Range, the overal range of the chain is a Range [B, E]
If you know that your chain components will not overlap each other you should use some other simple data structure such as vector of Range. Right now this class is useful in checking Chimeras.
| typedef list<Range*>::const_iterator RangeChain::const_iterator |
| RangeChain::RangeChain | ( | ) | [inline] |
| RangeChain::RangeChain | ( | const RangeChain & | ch | ) |
copy constructor of the same type
References chain, and Range::Range().
| RangeChain::RangeChain | ( | const string & | raw | ) |
This constructor takes a string input. It will parse the strin as a list of Ranges. It is not sorted in any way, but could be in one of the two ways:
if on +, then from small to large. if on -, then from large to small. The following is an example of +
342525-342791,342797-343540,343546-345213,348262-349290
258231-257542,257149-256862,256375-255698
References chain, Range::Range(), split(), and substr().
| RangeChain::RangeChain | ( | const Range & | r | ) | [inline] |
References chain, and Range::Range().
| RangeChain & RangeChain::operator= | ( | const RangeChain & | rc | ) |
References chain, Range::Range(), and sumolp.
| void RangeChain::add | ( | const Range & | r, | |
| bool | sd = true | |||
| ) |
This is the major accumulator function to build the chain from input Ranges.
| sd | controls the behavior of this function. The default is true. This parameter has the same meaning as the one in overlap() |
Before adding each new Range, we dorted the chain with lessByDirection() login. So the chain elements will be -----> then <-----
this one is doing the merging If overlap with any exon then it will merge the underlying exon; otherwise it will append the Range r after the component Range under consideration. This effect is to sort the component Ranges.
There is no sorting action.
References Range::b, chain, del(), direction(), lessRangeByDirectional(), Range::Range(), and sumolp.
Referenced by M8MatchChain::add(), mRNAModelUpdate::addESTCover(), checkUTRChimera(), M8MatchChain::M8MatchChain(), and Tblastn::qcov().
| int RangeChain::getOverlap | ( | ) | const [inline] |
return the sum of the overlaps while building this chain. The add function keeps track of the overlaps during the operation. If not using the add function, then this number should be zero.
References sumolp.
Referenced by M8MatchChain::queryOverlap().
| bool RangeChain::exonMerge | ( | const RangeChain & | rc | ) |
merges the underlying Ranges if they are in the same direction.
References chain, and direction().
Referenced by mergeNeighbor().
| pair< int, int > RangeChain::length | ( | ) | const |
obtain the sum length of all Ranges the firt length is from the plus direction the second length is from the minus direction The length is the length after the merger of individual ranges.
This method should be removed. Replaced with exonLength. This method should be reserved for the parent length returning the overal length.
Reimplemented from Range.
References chain.
Referenced by Tblastn::qcov(), and M8MatchChain::queryLength().
| int RangeChain::outerLength | ( | ) | const |
| Range RangeChain::outerRange | ( | ) | const |
return the first and the last as a Range
References chain, and Range::Range().
| int RangeChain::sumLength | ( | ) | const |
length of all Ranges regardless of direction as oppose to length that returns two lengths
References chain.
Referenced by exonLength(), and mergeNeighbor().
| int RangeChain::exonLength | ( | ) | const [inline] |
| pair< int, int > RangeChain::intronLength | ( | ) | const |
return the sum of the length of the gaps between all ranges for both the plus and the minus direction.
References chain, and direction().
| int RangeChain::begin | ( | ) | const [inline] |
Reimplemented from Range.
References chain.
Referenced by mergeNeighbor().
| int RangeChain::end | ( | ) | const [inline] |
Reimplemented from Range.
References chain.
Referenced by mergeNeighbor().
| pair< int, int > RangeChain::exonOverlap | ( | const RangeChain & | rc | ) | const |
compare this object with another RangeChain object and compute the ammount of the overlap of underlying Ranges.
Referenced by mergeNeighbor().
| int RangeChain::numberOfRanges | ( | ) | const [inline] |
return the number of Ranges in this chain.
References chain.
Referenced by mergeNeighbor(), and operator<<().
| char RangeChain::direction | ( | ) | const |
if all of the component Ranges are in the + direction then return +. If all in the - direction then return -. If mixed then return ' '
This also overwrites the parent direction method.
Reimplemented from Range.
References chain.
Referenced by add(), exonMerge(), and intronLength().
| void RangeChain::order | ( | ) |
order the range first by direction then by directional range. This is hard to implement. Need a special function object.
References chain, and RangeLessPtr().
| ostream & RangeChain::tableRows | ( | ostream & | ous, | |
| const string & | prefix | |||
| ) | const |
produce table rows with prefix as prefix. For example the prefix could be a string "tdb\tgenomic" this function will produce tdb genomic exnum ex1b ex1b tdb genomic exnum ex2b ex2b .... tdb genomic exnum exnb exnb
References chain.
Referenced by mergeNeighbor().
| const_iterator RangeChain::itbegin | ( | ) | const [inline] |
for iterator throught the chain
References chain.
| const_iterator RangeChain::itend | ( | ) | const [inline] |
References chain.
| ostream& operator<< | ( | ostream & | ous, | |
| const RangeChain & | rc | |||
| ) | [friend] |
output using ' | ' as delimiter
list<Range*> RangeChain::chain [protected] |
Use the list to kepp track of individual Ranges.
Could be from large to small or from small to large. Depends on the direction of the underlying ranges.
Referenced by add(), begin(), direction(), end(), exonMerge(), exonOverlap(), intronLength(), itbegin(), itend(), length(), maxIntronLength(), numberOfRanges(), operator<<(), operator=(), order(), outerLength(), outerRange(), RangeChain(), sumLength(), tableRows(), and ~RangeChain().
int RangeChain::sumolp [protected] |
this is the sum of overlaps during the add() operation.
Referenced by add(), exonOverlap(), getOverlap(), and operator=().
1.5.6