]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamMultiReader.cpp
Converted intervals from 0-based, CLOSED to 0-based, HALF-OPEN
[bamtools.git] / src / api / BamMultiReader.cpp
index 854345193b3a3f51bfcd393c3543e7d49565c2ea..d0315688ef4ef3595854ef751b3c92ac19b72533 100644 (file)
@@ -2,13 +2,13 @@
 // BamMultiReader.cpp (c) 2010 Erik Garrison, Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 15 March 2011 (DB)
+// Last modified: 8 October 2011 (DB)
 // ---------------------------------------------------------------------------
 // Convenience class for reading multiple BAM files.
 //
 // This functionality allows applications to work on very large sets of files
 // without requiring intermediate merge, sort, and index steps for each file
-// subset.  It also improves the performance of our merge system as it
+// subset. It also improves the performance of our merge system as it
 // precludes the need to sort merged files.
 // ***************************************************************************
 
@@ -46,8 +46,8 @@ BamMultiReader::~BamMultiReader(void) {
 
     \sa CloseFile(), IsOpen(), Open(), BamReader::Close()
 */
-void BamMultiReader::Close(void) {
-    d->Close();
+bool BamMultiReader::Close(void) {
+    return d->Close();
 }
 
 /*! \fn void BamMultiReader::CloseFile(const std::string& filename)
@@ -57,8 +57,8 @@ void BamMultiReader::Close(void) {
 
     \sa Close(), IsOpen(), Open(), BamReader::Close()
 */
-void BamMultiReader::CloseFile(const std::string& filename) {
-    d->CloseFile(filename);
+bool BamMultiReader::CloseFile(const std::string& filename) {
+    return d->CloseFile(filename);
 }
 
 /*! \fn bool BamMultiReader::CreateIndexes(const BamIndex::IndexType& type)
@@ -86,6 +86,11 @@ const std::vector<std::string> BamMultiReader::Filenames(void) const {
     return d->Filenames();
 }
 
+// returns a description of the last error that occurred
+std::string BamMultiReader::GetErrorString(void) const {
+    return d->GetErrorString();
+}
+
 /*! \fn SamHeader BamMultiReader::GetHeader(void) const
     \brief Returns unified SAM-format header for all files
 
@@ -192,19 +197,6 @@ bool BamMultiReader::HasOpenReaders(void) const {
     return d->HasOpenReaders();
 }
 
-/*! \fn bool BamMultiReader::IsIndexLoaded(void) const
-    \brief Returns \c true if all BAM files have index data available.
-
-    \deprecated Instead use HasIndexes()
-    \cond
-    See explanation in BamReader.cpp for more details on the deprecation decision.
-    \endcond
-*/
-
-bool BamMultiReader::IsIndexLoaded(void) const {
-    return d->HasIndexes();
-}
-
 /*! \fn bool BamMultiReader::Jump(int refID, int position)
     \brief Performs a random-access jump within current BAM files.
 
@@ -304,16 +296,6 @@ bool BamMultiReader::OpenIndexes(const std::vector<std::string>& indexFilenames)
     return d->OpenIndexes(indexFilenames);
 }
 
-/*! \fn void BamMultiReader::PrintFilenames(void) const
-    \brief Convenience method for printing filenames to stdout.
-    \deprecated Doesn't really belong as an API function. Clients should
-                determine how the data is reported.
-    \sa Filenames(), BamReader::GetFilename()
-*/
-void BamMultiReader::PrintFilenames(void) const {
-    d->PrintFilenames();
-}
-
 /*! \fn bool BamMultiReader::Rewind(void)
     \brief Returns the internal file pointers to the beginning of alignment records.
 
@@ -376,20 +358,5 @@ bool BamMultiReader::SetRegion(const int& leftRefID,
                                const int& rightRefID,
                                const int& rightPosition)
 {
-    BamRegion region(leftRefID, leftPosition, rightRefID, rightPosition);
-    return d->SetRegion(region);
-}
-
-/*! \fn void BamMultiReader::SetSortOrder(const SortOrder& order)
-    \brief Sets the expected sorting order for reading across multiple BAM files.
-
-    Default is BamMultiReader::SortedByPosition.
-
-    The SortOrder determines how the reader determines which alignment is "next"
-    from among its open readers.
-
-    \param order expected sort order
-*/
-void BamMultiReader::SetSortOrder(const SortOrder& order) {
-    d->SetSortOrder(order);
+    return d->SetRegion( BamRegion(leftRefID, leftPosition, rightRefID, rightPosition) );
 }