File: SampleManager.h

package info (click to toggle)
tvc 5.0.3%2Bgit20151221.80e144e%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,548 kB
  • sloc: cpp: 24,088; ansic: 3,933; python: 260; makefile: 16
file content (39 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved */

//! @file     SampleManager.h
//! @ingroup  VariantCaller
//! @brief    Manages sample and read group names


#ifndef SAMPLEMANAGER_H
#define SAMPLEMANAGER_H

#include <map>
#include <vector>
#include <string>
#include "api/SamHeader.h"
#include "api/BamAlignment.h"

using namespace std;
using namespace BamTools;


class SampleManager {
public:
  SampleManager() : num_samples_(0), primary_sample_(0) {}
  ~SampleManager() {}

  void Initialize (const SamHeader& bam_header, string& sample_name, const string& force_sample_name);
  bool IdentifySample(const BamAlignment& alignment, int& sample_index, bool& primary_sample) const;

  int                 num_samples_;
  vector<string>      sample_names_;
  map<string,int>     read_group_to_sample_idx_;
  int                 primary_sample_;
};



#endif //SAMPLEMANAGER_H