gnFragmentSpec Class Reference

gnFragmentSpec contains a list of specs which make up a sequence fragment. More...

#include <gnFragmentSpec.h>

Inheritance diagram for gnFragmentSpec:

Inheritance graph
[legend]
Collaboration diagram for gnFragmentSpec:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual uint32 AddFeature (gnBaseFeature *feat)
 Add a feature to this spec.
virtual void Clear ()
 Clears all data from this spec.
virtual gnFragmentSpecClone () const
virtual gnFragmentSpecCloneRange (const gnSeqI startI, const gnSeqI len) const
 Copies a specified range of bases and returns a pointer to the resulting gnFragmentSpec.
virtual void CropEnd (gnSeqI cropLen)
 Crop the last cropLen bases from the sequence.
virtual void CropStart (gnSeqI cropLen)
 Crop the first cropLen bases from the sequence.
virtual void GetBrokenFeatures (const gnLocation &lt, vector< gnBaseFeature * > &feature_vector) const
 Creates a list of features which may have been broken by an edit.
virtual void GetContainedFeatures (const gnLocation &lt, vector< gnBaseFeature * > &feature_vector, vector< uint32 > &index_vector) const
 Creates a list of all features which are contained by coordinates specified.
virtual gnBaseFeatureGetFeature (const uint32 i) const
 Get the feature at index i in the list of features.
virtual uint32 GetFeatureListLength () const
 Returns the number of features this spec contains.
virtual void GetIntersectingFeatures (const gnLocation &lt, vector< gnBaseFeature * > &feature_vector, vector< uint32 > &index_vector) const
 Creates a list of all features which intersect the coordinates specified.
 gnFragmentSpec (const gnFragmentSpec &s)
 Copy constructor.
 gnFragmentSpec ()
virtual void RemoveFeature (const uint32 i)
 Remove a feature from this spec.
virtual void SetReverseComplement (const boolean value)
 Sets the reverse complement bit for this spec.
virtual ~gnFragmentSpec ()
 Destructor, frees memory.

Protected Attributes

vector< gnBaseFeature * > m_featureList

Detailed Description

gnFragmentSpec contains a list of specs which make up a sequence fragment.

It also contains a list of features which relate to the sequence fragment. Finally it contains a list of sequence related header data. This class is usually created and filled by a file reader class like gnGBKSource.

Definition at line 34 of file gnFragmentSpec.h.


Constructor & Destructor Documentation

gnFragmentSpec::gnFragmentSpec  ) 
 

Definition at line 16 of file gnFragmentSpec.cpp.

References gnBaseSpec::Clear().

Referenced by Clone(), and CloneRange().

gnFragmentSpec::~gnFragmentSpec  )  [virtual]
 

Destructor, frees memory.

Definition at line 44 of file gnFragmentSpec.cpp.

References Clear().

gnFragmentSpec::gnFragmentSpec const gnFragmentSpec s  ) 
 

Copy constructor.

Parameters:
s the gnGenomeSpec to copy.
Definition at line 21 of file gnFragmentSpec.cpp.

References gnBaseSpec::m_circular, m_featureList, gnMultiSpec< SubSpec >::m_headerList, gnBaseSpec::m_name, gnBaseSpec::m_reverseComplement, gnMultiSpec< SubSpec >::m_sourceName, gnMultiSpec< SubSpec >::m_SpecList, and uint32.


Member Function Documentation

uint32 gnFragmentSpec::AddFeature gnBaseFeature feat  )  [inline, virtual]
 

Add a feature to this spec.

Parameters:
feat The feature to add.
Returns:
True if successful

Reimplemented from gnMultiSpec< gnContigSpec >.

Definition at line 125 of file gnFragmentSpec.h.

References m_featureList, gnBaseFeature::SetSpec(), and uint32.

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

void gnFragmentSpec::Clear  )  [virtual]
 

Clears all data from this spec.

Reimplemented from gnMultiSpec< gnContigSpec >.

Definition at line 50 of file gnFragmentSpec.cpp.

References gnMultiSpec< SubSpec >::Clear(), m_featureList, and uint32.

Referenced by ~gnFragmentSpec().

gnFragmentSpec * gnFragmentSpec::Clone  )  const [inline, virtual]
 

Implements gnMultiSpec< gnContigSpec >.

Definition at line 87 of file gnFragmentSpec.h.

References gnFragmentSpec().

Referenced by CloneRange(), GetBrokenFeatures(), GetContainedFeatures(), GetIntersectingFeatures(), gnSequence::gnSequence(), and gnSequence::insert().

gnFragmentSpec * gnFragmentSpec::CloneRange const gnSeqI  startI,
const gnSeqI  len
const [virtual]
 

Copies a specified range of bases and returns a pointer to the resulting gnFragmentSpec.

You must delete the copy when you are finished with it.

Parameters:
startI The first base pair to copy
len The length of the piece to copy
Returns:
A copy of the gnFragmentSpec containing only the specified bases

Implements gnBaseSpec.

Definition at line 102 of file gnFragmentSpec.cpp.

References gnMultiSpec< SubSpec >::AddSpec(), Clone(), gnContigSpec::CloneRange(), GetIntersectingFeatures(), gnContigSpec::GetLength(), gnMultiSpec< gnContigSpec >::GetLength(), gnMultiSpec< gnContigSpec >::GetSpec(), gnMultiSpec< gnContigSpec >::GetSpecIndexByBase(), gnMultiSpec< gnContigSpec >::GetSpecListLength(), gnMultiSpec< gnContigSpec >::GetSpecStartBase(), gnFragmentSpec(), gnSeqI, GNSEQI_END, m_featureList, gnLocation::SetEnd(), gnLocation::SetStart(), and uint32.

