Loading CHANGELOG.md +5 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,11 @@ guarantees will be maintained within each major version series. ## Active ## [0.19.0] - 2018-09-11 ### Added - TranscriptAlignmentSet to XML support ## [0.17.0] - 2018-03-18 ### Added Loading CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ ######################################################################## cmake_policy(SET CMP0048 NEW) # lets us set version in project() project(PacBioBAM VERSION 0.17.0 LANGUAGES CXX C) project(PacBioBAM VERSION 0.19.0 LANGUAGES CXX C) cmake_minimum_required(VERSION 3.0) # project name & version Loading include/pbbam/BamWriter.h +47 −3 Original line number Diff line number Diff line Loading @@ -87,14 +87,39 @@ public: BinCalculation_OFF }; /// /// \brief The Config struct provides a "parameter object" for BamWriter /// settings. This allows for writer configuration without having to /// refer to ordering of parameters, default values, etc. /// struct Config { Config() = default; // zlib compression level CompressionLevel compressionLevel = DefaultCompression; // The number of threads for compression. If set to 0, BamWriter will // attempt to determine a reasonable estimate. If set to 1, this will // force single-threaded execution. No checks are made against an upper limit. size_t numThreads = 4; // If ON, ensures that proper BAI bin numbers are provided for all records. BamWriter::BinCalculationMode binCalculationMode = BamWriter::BinCalculation_ON; // If true, write to <filename>.tmp, and rename to <filename> in dtor. // This allows downstream checks to see if BAM file may be truncated // due to early termination (e.g. a thrown exception). If false, write // directly to <filename>. bool useTempFile = true; }; public: /// \name Constructors & Related Methods /// \{ /// \brief Opens a %BAM file for writing & writes the header information. /// /// The error status will be set if either operation fails. /// /// \note Set \p filename to "-" for stdout. /// /// \param[in] filename path to output %BAM file Loading @@ -111,13 +136,32 @@ public: /// records written. This extra step may turned off when bin /// numbers are not needed. Though if in doubt, keep the default. /// /// \param[in] useTempFile If true, write to <filename>.tmp, and rename /// to <filename>. This provides for downstream /// checks to see if BAM file may be truncated /// due to early termination (a thrown exception). /// /// \throws std::runtmie_error if there was a problem opening the file for /// writing or if an error occurred while writing the header /// BamWriter(const std::string& filename, const BamHeader& header, const BamWriter::CompressionLevel compressionLevel = BamWriter::DefaultCompression, const size_t numThreads = 4, const BinCalculationMode binCalculationMode = BamWriter::BinCalculation_ON); const BinCalculationMode binCalculationMode = BamWriter::BinCalculation_ON, const bool useTempFile = true); /// /// \brief Opens a %BAM file for writing & writes the header information. /// /// \param[in] filename path to output %BAM file /// \param[in] header BamHeader object /// \param[in] config container for add'l configuration options /// /// \throws std::runtmie_error if there was a problem opening the file for /// writing or if an error occurred while writing the header /// BamWriter(const std::string& filename, const BamHeader& header, const BamWriter::Config& config); /// Fully flushes all buffered data & closes file. ~BamWriter() override; Loading include/pbbam/Compare.h +22 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,28 @@ public: }; /// \} template <typename T> static inline bool Check(const T& lhs, const T& rhs, const Compare::Type cmp) { switch (cmp) { case Compare::EQUAL: return lhs == rhs; case Compare::LESS_THAN: return lhs < rhs; case Compare::LESS_THAN_EQUAL: return lhs <= rhs; case Compare::GREATER_THAN: return lhs > rhs; case Compare::GREATER_THAN_EQUAL: return lhs >= rhs; case Compare::NOT_EQUAL: return lhs != rhs; default: assert(false); throw std::runtime_error{"unsupported compare type requested"}; } } }; } // namespace BAM Loading include/pbbam/DataSet.h +2 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,8 @@ public: HDF_SUBREAD, REFERENCE, SUBREAD, TRANSCRIPT TRANSCRIPT, TRANSCRIPT_ALIGNMENT }; /// \brief Converts printable dataset type to type enum. Loading Loading
CHANGELOG.md +5 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,11 @@ guarantees will be maintained within each major version series. ## Active ## [0.19.0] - 2018-09-11 ### Added - TranscriptAlignmentSet to XML support ## [0.17.0] - 2018-03-18 ### Added Loading
CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ ######################################################################## cmake_policy(SET CMP0048 NEW) # lets us set version in project() project(PacBioBAM VERSION 0.17.0 LANGUAGES CXX C) project(PacBioBAM VERSION 0.19.0 LANGUAGES CXX C) cmake_minimum_required(VERSION 3.0) # project name & version Loading
include/pbbam/BamWriter.h +47 −3 Original line number Diff line number Diff line Loading @@ -87,14 +87,39 @@ public: BinCalculation_OFF }; /// /// \brief The Config struct provides a "parameter object" for BamWriter /// settings. This allows for writer configuration without having to /// refer to ordering of parameters, default values, etc. /// struct Config { Config() = default; // zlib compression level CompressionLevel compressionLevel = DefaultCompression; // The number of threads for compression. If set to 0, BamWriter will // attempt to determine a reasonable estimate. If set to 1, this will // force single-threaded execution. No checks are made against an upper limit. size_t numThreads = 4; // If ON, ensures that proper BAI bin numbers are provided for all records. BamWriter::BinCalculationMode binCalculationMode = BamWriter::BinCalculation_ON; // If true, write to <filename>.tmp, and rename to <filename> in dtor. // This allows downstream checks to see if BAM file may be truncated // due to early termination (e.g. a thrown exception). If false, write // directly to <filename>. bool useTempFile = true; }; public: /// \name Constructors & Related Methods /// \{ /// \brief Opens a %BAM file for writing & writes the header information. /// /// The error status will be set if either operation fails. /// /// \note Set \p filename to "-" for stdout. /// /// \param[in] filename path to output %BAM file Loading @@ -111,13 +136,32 @@ public: /// records written. This extra step may turned off when bin /// numbers are not needed. Though if in doubt, keep the default. /// /// \param[in] useTempFile If true, write to <filename>.tmp, and rename /// to <filename>. This provides for downstream /// checks to see if BAM file may be truncated /// due to early termination (a thrown exception). /// /// \throws std::runtmie_error if there was a problem opening the file for /// writing or if an error occurred while writing the header /// BamWriter(const std::string& filename, const BamHeader& header, const BamWriter::CompressionLevel compressionLevel = BamWriter::DefaultCompression, const size_t numThreads = 4, const BinCalculationMode binCalculationMode = BamWriter::BinCalculation_ON); const BinCalculationMode binCalculationMode = BamWriter::BinCalculation_ON, const bool useTempFile = true); /// /// \brief Opens a %BAM file for writing & writes the header information. /// /// \param[in] filename path to output %BAM file /// \param[in] header BamHeader object /// \param[in] config container for add'l configuration options /// /// \throws std::runtmie_error if there was a problem opening the file for /// writing or if an error occurred while writing the header /// BamWriter(const std::string& filename, const BamHeader& header, const BamWriter::Config& config); /// Fully flushes all buffered data & closes file. ~BamWriter() override; Loading
include/pbbam/Compare.h +22 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,28 @@ public: }; /// \} template <typename T> static inline bool Check(const T& lhs, const T& rhs, const Compare::Type cmp) { switch (cmp) { case Compare::EQUAL: return lhs == rhs; case Compare::LESS_THAN: return lhs < rhs; case Compare::LESS_THAN_EQUAL: return lhs <= rhs; case Compare::GREATER_THAN: return lhs > rhs; case Compare::GREATER_THAN_EQUAL: return lhs >= rhs; case Compare::NOT_EQUAL: return lhs != rhs; default: assert(false); throw std::runtime_error{"unsupported compare type requested"}; } } }; } // namespace BAM Loading
include/pbbam/DataSet.h +2 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,8 @@ public: HDF_SUBREAD, REFERENCE, SUBREAD, TRANSCRIPT TRANSCRIPT, TRANSCRIPT_ALIGNMENT }; /// \brief Converts printable dataset type to type enum. Loading