// -*- mode: c++; indent-tabs-mode: nil; -*- // // Copyright 2009 Illumina, Inc. // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // // /// \file /// \author Chris Saunders /// #include "blt_util/bam_record.hh" unsigned bam_record:: alt_map_qual(const char* tag) const { uint8_t* alt_ptr(bam_aux_get(_bp,tag)); if((NULL != alt_ptr) and is_int_code(alt_ptr[0])) { const int alt_map(bam_aux2i(alt_ptr)); assert(alt_map>=0); return static_cast(alt_map); } else { return map_qual(); } } const char* bam_record:: get_string_tag(const char* tag) const { // retrieve the BAM tag uint8_t* pTag = bam_aux_get(_bp, tag); if(!pTag) return NULL; // skip tags that are not encoded as a null-terminated string if(pTag[0] != 'Z') return NULL; ++pTag; return (const char*)pTag; } bool bam_record:: get_num_tag(const char* tag, int32_t& num) const { // retrieve the BAM tag uint8_t* pTag = bam_aux_get(_bp, tag); if(!pTag) return false; // skip tags that are not encoded as integers if(!is_int_code(pTag[0])) return false; num = bam_aux2i(pTag); return true; }