lacked SAM header
* Due to lack of SO tag in temp files. This tag is set just fine on
input BAMs containing SAM headers. However, when an input file lacked
one, especially the (required) VN number, the entire @HD line was
dropped.
* Forcing the current SAM version number, if none exists, on sort
output.
# set BamTools version information
set( BamTools_VERSION_MAJOR 2 )
set( BamTools_VERSION_MINOR 1 )
# set BamTools version information
set( BamTools_VERSION_MAJOR 2 )
set( BamTools_VERSION_MINOR 1 )
-set( BamTools_VERSION_BUILD 0 )
+set( BamTools_VERSION_BUILD 1 )
# set our library and executable destination dirs
set( EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin" )
# set our library and executable destination dirs
set( EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin" )
// SamConstants.h (c) 2010 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// SamConstants.h (c) 2010 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 10 October 2011 (DB)
+// Last modified: 27 March 2012 (DB)
// ---------------------------------------------------------------------------
// Provides constants for SAM header
// ***************************************************************************
// ---------------------------------------------------------------------------
// Provides constants for SAM header
// ***************************************************************************
const char SAM_TAB = '\t';
const std::string SAM_DIGITS = "0123456789";
const char SAM_TAB = '\t';
const std::string SAM_DIGITS = "0123456789";
+const std::string SAM_CURRENT_VERSION = "1.4";
+
// HD entries
const std::string SAM_HD_BEGIN_TOKEN = "@HD";
const std::string SAM_HD_VERSION_TAG = "VN";
// HD entries
const std::string SAM_HD_BEGIN_TOKEN = "@HD";
const std::string SAM_HD_VERSION_TAG = "VN";
# set BamTools application properties
set_target_properties( bamtools_cmd PROPERTIES
# set BamTools application properties
set_target_properties( bamtools_cmd PROPERTIES
OUTPUT_NAME "bamtools"
)
# make version info available in application
OUTPUT_NAME "bamtools"
)
# make version info available in application
// bamtools_sort.cpp (c) 2010 Derek Barnett, Erik Garrison
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// bamtools_sort.cpp (c) 2010 Derek Barnett, Erik Garrison
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 11 October 2011 (DB)
+// Last modified: 27 March 2012 (DB)
// ---------------------------------------------------------------------------
// Sorts an input BAM file
// ***************************************************************************
// ---------------------------------------------------------------------------
// Sorts an input BAM file
// ***************************************************************************
// get basic data that will be shared by all temp/output files
SamHeader header = reader.GetHeader();
// get basic data that will be shared by all temp/output files
SamHeader header = reader.GetHeader();
+ if ( !header.HasVersion() )
+ header.Version = Constants::SAM_CURRENT_VERSION;
header.SortOrder = ( m_settings->IsSortingByName
? Constants::SAM_HD_SORTORDER_QUERYNAME
: Constants::SAM_HD_SORTORDER_COORDINATE );
header.SortOrder = ( m_settings->IsSortingByName
? Constants::SAM_HD_SORTORDER_QUERYNAME
: Constants::SAM_HD_SORTORDER_COORDINATE );