Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
gnLocation Class Reference This class is used to store sequence locations.
More...
#include <gnLocation.h >
Inheritance diagram for gnLocation::
List of all members.
Public Types
enum intersectRestriction { determinedRegions ,
undeterminedRegions ,
allRegions
}
enum gnLocationType {
LT_Standard ,
LT_BetweenBases ,
LT_Complement ,
LT_Order ,
LT_Group ,
LT_OneOf ,
LT_Nothing
}
Public Methods
gnLocation ()
Empty constructor, does nothing. More...
gnLocation (const gnLocation &s)
Copy constructor, copies a gnLocation. More...
gnLocation (const gnSeqI start, const gnSeqI end, const gnLocationType type=LT_Standard, string contigName="")
Constructor, creates a gnLocation. More...
gnLocation (const gnSeqI start, const gnSeqI startLength, const gnSeqI end, gnSeqI endLength, const gnLocationType type=LT_Standard, string contigName="")
Constructor, creates a gnLocation. More...
gnLocation* Clone () const
void Clear ()
Resets this location to default values. More...
boolean CropTo (const gnLocation &l)
Crops this location to fit within the specified location boundaries. More...
boolean CropStart (const gnSeqI start)
Crops the start location by the specified amount. More...
boolean CropEnd (const gnSeqI end)
Crops the end location by the specified amount. More...
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". More...
boolean Contains (const gnLocation &l, const intersectRestriction cr=allRegions) const
Crops the end location by the specified amount. More...
boolean MovePositive (const gnSeqI diff)
Increases the location start and end. More...
boolean MoveNegative (const gnSeqI diff)
Decreases the location start and end. More...
boolean MoveTo (const int direction, const gnSeqI diff)
Moves the location start and end. More...
gnSeqI GetEnd () const
Gets the ending base pair. More...
gnSeqI GetEndLength () const
Gets the ending base pair's definition value. More...
gnSeqI GetLast () const
gnSeqI GetStart () const
Gets the starting base pair. More...
gnSeqI GetStartLength () const
Gets the starting base pair's definition value. More...
gnSeqI GetFirst () const
gnLocationType GetType () const
Gets the location type. More...
void GetBounds (gnSeqI &s, gnSeqI &sl, gnSeqI &e, gnSeqI &el) const
Gets the location's boundaries. More...
bool IsEndBoundLonger () const
Returns true if the end is unbounded to the right. More...
bool IsStartBoundLonger () const
Returns true if the start is unbounded to the right. More...
bool IsEndBoundShorter () const
Returns true if the end is unbounded to the left. More...
bool IsStartBoundShorter () const
Returns true if the start is unbounded to the left. More...
void SetEnd (const gnSeqI end)
Sets the end location. More...
void SetEnd (const gnSeqI end, const gnSeqI endLength)
Sets the end location and definition. More...
void SetEndLength (const gnSeqI endLength)
Sets the end definition. More...
void SetStart (const gnSeqI start)
Sets the start location/. More...
void SetStart (const gnSeqI start, const gnSeqI startLength)
Sets the start location and definition. More...
void SetStartLength (const gnSeqI startLength)
Sets the start definition. More...
void SetType (const gnLocationType lt)
Sets the location type. More...
void SetBounds (const gnSeqI start, const gnSeqI startLength, const gnSeqI end, const gnSeqI endLength)
Sets the location's boundaries. More...
void SetBounds (const gnSeqI start, const gnSeqI end)
Sets the location's boundaries. More...
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
Detailed Description
This class is used to store sequence locations.
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 37 of file gnLocation.h .
Member Enumeration Documentation
enum gnLocation::gnLocationType
Enumeration values:
LT_Standard
LT_BetweenBases
LT_Complement
LT_Order
LT_Group
LT_OneOf
LT_Nothing
Definition at line 46 of file gnLocation.h .
enum gnLocation::intersectRestriction
Enumeration values:
determinedRegions
undeterminedRegions
allRegions
Definition at line 40 of file gnLocation.h .
Constructor & Destructor Documentation
gnLocation::gnLocation (
)
gnLocation::gnLocation (
const gnLocation & s )
Copy constructor, copies a gnLocation.
Parameters:
Definition at line 20 of file gnLocation.cpp .
Constructor, creates a gnLocation.
Parameters:
start
The start position within the sequence.
end
The end position within the sequence.
type
The type of the location, LT_Standard by default.
contigName
The name of the contig associated with this location, empty by default.
See also:
gnLocationType
Definition at line 31 of file gnLocation.cpp .
Constructor, creates a gnLocation.
Parameters:
start
The start position within the sequence.
startLength
GNSEQI_END if the starting location is unbounded to the left, 0 if defined, otherwise it specifies a range
end
The end position within the sequence.
endLength
0 if defined, GNSEQI_END if unbounded to the right, otherwise specifies a range
type
The type of the location, LT_Standard by default.
contigName
The name of the contig associated with this location, empty by default.
See also:
gnLocationType
Definition at line 25 of file gnLocation.cpp .
Member Function Documentation
void gnLocation::Clear (
)
gnLocation * gnLocation::Clone (
) const [virtual]
Crops the start location by the specified amount.
Parameters:
start
The amount to crop.
Returns:
True if the location still exists, false if the crop amount is larger than the location.
Definition at line 119 of file gnLocation.cpp .
Referenced by gnBaseFeature::CropStart ().
boolean gnLocation::CropTo (
const gnLocation & l )
Crops this location to fit within the specified location boundaries.
Parameters:
l
The location boundaries.
Returns:
True if the location still exists, false if the crop amount is larger than the location.
Definition at line 72 of file gnLocation.cpp .
Gets the location's boundaries.
Parameters:
s
The start index.
sl
The start length.
e
The end index.
el
The end length.
Definition at line 53 of file gnLocation.cpp .
gnSeqI gnLocation::GetEnd (
) const [inline]
gnSeqI gnLocation::GetEndLength (
) const [inline]
Gets the ending base pair's definition value.
Returns:
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 280 of file gnLocation.h .
gnSeqI gnLocation::GetFirst (
) const [inline]
gnLocation gnLocation::GetIntersection (
const gnLocation & l ,
const intersectRestriction ir ) const
gnSeqI gnLocation::GetLast (
) const [inline]
gnSeqI gnLocation::GetStart (
) const [inline]
gnSeqI gnLocation::GetStartLength (
) const [inline]
Gets the starting base pair's definition value.
Returns:
-1 if the starting location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 296 of file gnLocation.h .
gnLocation gnLocation::GetUnion (
const gnLocation & l ) const
Returns true if the given location intersects this location in the region specified by the parameter "ir".
Parameters:
l
The location to check for intersection.
ir
The region to check for intersection. This can be either determinedRegions, undeterminedRegions, or allRegions
Returns:
True if the location still exists, false if the crop amount is larger than the location.
Definition at line 144 of file gnLocation.cpp .
Referenced by gnBaseFeature::Intersects ().
bool gnLocation::IsEndBoundLonger (
) const [inline]
Returns true if the end is unbounded to the right.
Returns:
True if the end is unbounded to the right.
Definition at line 313 of file gnLocation.h .
Referenced by gnGBKSource::Write ().
bool gnLocation::IsEndBoundShorter (
) const [inline]
Returns true if the end is unbounded to the left.
Returns:
True if the end is unbounded to the left.
Definition at line 323 of file gnLocation.h .
Referenced by gnGBKSource::Write ().
bool gnLocation::IsStartBoundLonger (
) const [inline]
Returns true if the start is unbounded to the right.
Returns:
True if the start is unbounded to the right.
Definition at line 318 of file gnLocation.h .
Referenced by gnGBKSource::Write ().
bool gnLocation::IsStartBoundShorter (
) const [inline]
Returns true if the start is unbounded to the left.
Returns:
True if the start is unbounded to the left.
Definition at line 328 of file gnLocation.h .
Referenced by gnGBKSource::Write ().
boolean gnLocation::MoveTo (
const int direction ,
const gnSeqI diff )
Moves the location start and end.
Parameters:
direction
Negative integer will decrease start and end, positive will increase them.
diff
The amount to move the location start and end.
Definition at line 193 of file gnLocation.cpp .
void gnLocation::SetBounds (
const gnSeqI start ,
const gnSeqI end )
Sets the location's boundaries.
Parameters:
start
The start index.
end
The end index.
Definition at line 66 of file gnLocation.cpp .
Sets the location's boundaries.
Parameters:
start
The start index.
startLength
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
end
The end index.
endLength
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 61 of file gnLocation.cpp .
Referenced by gnLocation ().
void gnLocation::SetEnd (
const gnSeqI end ,
const gnSeqI endLength ) [inline]
Sets the end location and definition.
Parameters:
end
The end location.
endLength
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 339 of file gnLocation.h .
void gnLocation::SetEnd (
const gnSeqI end ) [inline]
void gnLocation::SetEndLength (
const gnSeqI endLength ) [inline]
Sets the end definition.
Parameters:
endLength
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 345 of file gnLocation.h .
void gnLocation::SetStart (
const gnSeqI start ,
const gnSeqI startLength ) [inline]
Sets the start location and definition.
Parameters:
start
The end location.
startLength
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 355 of file gnLocation.h .
void gnLocation::SetStart (
const gnSeqI start ) [inline]
void gnLocation::SetStartLength (
const gnSeqI startLength ) [inline]
Sets the start definition.
Parameters:
startLength
-1 if the ending location is unbounded to the left, 0 if defined, 1 if unbounded to the right
Definition at line 361 of file gnLocation.h .
Sets the location type.
Parameters:
Definition at line 367 of file gnLocation.h .
Member Data Documentation
const gnSeqI gnLocation::Defined = 0 [static]
const gnSeqI gnLocation::Unknown = GNSEQI_END [static]
gnSeqI gnLocation::m_end [private]
gnSeqI gnLocation::m_endLength [private]
string gnLocation::m_name [private]
gnSeqI gnLocation::m_start [private]
gnSeqI gnLocation::m_startLength [private]
The documentation for this class was generated from the following files:
Generated at Fri Nov 30 15:36:55 2001 for libGenome by
1.2.8.1 written by Dimitri van Heesch ,
© 1997-2001