File: SoloReadFeatureStats.h

package info (click to toggle)
rna-star 2.7.11b%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,492 kB
  • sloc: cpp: 21,951; awk: 827; ansic: 457; makefile: 192; sh: 31
file content (49 lines) | stat: -rw-r--r-- 1,558 bytes parent folder | download | duplicates (2)
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 H_SoloReadFeatureStats
#define H_SoloReadFeatureStats
#include "IncludeDefine.h"

class SoloReadFeatureStats {
public:
    vector<string> names;
    enum {      noUnmapped,  noNoFeature,  MultiFeature,  subMultiFeatureMultiGenomic, noTooManyWLmatches,  noMMtoWLwithoutExact,    yesWLmatch,  yessubWLmatchExact, yessubWLmatch_UniqueFeature,  yesCellBarcodes,  yesUMIs, nStats};
    uint64 V[nStats];    
    SoloReadFeatureStats() 
    {
        names={"noUnmapped","noNoFeature","MultiFeature","subMultiFeatureMultiGenomic","noTooManyWLmatches","noMMtoWLwithoutExact","yesWLmatch","yessubWLmatchExact","yessubWLmatch_UniqueFeature","yesCellBarcodes","yesUMIs"};
        for (uint32 ii=0; ii<nStats; ii++)
            V[ii]=0;
    };
    
    uint64 numInvalidBarcodes()
    {
        return V[noTooManyWLmatches]+V[noMMtoWLwithoutExact];
    };
    
    uint64 numMappedToTranscriptome()
    {
        return V[yesWLmatch];
    };
    
    /*
    void calcUnique(bool multYes)
    {
        if ( multYes  ) {//multi-genic reads were counted in yesWLmatch
            V[yessubWLmatch_UniqueFeature] = V[yesWLmatch] - V[MultiFeature];
        } else {//no multi-genic reads
            V[yessubWLmatch_UniqueFeature] =  V[yesWLmatch];
        };
    };
    */
    
    uint64 numMappedToTranscriptomeUnique()
    {
        return V[yessubWLmatch_UniqueFeature];
    };
    
    double numSequencingSaturation()
    {
        return 1.0 - double(V[yesUMIs])/V[yessubWLmatch_UniqueFeature]; //yesUMIs is calculated for unqiue-gene reads
    };
};

#endif