|
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. | |
| 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. | |
| void | interleaved () |
| Interleaved. | |
| void | setMaxErrors (int maxErrors) |
| Set the number of errors after which to quit reading/validating a file, defaults to -1. | |
| FastQStatus::Status | openFile (const char *fileName, BaseAsciiMap::SPACE_TYPE spaceType=BaseAsciiMap::UNKNOWN) |
| Open a FastQFile. | |
| 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. | |
| 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.
| FastQStatus::Status FastQFile::closeFile | ( | ) |
Close a FastQFile.
Definition at line 134 of file FastQFile.cpp.
References FastQStatus::FASTQ_CLOSE_ERROR, FastQStatus::FASTQ_SUCCESS, and ifclose().
Referenced by openFile(), and validateFastQFile().
| void FastQFile::disableMessages | ( | ) |
Disable messages - do not write to cout.
Definition at line 49 of file FastQFile.cpp.
| void FastQFile::disableSeqIDCheck | ( | ) |
Disable Unique Sequence ID checking (Unique Sequence ID checking is enabled by default).
Definition at line 63 of file FastQFile.cpp.
| void FastQFile::enableMessages | ( | ) |
Enable messages - write to cout.
Definition at line 55 of file FastQFile.cpp.
| void FastQFile::enableSeqIDCheck | ( | ) |
Enable Unique Sequence ID checking.
(Unique Sequence ID checking is enabled by default).
Definition at line 71 of file FastQFile.cpp.
|
inline |
Get the space type used for this file.
Definition at line 114 of file FastQFile.h.
References BaseComposition::getSpaceType().
| void FastQFile::interleaved | ( | ) |
| bool FastQFile::isEof | ( | ) |
Check to see if the file is at the end of the file.
Definition at line 177 of file FastQFile.cpp.
References ifeof().
Referenced by keepReadingFile().
| bool FastQFile::isOpen | ( | ) |
Check to see if the file is open.
Definition at line 162 of file FastQFile.cpp.
References InputFile::isOpen().
Referenced by readFastQSequence().
| bool FastQFile::keepReadingFile | ( | ) |
Returns whether or not to keep reading the file, it stops reading (false) if eof or there is a problem reading the file.
Definition at line 193 of file FastQFile.cpp.
References isEof().
Referenced by validateFastQFile().
| 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 92 of file FastQFile.cpp.
References closeFile(), FastQStatus::FASTQ_OPEN_ERROR, FastQStatus::FASTQ_SUCCESS, ifopen(), BaseComposition::resetBaseMapType(), and BaseComposition::setBaseMapType().
Referenced by validateFastQFile().
| FastQStatus::Status FastQFile::readFastQSequence | ( | ) |
Read 1 FastQSequence, validating it.
Definition at line 309 of file FastQFile.cpp.
References FastQStatus::FASTQ_INVALID, FastQStatus::FASTQ_NO_SEQUENCE_ERROR, FastQStatus::FASTQ_ORDER_ERROR, FastQStatus::FASTQ_READ_ERROR, FastQStatus::FASTQ_SUCCESS, ifeof(), and isOpen().
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 85 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 204 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().
| String FastQFile::myPlusLine |
Definition at line 109 of file FastQFile.h.
| String FastQFile::myQualityString |
Definition at line 110 of file FastQFile.h.
| String FastQFile::myRawSequence |
Definition at line 106 of file FastQFile.h.
| String FastQFile::mySequenceIdentifier |
Definition at line 108 of file FastQFile.h.
| String FastQFile::mySequenceIdLine |
Definition at line 107 of file FastQFile.h.