00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CGA_TOOLS_EVIDENCE_SAM_UTIL_HPP_
00016 #define CGA_TOOLS_EVIDENCE_SAM_UTIL_HPP_ 1
00017
00019
00020 #include "cgatools/core.hpp"
00021 #include "cgatools/mapping/SamRecord.hpp"
00022 #include "cgatools/cgdata/EvidenceReader.hpp"
00023
00024 #include <vector>
00025 #include <sstream>
00026 #include <boost/array.hpp>
00027
00028 namespace cgatools { namespace util {
00029 class DelimitedFile;
00030 }};
00031
00032 namespace cgatools { namespace mapping {
00033
00034 class SamSequenceSplitter {
00035 public:
00036 SamSequenceSplitter(const Cigar& extCigar, const std::string& dnbSequence,
00037 const std::string& dnbScore, bool negativeStrand);
00038
00039 Cigar srcExtCigar_;
00040 std::string srcSequence_;
00041 std::string srcScores_;
00042
00043 Cigar cigar_;
00044 std::stringstream sequence_;
00045 std::stringstream scores_;
00046
00047 Cigar tagCigar_;
00048 std::stringstream tagSequence_;
00049 std::stringstream tagScores_;
00050 protected:
00051 void convert();
00052 };
00053
00054 class EvidenceDnbRecord : public cgdata::EvidenceReader::DnbRecord
00055 {
00056 friend std::ostream& operator<< (std::ostream& out, const EvidenceDnbRecord& r);
00057 public:
00058 EvidenceDnbRecord() : mateMappingQuality_(-1)
00059 {}
00060 void initParser(util::DelimitedFile &delimitedFile, size_t formatVersion,
00061 const reference::CrrFile& crr);
00064 void adjustOffset(int chrLength);
00065
00066 int16_t mateMappingQuality_;
00067 };
00068
00069 class EvidenceCacheDnbRecord;
00070
00071 class EvidenceSamRecord : public SamRecord
00072 {
00073 public:
00074 EvidenceSamRecord(
00075 const EvidenceDnbRecord& evidenceRecord,
00076 bool isPrimary,
00077 uint8_t mate,
00078 size_t halfDnbSize,
00079 const reference::CrrFile& reference
00080 );
00081
00082 EvidenceSamRecord(
00083 const EvidenceCacheDnbRecord& evidenceRecord,
00084 bool isPrimary,
00085 uint8_t mate,
00086 size_t halfDnbSize,
00087 const reference::CrrFile& reference
00088 );
00089
00090 size_t intervalId_;
00091 int alleleIndex_;
00092 double armWeight_;
00093
00094 virtual bool isConsistent() const;
00095 };
00096
00097 } }
00098
00099 #endif // CGA_TOOLS_EVIDENCE_SAM_UTIL_HPP_