gnBaseFeature Class Reference

Features of DNA sequences can be accessed and manipulated using classes derived from gnBaseFeature. More...

#include <gnBaseFeature.h>

Inheritance diagram for gnBaseFeature:

Inheritance graph
[legend]
Collaboration diagram for gnBaseFeature:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual boolean AddLocation (const gnLocation &l, uint32 listI=0)
 Adds a new location before the location at listI.

virtual boolean AddQualifier (gnBaseQualifier *qualifier)
 Adds a new qualifier.

virtual gnBaseFeatureClone () const=0
virtual boolean Contains (gnBaseFeature *feature) const
 Checks if the given feature is entirely contained by this feature.

virtual boolean Contains (const gnLocation &l) const
 Checks if the given location is contained by this feature.

virtual boolean Contains (gnSeqI i) const
 Checks if the given coordinate is contained by this feature.

virtual boolean Crop (const gnLocation &l)
 Crops the locations of this feature to fit within the given location.

virtual boolean CropEnd (const gnSeqI i)
 Crops the end locations of this feature by the specified amount.

virtual boolean CropStart (const gnSeqI i)
 Crops the start locations of this feature by the specified amount.

virtual uint32 FirstIndexOfQualifier (const string &name, uint32 listI) const
 Searches for a qualifier by name, starting at the index listI.

virtual uint32 GetID () const
 Gets this feature's ID.

virtual gnLocation GetLocation (uint32 listI) const
 Gets the location at listI.

virtual uint32 GetLocationListLength () const
 Returns the number of locations this feature describes.

virtual gnLocation::gnLocationType GetLocationType () const
 Gets this feature's location type.

virtual string GetName () const
 Gets the feature name (e.g.

virtual gnBaseQualifierGetQualifier (uint32 listI)
 Gets the qualifier at the list index listI.

virtual uint32 GetQualifierListLength () const
 Returns the number of qualifiers in this feature.

virtual string GetQualifierName (uint32 listI) const
 Gets the name of the qualifier at the list index listI.

virtual string GetQualifierValue (uint32 listI) const
 Gets the value of the qualifier at the list index listI.

virtual gnFragmentSpecGetSpec () const
 Gets the gnFragmentSpec to which this feature refers.

 gnBaseFeature (string &name, uint32 id=0, gnFragmentSpec *spec=NULL, gnLocation::gnLocationType lt=gnLocation::LT_Nothing, boolean broken=false)
 gnBaseFeature ()
virtual boolean HasQualifier (const string &name) const
 Looks for a qualifier by name.

virtual boolean Intersects (gnBaseFeature *feature) const
 Checks if the given feature intersects this feature.

virtual boolean Intersects (const gnLocation &l) const
 Checks if the given location intersects this feature.

virtual boolean IsBroken () const
 Returns true if the feature is broken.

virtual boolean IsContainedBy (const gnLocation &l) const
 Checks if this feature is entirely contained by the given location.

virtual uint32 LastIndexOfQualifier (const string &name, uint32 listI) const
 Searches for a qualifier by name, ending at the index listI.

virtual boolean MoveNegative (const gnSeqI i)
 Decreases this feature's coordinates by a specific number of bases.

virtual boolean MovePositive (const gnSeqI i)
 Increases this feature's coordinates by a specific number of bases.

virtual boolean RemoveLocation (uint32 listI)
 Deletes the location at listI.

virtual boolean RemoveQualifier (uint32 listI)
 Deletes the qualifier at the list index listI.

virtual void SetBroken (boolean broke)
 Sets whether the feature is broken or not.

virtual void SetID (uint32 id)
 Sets this feature's ID.

virtual boolean SetLocation (const gnLocation &l, uint32 listI)
 Sets the location at listI to a new location.

virtual void SetLocationType (gnLocation::gnLocationType lType)
 Sets this feature's location type.

virtual void SetName (const string &name)
 Sets the feature name.

virtual boolean SetQualifier (string &name, string &value, uint32 listI)
 Set the name and value of the qualifier at the list index listI.

virtual boolean SetQualifierName (string &name, uint32 listI)
 Set the name of the qualifier at the list index listI.

virtual boolean SetQualifierValue (string &value, uint32 listI)
 Set the value of the qualifier at the list index listI.

virtual void SetSpec (gnFragmentSpec *spec)
 Sets the gnFragmentSpec to which this feature refers.

 ~gnBaseFeature ()
 Destructor, frees memory.


Protected Attributes

boolean m_broken
uint32 m_id
vector< gnLocationm_locationList
gnLocation::gnLocationType m_locationType
string m_name
vector< gnBaseQualifier * > m_qualifierList
gnFragmentSpecm_spec

Detailed Description

Features of DNA sequences can be accessed and manipulated using classes derived from gnBaseFeature.

gnBaseFeature outlines a basic interface and gives functionality its derived sequence classes, such as gnCDSFeature.

Definition at line 30 of file gnBaseFeature.h.


Constructor & Destructor Documentation

gnBaseFeature::gnBaseFeature  ) 
 