Referenced by gnGenomeSpec::CloneRange().

void gnFragmentSpec::CropEnd gnSeqI  cropLen  )  [virtual]
 

Crop the last cropLen bases from the sequence.

CropEnd will delete features and headers associated with the cropped bases.

Parameters:
cropLen The number of base pairs to delete from the end.

Reimplemented from gnMultiSpec< gnContigSpec >.

Definition at line 94 of file gnFragmentSpec.cpp.

References gnMultiSpec< SubSpec >::CropEnd(), gnSeqI, m_featureList, and uint32.

void gnFragmentSpec::CropStart gnSeqI  cropLen  )  [virtual]
 

Crop the first cropLen bases from the sequence.

CropStart will delete features and headers associated with the cropped bases.

Parameters:
cropLen The number of base pairs to delete from the beginning.

Reimplemented from gnMultiSpec< gnContigSpec >.

Definition at line 86 of file gnFragmentSpec.cpp.

References gnMultiSpec< SubSpec >::CropStart(), gnSeqI, m_featureList, and uint32.

void gnFragmentSpec::GetBrokenFeatures const gnLocation lt,
vector< gnBaseFeature * > &  feature_vector
const [virtual]
 

Creates a list of features which may have been broken by an edit.

Parameters:
lt The coordinates containing the features to return.
feature_vector The vector to store features in.

Implements gnMultiSpec< gnContigSpec >.

Definition at line 79 of file gnFragmentSpec.cpp.

References Clone(), m_featureList, and uint32.

Referenced by gnGenomeSpec::GetBrokenFeatures().

void gnFragmentSpec::GetContainedFeatures const gnLocation lt,
vector< gnBaseFeature * > &  feature_vector,
vector< uint32 > &  index_vector
const [virtual]
 

Creates a list of all features which are contained by coordinates specified.

Parameters:
lt The coordinates containing the features to return.
feature_vector The vector to store features in.
index_vector A vector of indices which correspond to the features.

Implements gnMultiSpec< gnContigSpec >.

Definition at line 63 of file gnFragmentSpec.cpp.

References Clone(), m_featureList, and uint32.

Referenced by gnGenomeSpec::GetContainedFeatures().

gnBaseFeature * gnFragmentSpec::GetFeature const uint32  i  )  const [inline, virtual]
 

Get the feature at index i in the list of features.

Parameters:
i The index of the feature
Returns:
The feature.

Implements gnMultiSpec< gnContigSpec >.

Definition at line 137 of file gnFragmentSpec.h.

References m_featureList, and uint32.

Referenced by gnGenomeSpec::GetFeature(), and gnGBKSource::Write().

uint32 gnFragmentSpec::GetFeatureListLength  )  const [inline, virtual]
 

Returns the number of features this spec contains.

Returns:
The number of features this spec contains.

Implements gnMultiSpec< gnContigSpec >.

Definition at line 132 of file gnFragmentSpec.h.

References m_featureList, and uint32.

Referenced by gnGenomeSpec::AddFeature(), gnGenomeSpec::GetBrokenFeatures(), gnGenomeSpec::GetContainedFeatures(), gnGenomeSpec::GetFeature(), gnGenomeSpec::GetFeatureListLength(), gnGenomeSpec::GetIntersectingFeatures(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), gnGenomeSpec::RemoveFeature(), and gnGBKSource::Write().

void gnFragmentSpec::GetIntersectingFeatures const gnLocation lt,
vector< gnBaseFeature * > &  feature_vector,
vector< uint32 > &  index_vector
const [virtual]
 

Creates a list of all features which intersect the coordinates specified.

Parameters:
lt The coordinates intersecting the features to return.
feature_vector The vector to store features in.
index_vector A vector of indices which correspond to the features.

Implements gnMultiSpec< gnContigSpec >.

Definition at line 71 of file gnFragmentSpec.cpp.

References Clone(), m_featureList, and uint32.

Referenced by CloneRange(), and gnGenomeSpec::GetIntersectingFeatures().

void gnFragmentSpec::RemoveFeature const uint32  i  )  [inline, virtual]
 

Remove a feature from this spec.

Parameters:
i The index of the feature to remove.
Returns:
True if successful

Implements gnMultiSpec< gnContigSpec >.

Definition at line 142 of file gnFragmentSpec.h.

References m_featureList, Throw_gnEx, and uint32.

Referenced by gnGenomeSpec::RemoveFeature().

void gnFragmentSpec::SetReverseComplement const boolean  value  )  [virtual]
 

Sets the reverse complement bit for this spec.

Parameters:
value True for reverse complement, false otherwise.

Implements gnBaseSpec.

Definition at line 154 of file gnFragmentSpec.cpp.

References gnMultiSpec< gnContigSpec >::GetSpec(), gnMultiSpec< gnContigSpec >::GetSpecListLength(), gnBaseSpec::IsReverseComplement(), gnContigSpec::SetReverseComplement(), and uint32.

Referenced by gnSequence::setReverseComplement(), and gnGenomeSpec::SetReverseComplement().


Member Data Documentation

vector<gnBaseFeature*> gnFragmentSpec::m_featureList [protected]
 

Definition at line 82 of file gnFragmentSpec.h.

Referenced by AddFeature(), Clear(), CloneRange(), CropEnd(), CropStart(), GetBrokenFeatures(), GetContainedFeatures(), GetFeature(), GetFeatureListLength(), GetIntersectingFeatures(), gnFragmentSpec(), and RemoveFeature().


The documentation for this class was generated from the following files:
Generated on Mon Feb 14 19:29:52 2005 for libGenome by doxygen 1.3.8