Slice Tools libSlice |
libSlice::SliceData Class Reference |
Public Types | |
enum | SliceErrorCode |
Error Codes for slices. | |
enum | StringOperation |
Special codes for string operations errrors. | |
Public Member Functions | |
SliceData (const ReadManager &readManager, const char *index, const char *gindex, const char *existing, long sliceRangeIndex=0, long sliceRangeGindex=0) | |
Constructor initializes the slice information. | |
virtual | ~SliceData () |
Deletes the flattened slice. | |
void | addNuc (const char *nucData) |
Appends data to the list of Nuc Data. | |
void | addQualVal (const char *qualVal) |
Appends data to the list of QualVal Data. | |
void | addReadId (const char *readId) |
Appends data to the list of ReadId Data. | |
void | print (ostream &out, const string &prefix="") |
Prints a slice to a specified output stream. | |
void | printError (ostream &out) const |
Prints out the error information from the slice to a given output stream. | |
void | printXML (ostream &out, const string &prefix="") |
Prints a slice to a specified output stream in Slice XML. | |
int | getErrorCode () const |
Gets the internal error code that threw an exception. | |
int | getErrorOperation () const |
Gets the code for the string operation threw the exception. | |
void | setDistributionTable (double freqA, double freqC, double freqG, double freqT, double freqGap) |
Sets the distribution table. | |
void | setHighQualityThreshold (int highQualityThreshold) |
Sets the threshold of high quality for getConsensus and getConsQC. | |
void | setDoAmbiguity (int doAmbiguity) |
Set if consensus and quality class should be based on an ambiguity code. | |
ConsensusData | doCalculations (bool recallEmpty=false) |
Flattens a slice, and calls libSlice to do the quality calculations. | |
unsigned short | getDepth () const |
Returns the depth of coverage based on the number of bases specified. | |
ReadData * | getRead (unsigned short index) const |
Gets ReadId[index]. | |
long | getIndex () const |
Returns the ungapped index of the slice. | |
long | getGindex () const |
Returns the gapped index of the slice. | |
char | getBase (unsigned short index) |
Gets bc[index]. | |
char | getQualVal (unsigned short index) |
Gets qv[index]. | |
char | getConsensus () |
Gets the existing consensus. | |
const string & | getNucData () const |
Gets the complete nuc string set by addNuc. | |
const string & | getQualValData () const |
Gets the complete qualval string set by addQualVal. | |
const string & | getReadIdData () const |
Gets the complete readid string set by addReadId. | |
void | resetIndex (long index, long gindex) |
Resets the index. | |
void | resetReadId () |
Resets the read id data. | |
void | resetQualVal () |
Resets the QualVal data. | |
void | resetNuc () |
Resets the Nuc data. | |
void | setConsensus (char consensus) |
Force the consensus to be a certain value. | |
Static Public Member Functions | |
char | getBaseCompliment (char base) |
Get the compliment of a base or ambiguity code. |
|
Constructor initializes the slice information. The read manager needs to be provided so that reverse compliment flags can be looked up.
Definition at line 23 of file SliceData.cc. |
|
Deletes the flattened slice. If the slice has been flattened into a struct slice, deletes the pointer to that struct and the data fields that are pointers. Definition at line 74 of file SliceData.cc. |
|
Appends data to the list of Nuc Data. Useful because Xerces won't guarantee that all of the character data will come in a single message, which is how Nuc data is specified.
Definition at line 111 of file SliceData.cc. |
|
Appends data to the list of QualVal Data. Useful because Xerces won't guarantee that all of the character data will come in a single message, which is how QualVal data is specified.
Definition at line 120 of file SliceData.cc. |
|
Appends data to the list of ReadId Data. Useful because Xerces won't guarantee that all of the character data will come in a single message, which is how ReadId data is specified
Definition at line 129 of file SliceData.cc. |
|
Flattens a slice, and calls libSlice to do the quality calculations. A new consensus is always calculated before the quality class or quality value is calculated. The new consensus is set to be used as the "Existing" attribute of the XML slice
Definition at line 492 of file SliceData.cc. |
|
Returns the gapped index of the slice. The gapped index is gindex + sliceRangeGindex Definition at line 469 of file SliceData.cc. |
|
Returns the ungapped index of the slice. The ungapped index is index + sliceRangeIndex Definition at line 461 of file SliceData.cc. |
|
Prints a slice to a specified output stream. Flattens the slice first so that the triplet of (base, qv, rc) can be printed for each base. Data is enclosed in <Slice ...> ... </Slice> tags and each base is written as <Base ...> This does not produce valid Slice XML, but shows how the data was actually parsed.
Definition at line 587 of file SliceData.cc. |
|
Prints out the error information from the slice to a given output stream. Before an exception is thrown from SliceData, information is stored in the slice so that the details of the error can be displayed along with all of the other information (if requested) Definition at line 718 of file SliceData.cc. |
|
Prints a slice to a specified output stream in Slice XML. This does produce valid XML. The bases, qualvals, and readids come from the unparsed add* functions. The slice is not flattened Definition at line 617 of file SliceData.cc. |
|
Resets the index. Overwrites the index and gindex provided at construction Useful so a slice can be modified without making a copy Definition at line 689 of file SliceData.cc. |
|
Resets the Nuc data. Truncates the data added with addNuc() Useful so a slice can be modified without making a copy Definition at line 673 of file SliceData.cc. |
|
Resets the QualVal data. Truncates the data added with addQualVal() Useful so a slice can be modified without making a copy Definition at line 657 of file SliceData.cc. |
|
Resets the read id data. Truncates the data added with addReadId() Useful so a slice can be modified without making a copy. Note: Any subsequent attempts to flatten the slice for calculations will potentially fail if the readId values are changed to ones that do not occur in the ReadManager Definition at line 641 of file SliceData.cc. |
|
Sets the distribution table. This is the table used by getConsQV Definition at line 90 of file SliceData.cc. |
|
Set if consensus and quality class should be based on an ambiguity code.
0 means no ambiguity Definition at line 799 of file SliceData.cc. |