00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CGATOOLS_CGDATA_GENOMEMETADATA_HPP_
00016 #define CGATOOLS_CGDATA_GENOMEMETADATA_HPP_ 1
00017
00019
00020 #include "cgatools/core.hpp"
00021 #include <boost/noncopyable.hpp>
00022 #include <boost/filesystem.hpp>
00023 #include <boost/regex.hpp>
00024 #include <boost/array.hpp>
00025
00026 namespace cgatools { namespace cgdata {
00027
00028 class LibraryMetadata
00029 {
00030 public:
00031 typedef boost::array<std::string,2> SequenceDependentGapFileNames;
00032
00033 LibraryMetadata(const boost::filesystem::path& libraryPath,const std::string libraryName);
00035 std::string getGapDistributionFileName(uint8_t side) const;
00036 SequenceDependentGapFileNames getSequenceGapDistributionFileName(uint8_t side) const;
00037 std::string getMainGapDistributionFileName() const;
00038
00039 std::string getDnbStructureFileName() const;
00040 const std::string & getName() {return libraryName_;}
00041 protected:
00042 boost::filesystem::path libraryPath_;
00043 std::string libraryName_;
00044 };
00045
00046 class GenomeMetadata : boost::noncopyable
00047 {
00048 public:
00049 GenomeMetadata(const std::string& root);
00050
00051 std::string getEvidenceIntervalsFileName(const std::string& chromName) const;
00052 std::string getEvidenceDnbsFileName(const std::string& chromName) const;
00053 std::string getReferenceSupportFileName(const std::string& chromName) const;
00054 std::string getGeneFileName() const;
00055 std::string getNcRNAFileName() const;
00056 std::string getCnvSegmentsFileName() const;
00057 std::string getGenomeReference() const;
00059 std::string getLaneDir(const std::string& laneName) const;
00060 std::string getLibraryName(const std::string& laneName) const;
00061 std::vector<std::string> getLaneNames() const;
00062
00063
00064
00065
00066 std::string getReadsFileName(const std::string& laneBatchId) const;
00067 std::string getMappingsFileName(const std::string& laneBatchId) const;
00068
00069
00070 LibraryMetadata getLibraryMetadata(const std::string& libraryName) const;
00071 std::vector<std::string> getLibraryNames() const;
00072
00073 int getFormatVersion() const;
00074 const std::string& getAsmId() const { return asmId_; }
00075
00076 private:
00077 boost::filesystem::path root_, asmDir_, asmRefDir_, asmEvidenceDir_, mapDir_, libDir_;
00078 std::string asmId_;
00079 };
00080
00082 bool findFiles( boost::filesystem::path const & directory,
00083 std::string const & filename,
00084 std::vector<boost::filesystem::path> & filesFound,
00085 bool recursive = false,
00086 bool includeDir = false,
00087 boost::regex_constants::syntax_option_type regExOptions = boost::regex_constants::basic);
00088
00089 } }
00090
00091 #endif // CGATOOLS_CGDATA_GENOMEMETADATA_HPP_