From: Derek Date: Thu, 16 Sep 2010 05:47:58 +0000 (-0400) Subject: Did some housekeeping in BamAux.h - moved some constants to the files where they... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e9617e555c77b5b58da1959e18e6421fa5f271a9;p=bamtools.git Did some housekeeping in BamAux.h - moved some constants to the files where they are actually used. --- diff --git a/src/api/BamAux.h b/src/api/BamAux.h index a122b24..daad5a0 100644 --- a/src/api/BamAux.h +++ b/src/api/BamAux.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 15 September 2010 (DB) +// Last modified: 16 September 2010 (DB) // --------------------------------------------------------------------------- // Provides the basic constants, data structures, etc. for using BAM files // *************************************************************************** @@ -46,24 +46,9 @@ namespace BamTools { // BAM constants -const int BAM_CORE_SIZE = 32; -const int BAM_CMATCH = 0; -const int BAM_CINS = 1; -const int BAM_CDEL = 2; -const int BAM_CREF_SKIP = 3; -const int BAM_CSOFT_CLIP = 4; -const int BAM_CHARD_CLIP = 5; -const int BAM_CPAD = 6; const int BAM_CIGAR_SHIFT = 4; const int BAM_CIGAR_MASK = ((1 << BAM_CIGAR_SHIFT) - 1); - -// BAM index constants -const int MAX_BIN = 37450; // =(8^6-1)/7+1 -const int BAM_MIN_CHUNK_GAP = 32768; -const int BAM_LIDX_SHIFT = 14; - -// Explicit variable sizes -const int BT_SIZEOF_INT = 4; +const int BAM_CORE_SIZE = 32; struct CigarOp; diff --git a/src/api/BamIndex.cpp b/src/api/BamIndex.cpp index c628b79..a7f93de 100644 --- a/src/api/BamIndex.cpp +++ b/src/api/BamIndex.cpp @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 10 September 2010 (DB) +// Last modified: 16 September 2010 (DB) // --------------------------------------------------------------------------- // Provides index functionality - both for the default (standardized) BAM // index format (.bai) as well as a BamTools-specific (nonstandard) index @@ -52,6 +52,10 @@ bool BamIndex::HasAlignments(const int& referenceID) { namespace BamTools { +// BAM index constants +const int MAX_BIN = 37450; // =(8^6-1)/7+1 +const int BAM_LIDX_SHIFT = 14; + // -------------------------------------------------- // BamStandardIndex data structures & typedefs struct Chunk { diff --git a/src/api/BamWriter.cpp b/src/api/BamWriter.cpp index 2be38bb..c3c94ef 100644 --- a/src/api/BamWriter.cpp +++ b/src/api/BamWriter.cpp @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 17 August 2010 (DB) +// Last modified: 16 September 2010 (DB) // --------------------------------------------------------------------------- // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -18,6 +18,20 @@ using namespace BamTools; using namespace std; +namespace BamTools { + +// BAM constants +const int BT_SIZEOF_INT = 4; +const int BAM_CMATCH = 0; +const int BAM_CINS = 1; +const int BAM_CDEL = 2; +const int BAM_CREF_SKIP = 3; +const int BAM_CSOFT_CLIP = 4; +const int BAM_CHARD_CLIP = 5; +const int BAM_CPAD = 6; + +} // namespace BamTools + struct BamWriter::BamWriterPrivate { // data members