Definition at line 18 of file gnBaseFeature.cpp.

References m_broken, m_id, m_locationType, and m_name.

gnBaseFeature::gnBaseFeature string &  name,
uint32  id = 0,
gnFragmentSpec spec = NULL,
gnLocation::gnLocationType  lt = gnLocation::LT_Nothing,
boolean  broken = false
 

Definition at line 26 of file gnBaseFeature.cpp.

References m_broken, m_id, m_locationType, m_name, and uint32.

gnBaseFeature::~gnBaseFeature  ) 
 

Destructor, frees memory.

Definition at line 34 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.


Member Function Documentation

boolean gnBaseFeature::AddLocation const gnLocation l,
uint32  listI = 0
[inline, virtual]
 

Adds a new location before the location at listI.

Parameters:
l The gnLocation to add.
listI The index into the location list to insert before.
Returns:
True if successful, false otherwise.
See also:
gnLocation

Definition at line 186 of file gnBaseFeature.cpp.

References m_locationList, and uint32.

Referenced by gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

boolean gnBaseFeature::AddQualifier gnBaseQualifier qualifier  )  [virtual]
 

Adds a new qualifier.

Parameters:
qualifier The qualifier to add.
Returns:
True if successful, false otherwise.

Definition at line 216 of file gnBaseFeature.cpp.

References m_qualifierList.

Referenced by gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

virtual gnBaseFeature* gnBaseFeature::Clone  )  const [pure virtual]
 

Implements gnClone.

Implemented in gnFeature.

boolean gnBaseFeature::Contains gnBaseFeature feature  )  const [virtual]
 

Checks if the given feature is entirely contained by this feature.

Parameters:
feature The feature to check
Returns:
True if "feature" is contained by this feature. False otherwise

Definition at line 146 of file gnBaseFeature.cpp.

References GetLocation(), GetLocationListLength(), m_locationList, and uint32.

boolean gnBaseFeature::Contains const gnLocation l  )  const [virtual]
 

Checks if the given location is contained by this feature.

Parameters:
l The location to check
Returns:
True if "l" is contained by this feature. False otherwise

Definition at line 139 of file gnBaseFeature.cpp.

References m_locationList, and uint32.

boolean gnBaseFeature::Contains gnSeqI  i  )  const [virtual]
 

Checks if the given coordinate is contained by this feature.

Parameters:
i The coordinate to check
Returns:
True if "i" is contained by this feature. False otherwise

Definition at line 131 of file gnBaseFeature.cpp.

References gnSeqI, m_locationList, and uint32.

boolean gnBaseFeature::Crop const gnLocation l  )  [inline, virtual]
 

Crops the locations of this feature to fit within the given location.

Parameters:
l The location to crop reduce to.
Returns:
True if successful, false if the feature was broken by the change.

Definition at line 328 of file gnBaseFeature.h.

References CropEnd(), CropStart(), gnLocation::GetEnd(), and gnLocation::GetStart().

boolean gnBaseFeature::CropEnd const gnSeqI  i  )  [virtual]
 

Crops the end locations of this feature by the specified amount.

Parameters:
i The amount to crop.
Returns:
True if successful, false if the feature was broken by the change.

