libStatGen Software
1
|
Class for reading/validating a fastq file. More...
#include <FastQFile.h>
Public Member Functions | |
FastQFile (int minReadLength=10, int numPrintableErrors=20) | |
Constructor. More... | |
void | disableMessages () |
Disable messages - do not write to cout. | |
void | enableMessages () |
Enable messages - write to cout. | |
void | disableSeqIDCheck () |
Disable Unique Sequence ID checking (Unique Sequence ID checking is enabled by default). | |
void | enableSeqIDCheck () |
Enable Unique Sequence ID checking. More... | |
void | setMaxErrors (int maxErrors) |
Set the number of errors after which to quit reading/validating a file, defaults to -1. More... | |
FastQStatus::Status | openFile (const char *fileName, BaseAsciiMap::SPACE_TYPE spaceType=BaseAsciiMap::UNKNOWN) |
Open a FastQFile. More... | |
FastQStatus::Status | closeFile () |
Close a FastQFile. | |
bool | isOpen () |
Check to see if the file is open. | |
bool | isEof () |
Check to see if the file is at the end of the file. | |
bool | keepReadingFile () |
Returns whether or not to keep reading the file, it stops reading (false) if eof or there is a problem reading the file. | |
FastQStatus::Status | validateFastQFile (const String &filename, bool printBaseComp, BaseAsciiMap::SPACE_TYPE spaceType, bool printQualAvg=false) |
Validate the specified fastq file. More... | |
FastQStatus::Status | readFastQSequence () |
Read 1 FastQSequence, validating it. | |
Public Sequence Line variables. | |
Keep public variables for a sequence's line so they can be accessed without having to do string copies. | |
String | myRawSequence |
String | mySequenceIdLine |
String | mySequenceIdentifier |
String | myPlusLine |
String | myQualityString |
BaseAsciiMap::SPACE_TYPE | getSpaceType () |
Get the space type used for this file. | |
Class for reading/validating a fastq file.
Definition at line 29 of file FastQFile.h.
FastQFile::FastQFile | ( | int | minReadLength = 10 , |
int | numPrintableErrors = 20 |
||
) |
Constructor.
/param minReadLength The minimum length that a base sequence must be for it to be valid.
numPrintableErrors | The maximum number of errors that should be reported in detail before suppressing the errors. |
Definition at line 30 of file FastQFile.cpp.
void FastQFile::enableSeqIDCheck | ( | ) |
Enable Unique Sequence ID checking.
(Unique Sequence ID checking is enabled by default).
Definition at line 69 of file FastQFile.cpp.
FastQStatus::Status FastQFile::openFile | ( | const char * | fileName, |
BaseAsciiMap::SPACE_TYPE | spaceType = BaseAsciiMap::UNKNOWN |
||
) |
Open a FastQFile.
Use the specified SPACE_TYPE to determine BASE, COLOR, or UNKNOWN.
Definition at line 83 of file FastQFile.cpp.
References closeFile(), FastQStatus::FASTQ_OPEN_ERROR, FastQStatus::FASTQ_SUCCESS, ifopen(), BaseComposition::resetBaseMapType(), and BaseComposition::setBaseMapType().
Referenced by validateFastQFile().
void FastQFile::setMaxErrors | ( | int | maxErrors | ) |
Set the number of errors after which to quit reading/validating a file, defaults to -1.
maxErrors | # of errors before quitting, -1 indicates to not quit until the entire file has been read/validated (default), 0 indicates to quit without reading/validating anything. |
Definition at line 76 of file FastQFile.cpp.
FastQStatus::Status FastQFile::validateFastQFile | ( | const String & | filename, |
bool | printBaseComp, | ||
BaseAsciiMap::SPACE_TYPE | spaceType, | ||
bool | printQualAvg = false |
||
) |
Validate the specified fastq file.
filename | fastq file to be validated. |
printBaseComp | whether or not to print the base composition for the file. true means print it, false means do not. |
spaceType | the spaceType to use for validation - BASE_SPACE, COLOR_SPACE, or UNKNOWN (UNKNOWN means to determine the spaceType to validate against from the first character of the first sequence). |
printQualAvg | whether or not to print the quality averages for the file. true means to print it, false (default) means do not. |
Definition at line 195 of file FastQFile.cpp.
References closeFile(), FastQStatus::FASTQ_INVALID, FastQStatus::FASTQ_NO_SEQUENCE_ERROR, FastQStatus::FASTQ_OPEN_ERROR, FastQStatus::FASTQ_SUCCESS, keepReadingFile(), openFile(), BaseComposition::print(), and readFastQSequence().