#include <gnLocation.h>
Inheritance diagram for gnLocation:
Public Types | |
enum | intersectRestriction { determinedRegions, undeterminedRegions, allRegions } |
enum | gnLocationType { LT_Standard, LT_BetweenBases, LT_Complement, LT_Order, LT_Group, LT_OneOf, LT_Nothing } |
Public Member Functions | |
gnLocation () | |
Empty constructor, does nothing. | |
gnLocation (const gnLocation &s) | |
Copy constructor, copies a gnLocation. | |
gnLocation (const gnSeqI start, const gnSeqI end, const gnLocationType type=LT_Standard, string contigName="") | |
Constructor, creates a gnLocation. | |
gnLocation (const gnSeqI start, const gnSeqI startLength, const gnSeqI end, gnSeqI endLength, const gnLocationType type=LT_Standard, string contigName="") | |
Constructor, creates a gnLocation. | |
gnLocation * | Clone () const |
void | Clear () |
Resets this location to default values. | |
boolean | CropTo (const gnLocation &l) |
Crops this location to fit within the specified location boundaries. | |
boolean | CropStart (const gnSeqI start) |
Crops the start location by the specified amount. | |
boolean | CropEnd (const gnSeqI end) |
Crops the end location by the specified amount. | |
boolean | Intersects (const gnLocation &l, const intersectRestriction ir=allRegions) const |
Returns true if the given location intersects this location in the region specified by the parameter "ir". | |
boolean | Contains (const gnLocation &l, const intersectRestriction cr=allRegions) const |
Checks wether another gnLocation is contained by this one. | |
boolean | MovePositive (const gnSeqI diff) |
Increases the location start and end. | |
boolean | MoveNegative (const gnSeqI diff) |
Decreases the location start and end. | |
boolean | MoveTo (const int direction, const gnSeqI diff) |
Moves the location start and end. | |
gnSeqI | GetEnd () const |
Gets the ending base pair. | |
gnSeqI | GetEndLength () const |
Gets the ending base pair's definition value. | |
gnSeqI | GetLast () const |
gnSeqI | GetStart () const |
Gets the starting base pair. | |
gnSeqI | GetStartLength () const |
Gets the starting base pair's definition value. | |
gnSeqI | GetFirst () const |
gnLocationType | GetType () const |
Gets the location type. | |
void | GetBounds (gnSeqI &s, gnSeqI &sl, gnSeqI &e, gnSeqI &el) const |
Gets the location's boundaries. | |
bool | IsEndBoundLonger () const |
Returns true if the end is unbounded to the right. | |
bool | IsStartBoundLonger () const |
Returns true if the start is unbounded to the right. | |
bool | IsEndBoundShorter () const |
Returns true if the end is unbounded to the left. | |
bool | IsStartBoundShorter () const |
Returns true if the start is unbounded to the left. | |
void | SetEnd (const gnSeqI end) |
Sets the end location. | |
void | SetEnd (const gnSeqI end, const gnSeqI endLength) |
Sets the end location and definition. | |
void | SetEndLength (const gnSeqI endLength) |
Sets the end definition. | |
void | SetStart (const gnSeqI start) |
Sets the start location/. | |
void | SetStart (const gnSeqI start, const gnSeqI startLength) |
Sets the start location and definition. | |
void | SetStartLength (const gnSeqI startLength) |
Sets the start definition. | |
void | SetType (const gnLocationType lt) |
Sets the location type. | |
void | SetBounds (const gnSeqI start, const gnSeqI startLength, const gnSeqI end, const gnSeqI endLength) |
Sets the location's boundaries. | |
void | SetBounds (const gnSeqI start, const gnSeqI end) |
Sets the location's boundaries. | |
gnLocation | GetUnion (const gnLocation &l) const |
gnLocation | GetIntersection (const gnLocation &l, const intersectRestriction ir) const |
Static Public Attributes | |
const gnSeqI | Defined = 0 |
const gnSeqI | Unknown = GNSEQI_END |
Private Attributes | |
string | m_name |
gnSeqI | m_start |
gnSeqI | m_startLength |
gnSeqI | m_end |
gnSeqI | m_endLength |
gnLocationType | m_type |
gnBaseFeature uses it to track feature locations. gnLocation is capable of representing any GenBank style location qualifier. gnLocation stores the start coordinate and a startLength value which represents the length of an undetermined region of sequence prior to the starting coordinate. A startLength of GNSEQI_END represents an unknown start, whereas a startLength of 0 implies that the start coordinate is unambiguous. Any value other value indicates a range of coordinates for the starting position. The range is bounded by the given start coordinate and extends startLength characters upstream. Likewise, an endLength of GNSEQI_END represents an unknown ambiguous end coordinate, and an endLength of 0 implies that the end coordinate is unambiguous. Any other value for endLength denotes a range of ending coordinates starting at end and continuing for endLength characters.
Definition at line 36 of file gnLocation.h.
|
Definition at line 45 of file gnLocation.h. Referenced by gnBaseFeature::GetLocationType(), GetType(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), and gnGBKSource::Write(). |
|
Definition at line 39 of file gnLocation.h. |
|
Empty constructor, does nothing.
Definition at line 15 of file gnLocation.cpp. References Clear(). Referenced by Clone(). |
|
Copy constructor, copies a gnLocation.
Definition at line 19 of file gnLocation.cpp. References m_end, m_endLength, m_start, m_startLength, m_type, and SetBounds(). |
|
Constructor, creates a gnLocation.
Definition at line 30 of file gnLocation.cpp. References m_name, m_type, and SetBounds(). |
|
Constructor, creates a gnLocation.
Definition at line 24 of file gnLocation.cpp. References m_name, m_type, and SetBounds(). |
|
Resets this location to default values.
Definition at line 42 of file gnLocation.cpp. References LT_Nothing, m_end, m_endLength, m_start, m_startLength, and m_type. Referenced by CropTo(), and gnLocation(). |
|
Implements gnClone. Definition at line 37 of file gnLocation.cpp. References gnLocation(). |
|
Checks wether another gnLocation is contained by this one.
Definition at line 165 of file gnLocation.cpp. References determinedRegions, GetFirst(), GetLast(), m_end, m_start, and undeterminedRegions. Referenced by gnBaseFeature::IsContainedBy(). |
|
Crops the end location by the specified amount.
Definition at line 130 of file gnLocation.cpp. References gnSeqI, m_end, m_endLength, and m_start. Referenced by gnGenomeSpec::GetBrokenFeatures(), gnGenomeSpec::GetContainedFeatures(), and gnGenomeSpec::GetIntersectingFeatures(). |
|
Crops the start location by the specified amount.
Definition at line 118 of file gnLocation.cpp. References gnSeqI, m_end, m_start, and m_startLength. |
|
Crops this location to fit within the specified location boundaries.
Definition at line 71 of file gnLocation.cpp. References Clear(), GetEnd(), GetFirst(), GetLast(), GetStart(), gnSeqI, m_end, m_endLength, m_start, and m_startLength. |
|
Gets the location's boundaries.
Definition at line 52 of file gnLocation.cpp. References m_end, m_endLength, m_start, and m_startLength. |
|
Gets the ending base pair.
Definition at line 277 of file gnLocation.h. Referenced by gnBaseFeature::Crop(), CropTo(), and gnGBKSource::Write(). |
|
Gets the ending base pair's definition value.
Definition at line 282 of file gnLocation.h. References gnSeqI, and m_endLength. |
|
Definition at line 303 of file gnLocation.h. References gnSeqI, m_start, and m_startLength. Referenced by Contains(), CropTo(), GetIntersection(), and Intersects(). |
|
Definition at line 206 of file gnLocation.cpp. References allRegions, determinedRegions, ErrorMsg(), GetFirst(), GetLast(), m_end, m_start, and undeterminedRegions. |
|
Definition at line 287 of file gnLocation.h. References gnSeqI, m_end, and m_endLength. Referenced by Contains(), CropTo(), GetIntersection(), and Intersects(). |
|
Gets the starting base pair.
Definition at line 293 of file gnLocation.h. References gnSeqI, and m_start. Referenced by gnBaseFeature::Crop(), CropTo(), and gnGBKSource::Write(). |
|
Gets the starting base pair's definition value.
Definition at line 298 of file gnLocation.h. References gnSeqI, and m_startLength. |
|
Gets the location type.
Definition at line 309 of file gnLocation.h. References gnLocationType, and m_type. Referenced by gnGBKSource::Write(). |
|
Definition at line 199 of file gnLocation.cpp. References ErrorMsg(). |
|
Returns true if the given location intersects this location in the region specified by the parameter "ir".
Definition at line 143 of file gnLocation.cpp. References allRegions, determinedRegions, GetFirst(), GetLast(), m_end, m_start, and undeterminedRegions. Referenced by gnBaseFeature::Intersects(). |
|
Returns true if the end is unbounded to the right.
Definition at line 315 of file gnLocation.h. References m_endLength. Referenced by gnGBKSource::Write(). |
|
Returns true if the end is unbounded to the left.
Definition at line 325 of file gnLocation.h. References m_endLength. Referenced by gnGBKSource::Write(). |
|
Returns true if the start is unbounded to the right.
Definition at line 320 of file gnLocation.h. References m_startLength. Referenced by gnGBKSource::Write(). |
|
Returns true if the start is unbounded to the left.
Definition at line 330 of file gnLocation.h. References m_startLength. Referenced by gnGBKSource::Write(). |
|
Decreases the location start and end.
Definition at line 184 of file gnLocation.cpp. References m_end, and m_start. Referenced by gnGenomeSpec::GetBrokenFeatures(), gnGenomeSpec::GetContainedFeatures(), gnGenomeSpec::GetIntersectingFeatures(), and MoveTo(). |
|
Increases the location start and end.
Definition at line 176 of file gnLocation.cpp. References GNSEQI_END, m_end, and m_start. Referenced by MoveTo(). |
|
Moves the location start and end.
Definition at line 192 of file gnLocation.cpp. References MoveNegative(), and MovePositive(). |
|
Sets the location's boundaries.
Definition at line 65 of file gnLocation.cpp. |
|
Sets the location's boundaries.
Definition at line 60 of file gnLocation.cpp. References SetEnd(), and SetStart(). Referenced by gnLocation(). |
|
Sets the end location and definition.
Definition at line 341 of file gnLocation.h. References m_end, and m_endLength. |
|
Sets the end location.
Definition at line 336 of file gnLocation.h. References m_end. Referenced by gnFragmentSpec::CloneRange(), and SetBounds(). |
|
Sets the end definition.
Definition at line 347 of file gnLocation.h. References m_endLength. |
|
Sets the start location and definition.
Definition at line 357 of file gnLocation.h. References m_start, and m_startLength. |
|
Sets the start location/.
Definition at line 352 of file gnLocation.h. References m_start. Referenced by gnFragmentSpec::CloneRange(), and SetBounds(). |
|
Sets the start definition.
Definition at line 363 of file gnLocation.h. References m_startLength. |
|
Sets the location type.
Definition at line 369 of file gnLocation.h. References m_type. |
|
Definition at line 55 of file gnLocation.h. |
|
Definition at line 268 of file gnLocation.h. Referenced by Clear(), Contains(), CropEnd(), CropStart(), CropTo(), GetBounds(), GetEnd(), GetIntersection(), GetLast(), gnLocation(), Intersects(), MoveNegative(), MovePositive(), SetBounds(), and SetEnd(). |
|
Definition at line 269 of file gnLocation.h. Referenced by Clear(), CropEnd(), CropTo(), GetBounds(), GetEndLength(), GetLast(), gnLocation(), IsEndBoundLonger(), IsEndBoundShorter(), SetEnd(), and SetEndLength(). |
|
Definition at line 265 of file gnLocation.h. Referenced by gnLocation(). |
|
Definition at line 266 of file gnLocation.h. Referenced by Clear(), Contains(), CropEnd(), CropStart(), CropTo(), GetBounds(), GetFirst(), GetIntersection(), GetStart(), gnLocation(), Intersects(), MoveNegative(), MovePositive(), SetBounds(), and SetStart(). |
|
Definition at line 267 of file gnLocation.h. Referenced by Clear(), CropStart(), CropTo(), GetBounds(), GetFirst(), GetStartLength(), gnLocation(), IsStartBoundLonger(), IsStartBoundShorter(), SetStart(), and SetStartLength(). |
|
Definition at line 271 of file gnLocation.h. Referenced by Clear(), GetType(), gnLocation(), and SetType(). |
|
Definition at line 56 of file gnLocation.h. |