Definition at line 58 of file gnBaseFeature.cpp.

References gnSeqI, m_locationList, and uint32.

Referenced by Crop().

boolean gnBaseFeature::CropStart const gnSeqI  i  )  [virtual]
 

Crops the start locations of this feature by the specified amount.

Parameters:
i The amount to crop.
Returns:
True if successful, false if the feature was broken by the change.

Definition at line 67 of file gnBaseFeature.cpp.

References gnSeqI, m_locationList, and uint32.

Referenced by Crop().

uint32 gnBaseFeature::FirstIndexOfQualifier const string &  name,
uint32  listI
const [virtual]
 

Searches for a qualifier by name, starting at the index listI.

Parameters:
name The name of the qualifier to look for.
listI The index into the qualifier list to start the search at.
Returns:
The index of the qualifier.

Definition at line 74 of file gnBaseFeature.cpp.

References GNSEQI_END, m_qualifierList, and uint32.

uint32 gnBaseFeature::GetID  )  const [inline, virtual]
 

Gets this feature's ID.

Returns:
The feature's ID.

Definition at line 291 of file gnBaseFeature.h.

References m_id, and uint32.

gnLocation gnBaseFeature::GetLocation uint32  listI  )  const [virtual]
 

Gets the location at listI.

Parameters:
listI The index into the location list to get.
Returns:
The location.

Definition at line 194 of file gnBaseFeature.cpp.

References m_locationList, and uint32.

Referenced by Contains(), Intersects(), main(), and gnGBKSource::Write().

uint32 gnBaseFeature::GetLocationListLength  )  const [inline, virtual]
 

Returns the number of locations this feature describes.

Returns:
The number of locations this feature describes.

Definition at line 324 of file gnBaseFeature.h.

References m_locationList, and uint32.

Referenced by Contains(), Intersects(), main(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), and gnGBKSource::Write().

gnLocation::gnLocationType gnBaseFeature::GetLocationType  )  const [inline, virtual]
 

Gets this feature's location type.

Returns:
The feature's location type.
See also:
gnLocationType

Definition at line 316 of file gnBaseFeature.h.

References m_locationType.

Referenced by gnGBKSource::Write().

string gnBaseFeature::GetName  )  const [inline, virtual]
 

Gets the feature name (e.g.

CDS, trna...).

Returns:
The feature name.

Definition at line 283 of file gnBaseFeature.h.

References m_name.

Referenced by main(), print_feature(), SetQualifierValue(), and gnGBKSource::Write().

gnBaseQualifier * gnBaseFeature::GetQualifier uint32  listI  )  [virtual]
 

Gets the qualifier at the list index listI.

Parameters:
listI The index into the qualifier list.
Returns:
The qualifier.

Definition at line 243 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

Referenced by gnGBKSource::Write().

uint32 gnBaseFeature::GetQualifierListLength  )  const [inline, virtual]
 

Returns the number of qualifiers in this feature.

Returns:
The number of qualifiers in this feature.

Definition at line 332 of file gnBaseFeature.h.

References m_qualifierList, and uint32.

Referenced by print_feature(), and gnGBKSource::Write().

string gnBaseFeature::GetQualifierName uint32  listI  )  const [virtual]
 

Gets the name of the qualifier at the list index listI.

Parameters:
listI The index into the qualifier list.
Returns:
The name of the qualifier.

Definition at line 231 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

Referenced by print_feature().

string gnBaseFeature::GetQualifierValue uint32  listI  )  const [virtual]
 

Gets the value of the qualifier at the list index listI.

Parameters:
listI The index into the qualifier list.
Returns:
The value of the qualifier.

Definition at line 237 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

Referenced by print_feature().

gnFragmentSpec * gnBaseFeature::GetSpec  )  const [inline, virtual]
 

Gets the gnFragmentSpec to which this feature refers.

Returns:
The feature's ID.
See also:
gnFragmentSpec

Definition at line 299 of file gnBaseFeature.h.

boolean gnBaseFeature::HasQualifier const string &  name  )  const [virtual]
 

