File: SoloReadBarcode.cpp

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 (51 lines) | stat: -rwxr-xr-x 1,290 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
40
41
42
43
44
45
46
47
48
49
50
51
#include "SoloReadBarcode.h"
#include "streamFuns.h"

SoloReadBarcode::SoloReadBarcode(Parameters &P) : P(P), pSolo(P.pSolo)
{
    if (pSolo.type==0)
        return;

    for (uint32 ii=0; ii<stats.nStats; ii++)
        stats.V[ii]=0;

    if (pSolo.cbWLyes) {
        cbReadCountExact.resize(pSolo.cbWLsize,0);
    };

    for (uint32 jj=0;jj<4;jj++) {
        homoPolymer[jj]=0;
        for (uint32 ii=0; ii<pSolo.umiL;ii++) {
            homoPolymer[jj]=(homoPolymer[jj]<<2)+jj;
        };
    };
    
    qualHist.fill(0);
};

void SoloReadBarcode::addCounts(const SoloReadBarcode &rfIn)
{
    if (pSolo.cbWLyes) {
        for (uint32 ii=0; ii<pSolo.cbWLsize; ii++) {
            cbReadCountExact[ii] += rfIn.cbReadCountExact[ii];
        };
    };
        
    for (uint32 ii=0; ii<qualHist.size(); ii++)
        qualHist[ii] += rfIn.qualHist[ii];
};

void SoloReadBarcode::addStats(const SoloReadBarcode &rfIn)
{
    for (uint32 ii=0; ii<stats.nStats; ii++)
        stats.V[ii] += rfIn.stats.V[ii];
};

void SoloReadBarcode::statsOut(ofstream &streamOut)
{
    //streamOut << setw(50) << "CELL BARCODES IN READS:\n"
    for (uint32 ii=0; ii<stats.nStats; ii++) {
        streamOut << setw(50) << stats.names.at(ii) << setw(15) << stats.V[ii] << '\n';
    };
    streamOut.flush();
};