// ***************************************************************************
// BamMultiReader.cpp (c) 2010 Erik Garrison, Derek Barnett
// Marth Lab, Department of Biology, Boston College
-// All rights reserved.
// ---------------------------------------------------------------------------
-// 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.
// ***************************************************************************
\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)
\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)
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
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.
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.
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) );
}