File: TranscriptGroup.hpp

package info (click to toggle)
salmon 1.10.3%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,148 kB
  • sloc: cpp: 200,707; ansic: 171,082; sh: 859; python: 792; makefile: 238
file content (49 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download | duplicates (5)
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
40
41
42
43
44
45
46
47
48
49
#ifndef TRANSCRIPT_GROUP_HPP
#define TRANSCRIPT_GROUP_HPP

#include <boost/functional/hash.hpp>

#include <cstdint>
#include <vector>
#include "xxhash.h"

class TranscriptGroup {
public:
  TranscriptGroup();
  TranscriptGroup(std::vector<uint32_t> txpsIn);

  TranscriptGroup(std::vector<uint32_t> txpsIn, size_t hashIn);

  TranscriptGroup(TranscriptGroup&& other);
  TranscriptGroup(const TranscriptGroup& other);

  TranscriptGroup& operator=(const TranscriptGroup& other);
  TranscriptGroup& operator=(TranscriptGroup&& other);

  friend bool operator==(const TranscriptGroup& lhs,
                         const TranscriptGroup& rhs);

  void setValid(bool v) const;

  std::vector<uint32_t> txps;
  size_t hash;
  double totalMass;
  mutable bool valid;
};

bool operator==(const TranscriptGroup& lhs, const TranscriptGroup& rhs);

struct TranscriptGroupHasher {
  std::size_t operator()(const TranscriptGroup& k) const {
    return k.hash;
    /*
    std::size_t seed{0};
    for (auto e : k.txps) {
        boost::hash_combine(seed, e);
    }
    return seed;
    */
  }
};

#endif // TRANSCRIPT_GROUP_HPP