Looks for a qualifier by name.

Parameters:
name The name of the qualifier to look for.
Returns:
True if a qualifier was found, false otherwise.

Definition at line 224 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

boolean gnBaseFeature::Intersects gnBaseFeature feature  )  const [virtual]
 

Checks if the given feature intersects this feature.

Parameters:
feature The location to check
Returns:
True if "feature" intersects this feature. False otherwise

Definition at line 173 of file gnBaseFeature.cpp.

References GetLocation(), GetLocationListLength(), m_locationList, and uint32.

boolean gnBaseFeature::Intersects const gnLocation l  )  const [virtual]
 

Checks if the given location intersects this feature.

Parameters:
l The location to check
Returns:
True if "l" intersects this feature. False otherwise

Definition at line 166 of file gnBaseFeature.cpp.

References gnLocation::Intersects(), m_locationList, and uint32.

boolean gnBaseFeature::IsBroken  )  const [inline, virtual]
 

Returns true if the feature is broken.

Returns:
True if the feature is broken

Definition at line 307 of file gnBaseFeature.h.

References m_broken.

boolean gnBaseFeature::IsContainedBy const gnLocation l  )  const [virtual]
 

Checks if this feature is entirely contained by the given location.

Parameters:
l The location to check
Returns:
True if "l" contains by this feature. False otherwise

Definition at line 158 of file gnBaseFeature.cpp.

References gnLocation::Contains(), m_locationList, and uint32.

Referenced by gnGenomeSpec::AddFeature().

uint32 gnBaseFeature::LastIndexOfQualifier const string &  name,
uint32  listI
const [virtual]
 

Searches for a qualifier by name, ending at the index listI.

Parameters:
name The name of the qualifier to look for.
listI The index into the qualifier list to end the search at.
Returns:
The index of the qualifier.

Definition at line 86 of file gnBaseFeature.cpp.

References GNSEQI_END, m_qualifierList, and uint32.

boolean gnBaseFeature::MoveNegative const gnSeqI  i  )  [virtual]
 

Decreases this feature's coordinates by a specific number of bases.

Parameters:
i The number of bases to decrease by.
Returns:
True if successful, false if the feature was broken by the change.

Definition at line 49 of file gnBaseFeature.cpp.

References gnSeqI, m_locationList, and uint32.

boolean gnBaseFeature::MovePositive const gnSeqI  i  )  [virtual]
 

Increases this feature's coordinates by a specific number of bases.

Parameters:
i The number of bases to increase by.
Returns:
True if successful, false if the feature was broken by the change.

Definition at line 41 of file gnBaseFeature.cpp.

References gnSeqI, m_locationList, and uint32.

Referenced by gnGenomeSpec::GetFeature().

boolean gnBaseFeature::RemoveLocation uint32  listI  )  [virtual]
 

Deletes the location at listI.

Parameters:
listI The index into the location list to delete.
Returns:
True if successful, false otherwise.

Definition at line 200 of file gnBaseFeature.cpp.

References m_locationList, and uint32.

boolean gnBaseFeature::RemoveQualifier uint32  listI  )  [virtual]
 

Deletes the qualifier at the list index listI.

Parameters:
listI The index into the qualifier list.
Returns:
True if successful, false otherwise.

Definition at line 96 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

void gnBaseFeature::SetBroken boolean  broke  )  [inline, virtual]
 

Sets whether the feature is broken or not.

Parameters:
broke True if the feature should be broken, false otherwise

Definition at line 311 of file gnBaseFeature.h.

References m_broken.

void gnBaseFeature::SetID uint32  id  )  [inline, virtual]
 

Sets this feature's ID.

Parameters:
id The feature's ID.

Definition at line 295 of file gnBaseFeature.h.

References m_id, and uint32.

boolean gnBaseFeature::SetLocation const gnLocation l,
uint32  listI
[virtual]
 

Sets the location at listI to a new location.

Parameters:
l The new location
listI The index into the location list to set.
Returns:
True if successful, false otherwise.

Definition at line 208 of file gnBaseFeature.cpp.

References m_locationList, and uint32.

