FastQ.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _FASTQ_H
00019 #define _FASTQ_H
00020 #include <iostream>
00021 #include <string>
00022 #include <math.h>
00023
00024 class FastQ
00025 {
00026 public:
00027 bool valid;
00028 FastQ()
00029 {
00030 clear();
00031 }
00032 void clear()
00033 {
00034 valid=false;
00035 }
00036 std::string tag;
00037 std::string data;
00038 std::string tag2;
00039 std::string quality;
00040 void read(std::istream &);
00041 void write(std::ostream &);
00042 };
00043
00044 inline std::istream &operator >> (std::istream &stream, FastQ &f)
00045 {
00046 f.read(stream);
00047 return stream;
00048 }
00049
00050 inline std::ostream &operator << (std::ostream &stream, FastQ &f)
00051 {
00052 f.write(stream);
00053 return stream;
00054 }
00055
00056 inline double phred2double(const char& c)
00057 {
00058 double errorProb=pow(10,-double((c-'!'))/10);
00059 return errorProb;
00060 }
00061
00062 #endif