Ignore:
Timestamp:
Apr 22, 2015, 1:05:43 AM (8 years ago)
Author:
Peter
Message:

add two new functions read_group and program_group to access data in BamHeader?. closes #817

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamHeader.h

    r3408 r3410  
    2929#include YAT_SAM_HEADER
    3030
     31#include <map>
    3132#include <string>
    3233
     
    8889
    8990    /**
     91       \brief Access value in \c \@PG lines.
     92
     93       A program group line in the header typically looks like
     94
     95       \code @PG  ID:bwa  PN:bwa  VN:0.6.1-r104 \endcode
     96
     97       and for this line \c program_group("bwa", "VN") returns
     98       \c "0.6.1-r104"
     99
     100       \return value for \a key for line with ID \a id.
     101
     102       \since New in yat 0.13
     103    */
     104    const std::string& program_group(const std::string& id,
     105                                     const std::string& key) const;
     106
     107    /**
     108       \brief Access value in \c \@RG lines.
     109
     110       A read group line in the header typically looks like
     111
     112       \code @RG  ID:foo  PL:ILLUMINA SM:Tumour \endcode
     113
     114       and for this line \c read_group("foo", "SM") returns \c "Tumour"
     115
     116       \return value for \a key for line with ID \a id.
     117
     118       \since New in yat 0.13
     119    */
     120    //
     121    const std::string& read_group(const std::string& id,
     122                                  const std::string& key) const;
     123
     124    /**
    90125       \brief Exchanges the content in \c *this and \a other
    91126
     
    146181#endif
    147182    bam_hdr_t* header_;
     183    typedef std::map<std::string, std::string> strMap;
     184    typedef std::map<std::string, strMap> strMap2;
     185    mutable strMap2 read_group_;
     186    mutable strMap2 program_group_;
    148187
    149188    friend class InBamFile;
    150189    friend class OutBamFile;
     190
     191    const std::string& group(strMap2& map, const std::string& type,
     192                             const std::string& id,
     193                             const std::string& key) const;
    151194
    152195    // using compiler generated copy and assignment
Note: See TracChangeset for help on using the changeset viewer.