void gnBaseFeature::SetLocationType gnLocation::gnLocationType  lType  )  [inline, virtual]
 

Sets this feature's location type.

LT_BetweenBases is not a valid feature location type.

Parameters:
lType The feature's location type.
See also:
gnLocationType

Definition at line 320 of file gnBaseFeature.h.

References m_locationType.

Referenced by gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

void gnBaseFeature::SetName const string &  name  )  [inline, virtual]
 

Sets the feature name.

Parameters:
name The feature name.

Definition at line 287 of file gnBaseFeature.h.

References m_name.

boolean gnBaseFeature::SetQualifier string &  name,
string &  value,
uint32  listI
[virtual]
 

Set the name and value of the qualifier at the list index listI.

Parameters:
name The new name of the qualifier.
value The new value of the qualifier.
listI The index into the qualifier list.
Returns:
True if successful, false otherwise.

Definition at line 104 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

boolean gnBaseFeature::SetQualifierName string &  name,
uint32  listI
[virtual]
 

Set the name of the qualifier at the list index listI.

Parameters:
name The new name of the qualifier.
listI The index into the qualifier list.
Returns:
True if successful, false otherwise.

Definition at line 112 of file gnBaseFeature.cpp.

References m_qualifierList, and uint32.

boolean gnBaseFeature::SetQualifierValue string &  value,
uint32  listI
[virtual]
 

Set the value of the qualifier at the list index listI.

Parameters:
value The new value of the qualifier.
listI The index into the qualifier list.
Returns:
True if successful, false otherwise.

Definition at line 121 of file gnBaseFeature.cpp.

References GetName(), m_qualifierList, and uint32.

void gnBaseFeature::SetSpec gnFragmentSpec spec  )  [inline, virtual]
 

Sets the gnFragmentSpec to which this feature refers.

Parameters:
spec A pointer to the fragment spec.

Definition at line 303 of file gnBaseFeature.h.

Referenced by gnFragmentSpec::AddFeature().


Member Data Documentation

boolean gnBaseFeature::m_broken [protected]
 

Definition at line 275 of file gnBaseFeature.h.

Referenced by gnBaseFeature(), gnFeature::gnFeature(), IsBroken(), and SetBroken().

uint32 gnBaseFeature::m_id [protected]
 

Definition at line 273 of file gnBaseFeature.h.

Referenced by GetID(), gnBaseFeature(), gnFeature::gnFeature(), and SetID().

vector< gnLocation > gnBaseFeature::m_locationList [protected]
 

Definition at line 277 of file gnBaseFeature.h.

Referenced by AddLocation(), Contains(), CropEnd(), CropStart(), GetLocation(), GetLocationListLength(), gnFeature::gnFeature(), Intersects(), IsContainedBy(), MoveNegative(), MovePositive(), RemoveLocation(), and SetLocation().

gnLocation::gnLocationType gnBaseFeature::m_locationType [protected]
 

Definition at line 276 of file gnBaseFeature.h.

Referenced by GetLocationType(), gnBaseFeature(), gnFeature::gnFeature(), and SetLocationType().

string gnBaseFeature::m_name [protected]
 

Definition at line 274 of file gnBaseFeature.h.

Referenced by GetName(), gnBaseFeature(), gnFeature::gnFeature(), and SetName().

vector< gnBaseQualifier* > gnBaseFeature::m_qualifierList [protected]
 

Definition at line 278 of file gnBaseFeature.h.

Referenced by AddQualifier(), FirstIndexOfQualifier(), GetQualifier(), GetQualifierListLength(), GetQualifierName(), GetQualifierValue(), gnFeature::gnFeature(), HasQualifier(), LastIndexOfQualifier(), RemoveQualifier(), SetQualifier(), SetQualifierName(), SetQualifierValue(), and ~gnBaseFeature().

gnFragmentSpec* gnBaseFeature::m_spec [protected]
 

Definition at line 279 of file gnBaseFeature.h.

Referenced by gnFeature::gnFeature().


The documentation for this class was generated from the following files:
Generated on Mon Mar 28 06:00:55 2005 for libGenome by doxygen 1.3.6