00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CGATOOLS_CGDATA_CNVDETAILSTORE_HPP_
00016 #define CGATOOLS_CGDATA_CNVDETAILSTORE_HPP_ 1
00017
00019
00020 #include "cgatools/core.hpp"
00021 #include "cgatools/reference/RangeAnnotationStore.hpp"
00022 #include "cgatools/cgdata/GenomeMetadata.hpp"
00023
00024 namespace cgatools { namespace cgdata {
00025
00028 struct CnvDetailData
00029 {
00030 double relativeCoverage_;
00031 std::string calledPloidy_;
00032 std::string calledLevel_;
00033 std::string bestLAF_;
00034 std::string lowLAF_;
00035 std::string highLAF_;
00036 };
00037
00039 class CnvDetailStore :
00040 public reference::RangeAnnotationStore<CnvDetailStore, CnvDetailData>
00041 {
00042 public:
00044 CnvDetailStore(const reference::CrrFile& crr, const GenomeMetadata& exp,
00045 bool isDiploid, bool isSomatic)
00046 : Base(crr)
00047 {
00048 if (isDiploid){
00049 if (isSomatic){
00050 load( exp.getCnvDetailsSomaticDiploidFileName() );
00051 } else {
00052 load( exp.getCnvDetailsDiploidFileName() );
00053 }
00054 } else {
00055 if (isSomatic){
00056 load( exp.getCnvDetailsSomaticNondiploidFileName() );
00057 } else {
00058 load( exp.getCnvDetailsNondiploidFileName() );
00059 }
00060 }
00061 if(windowMidpoint_){
00062 trimTree();
00063 }
00064 }
00065
00067 bool hasCalledPloidy() const { return hasCalledPloidy_; }
00068
00070 bool hasCalledLevel() const { return hasCalledLevel_; }
00071
00073 bool hasLAF() const { return hasLAF_; }
00074
00078 const CnvDetailData* getBestOverlappingDetail(const reference::Range& r) const;
00079
00081 void trimTree();
00082
00083 public:
00085 void bindColumns(util::DelimitedFile& df, reference::Range& range, CnvDetailData& data);
00086
00087 private:
00088 bool hasCalledPloidy_;
00089 bool hasCalledLevel_;
00090 bool hasLAF_;
00091 bool windowMidpoint_;
00092 int windowWidth_;
00093 };
00094
00095 }}
00096
00097 #endif