Changeset 3212
- Timestamp:
- May 5, 2014, 9:00:56 AM (9 years ago)
- Location:
- trunk/yat
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/omic/BamRead.h
r3210 r3212 23 23 */ 24 24 25 #include <yat/utility/config_public.h>26 27 // allow inclusion of config_bam.h so this file is available also without bam.h28 #ifdef YAT_HAVE_LIBBAM29 25 #include "config_bam.h" 30 26 #include YAT_BAM_HEADER 31 27 #include YAT_SAM_HEADER 32 28 33 #else 34 /// describe how CIGAR operation/length is packed into a 32-bit 35 #define BAM_CIGAR_SHIFT 4 36 /// operation is described in four lowest bits 37 #define BAM_CIGAR_MASK ((1 << BAM_CIGAR_SHIFT) - 1) 38 /// \abstract CIGAR: M = match or mismatch 39 #define BAM_CMATCH 0 40 /// \abstract CIGAR: I = insertion to the reference 41 #define BAM_CINS 1 42 /// \abstract CIGAR: D = deletion from the reference 43 #define BAM_CDEL 2 44 /// \abstract CIGAR: N = skip on the reference (e.g. spliced alignment) 45 #define BAM_CREF_SKIP 3 46 /// \abstract CIGAR: S = clip on the read with clipped sequence 47 /// present in qseq 48 #define BAM_CSOFT_CLIP 4 49 /// \abstract CIGAR: H = clip on the read with clipped sequence trimmed off 50 #define BAM_CHARD_CLIP 5 51 /// \abstract CIGAR: P = padding 52 #define BAM_CPAD 6 53 /// \abstract CIGAR: equals = match 54 #define BAM_CEQUAL 7 55 /// \abstract CIGAR: X = mismatch 56 #define BAM_CDIFF 8 57 #define BAM_CBACK 9 58 #endif 29 // This file has to be included to keep compatibility with yat 0.11 30 #include <yat/utility/Cigar.h> 59 31 60 32 #include <functional> … … 62 34 #include <vector> 63 35 64 // backport #defines from samtools 0.1.1965 #ifndef BAM_CIGAR_STR66 #define BAM_CIGAR_STR "MIDNSHP=XB"67 // lookup table used in bam_cigar_type68 #define BAM_CIGAR_TYPE 0x3C1A769 70 /// index of operation in range [0, 9], see below.71 #define bam_cigar_op(c) ((c)&BAM_CIGAR_MASK)72 // length of the operation73 #define bam_cigar_oplen(c) ((c)>>BAM_CIGAR_SHIFT)74 // char describing the operation, see column 2 in table below75 #define bam_cigar_opchr(c) (BAM_CIGAR_STR[bam_cigar_op(c)])76 // Create a cigar element with length l and operation o77 #define bam_cigar_gen(l, o) ((l)<<BAM_CIGAR_SHIFT|(o))78 // Returns a two-bits number describing the type of operation. The79 // first bit, bam_cigar_type & 1, (4th column in table below) is 1 iff80 // operation consumes query sequence. The second bit, bam_cigar_type &81 // 2, (3rd column below) is 1 iff operation consumes reference82 // sequence.83 #define bam_cigar_type(o) (BAM_CIGAR_TYPE>>((o)<<1)&3)84 #endif85 86 /*87 CIGAR88 0 M 1 1 match89 1 I 0 1 insert90 2 D 1 0 deletion91 3 N 1 0 spliced (rna)92 4 S 0 1 soft clipped93 5 H 0 0 hard clipped94 6 P 0 0 padded95 7 = 1 1 equal96 8 X 1 1 mismatch97 9 B 0 098 99 3rd column: consumes reference sequence100 4th column: consumes query sequence101 */102 103 #ifdef YAT_HAVE_LIBBAM104 36 namespace theplu { 105 37 namespace yat { … … 457 389 }}} 458 390 #endif 459 #endif -
trunk/yat/utility/Aligner.cc
r3210 r3212 23 23 24 24 #include "Aligner.h" 25 #include "Cigar.h" 25 26 #include "Matrix.h" 26 27 // to get BAM_CIGAR defines28 #include <yat/omic/BamRead.h>29 27 30 28 #include <cassert> -
trunk/yat/utility/Aligner.h
r3211 r3212 172 172 173 173 \since new in yat 0.12 174 175 \see file yat/utility/Cigar.h for some useful macros 174 176 */ 175 177 class Cigar -
trunk/yat/utility/Makefile.am
r3204 r3212 61 61 $(srcdir)/yat/utility/Alignment.h \ 62 62 $(srcdir)/yat/utility/boost_exception_ptr.h \ 63 $(srcdir)/yat/utility/Cigar.h \ 63 64 $(srcdir)/yat/utility/ColumnStream.h \ 64 65 $(srcdir)/yat/utility/CommandLine.h \ -
trunk/yat/utility/SmithWaterman.cc
r3205 r3212 23 23 24 24 #include "SmithWaterman.h" 25 #include " yat/omic/BamRead.h" // for cigar defines25 #include "Cigar.h" 26 26 27 27 #include <cassert>
Note: See TracChangeset
for help on using the changeset viewer.