GVecDelimited Class Reference

Inheritance diagram for GVecDelimited:
GVec

List of all members.

Classes

class  DelimitedRecord
class  DoubleField
class  Field
class  IntField
class  LongField
class  StringField

Public Member Functions

 GVecDelimited (QString, map< int, GVec::ftype >, GVec *parent=0, QString feature="Delimited File", int column=-1)
GVecDelimited::DelimitedRecordat (size_t)
long get_start (size_t)
long get_stop (size_t)
real get_score (size_t)
string get_info (size_t)
map< int, GVec::ftype > get_column_types ()
Fieldfield_factory (string, GVec::ftype)
void push_back (int, string, long, long, GVecDelimited::Field *)
void push_back_comment (string)
GVec::ftype get_column_type (int)
GVec::ftype get_column_type ()
bool has_text ()
void set_has_text (bool)
bool has_stop_position ()
double max ()
double min ()
GVec::vtype get_type ()

Member Function Documentation

GVecDelimited::DelimitedRecord * GVecDelimited::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.

string GVecDelimited::get_info ( size_t  i  )  [virtual]

Returns a formatted string representation of the record, for instance, that might be displayed when a user clicks on the records glyph.

Parameters:
size_t i the index in the current focus's vector of records
Returns:
string representation of the record, formated for display
See also:
GVec::at( size_t i )

Reimplemented from GVec.

real GVecDelimited::get_score ( size_t  i  )  [virtual]

Returns the score associated with the record at the argument for the current focus. Of course, not all GVec's have scores. An assumption has been made that scored data and scoreless data (like many annotations) will not be in the same GVec; one can use the GVec::has_score( ) method to check if the GVec object is associated with scores.

Parameters:
size_t i the index in the current focus's vector of records
Returns:
the record's score
See also:
GVec::at( size_t i ), GVec::has_score( )

Reimplemented from GVec.

long GVecDelimited::get_start ( size_t  i  )  [virtual]

Returns the base pair start position for the record at the argument for the current focus.

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

Reimplemented from GVec.

long GVecDelimited::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 GVecDelimited::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.

bool GVecDelimited::has_stop_position (  )  [virtual]

Does this GVec have records that contain a stop position? All records have a start position, but some (an annotation for instance) span a segment of the sequence up to and including the stop position. In the latter case, this returns true.

Reimplemented from GVec.

bool GVecDelimited::has_text (  )  [virtual]

Do the records in this GVec contain text, for instance, an annotation name. This is determined by the Reader.

Reimplemented from GVec.

double GVecDelimited::max (  )  [virtual]

For each sequence focus, the maximum score across all records is tracked. This method returns that value for the current sequence focus.

Returns:
max score record for current sequence focus

Reimplemented from GVec.

double GVecDelimited::min (  )  [virtual]

For each sequence focus, the minimum score across all records is tracked. This method returns that value for the current sequence focus.

Returns:
min score record for current sequence focus

Reimplemented from GVec.

void GVecDelimited::push_back_comment ( string  comment  ) 

If a Reader is tracking comment lines in a file, it can use this method to store them in the GVec, although currently the storage is pretty rough... just pushed back onto a vector in the order in which they're sent.

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