GVecFasta Class Reference

Inheritance diagram for GVecFasta:
GVec

List of all members.

Classes

class  FastaRecord

Public Member Functions

 GVecFasta (QString, GVec *parent=0)
GVec::vtype get_type ()
map< const QString, vector
< QString > * > 
get_comments ()
void push_back (string, long, long, vector< char > *, map< string, string > *)
FastaRecordat (size_t)
long get_stop (size_t)
long get_longest_feature ()
string get_sequence (long, long)
bool has_sequence ()

Member Function Documentation

GVecFasta::FastaRecord * GVecFasta::at ( size_t  i  )  [virtual]

This method functions somewhat like its namesake in std::vector and similar. However, remember that a GVec is actually a map or record vectors organized by sequence focus. So, this "at" returns the value at the index argument for the current focus.

In general, one should consider using methods like get_start( i ), get_stop( i ), get_score( i ), etc.. which will look up the record at that argument and return the requested information without the caller having to handle GVec::Record objects.

Finally, the method does not fail safe if i is outside of the vector's range. It's up to the programmer to check the length of the vector via the GVec::length( ) method.

Parameters:
size_t i the index of the desired record for the current focus
Returns:
a GVec::Record*
See also:
GVec::get_start( size_t i ), GVec::get_stop( size_t i ), GVec::get_score( size_t i ), GVec::set_focus( QString new_focus ), GVec::get_focus( ), GVec::length( ), etc...

Reimplemented from GVec.

map< const QString, vector< QString > * > GVecFasta::get_comments (  ) 

Returns a list of comments from the source file in the order in which they were encountered... assuming the reading class kept track of comments.

Returns:
a vector of comment lines from the source file

Reimplemented from GVec.

long GVecFasta::get_longest_feature (  )  [virtual]

For each sequence focus, the length of the longest record is tracked. This is useful for the ui in determining the start of the left hand search point that guarantees that the end of the longest record (and any other shorter records) are drawn onto the screen (left hand px coordinate minus px length of longest feature). The value here is returned in units of base pairs; it's up to the ui to convert that to pixels.

Reimplemented from GVec.

long GVecFasta::get_stop ( size_t  i  )  [virtual]

Returns the base pair stop position for the record at the argument for the current focus. The records handled in this base GVec class are all associated with a single base pair locus; therefore, the start position and stop position are the same.

Parameters:
size_t i the index in the current focus's vector of records
Returns:
the base pair position where the record stops
See also:
GVec::at( size_t i )

Reimplemented from GVec.

GVec::vtype GVecFasta::get_type (  )  [virtual]

Sometimes it's important to know what class type of GVec on is working with, for instance, when choosing a graph type to match. This method was included to help avoid casting (dynamic or otherwise) and returns the value of the GVec::vtype enum defined in GVec. Of course, this only works if a GVec inheriting class actually creates a new enum type and implements this method-- it's not required too!

So, this is just a convenience and certainly not as reliable as explicitly checking a GVec's type, for instance, with a dynamic cast.

Here the value UNKNOWN is always returned.

Reimplemented from GVec.


The documentation for this class was generated from the following files:
 All Classes Functions

Generated on Thu Sep 17 15:19:42 2009 for BQGB by  doxygen 1.6.1