File: Quantifications.cpp

package info (click to toggle)
rna-star 2.7.8a%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,076 kB
  • sloc: cpp: 20,429; awk: 483; ansic: 470; makefile: 181; sh: 31
file content (37 lines) | stat: -rw-r--r-- 1,126 bytes parent folder | download | duplicates (6)
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
#include "Quantifications.h"

Quantifications::Quantifications (uint32 nGeIn) {

    geneCounts.nType=3;
    geneCounts.cAmbig = new uintQ[geneCounts.nType];
    geneCounts.cNone = new uintQ[geneCounts.nType];

    geneCounts.nGe=nGeIn;
    geneCounts.gCount = new uintQ* [geneCounts.nType];

    geneCounts.cMulti=0;
    for (int itype=0; itype<geneCounts.nType; itype++)
    {
        geneCounts.cAmbig[itype]=0;
        geneCounts.cNone[itype]=0;
        geneCounts.gCount[itype] = new uintQ [geneCounts.nGe];
        for (uint32 ii=0; ii<geneCounts.nGe; ii++)
        {
            geneCounts.gCount[itype][ii]=0;
        };
    };
};

void Quantifications::addQuants(const Quantifications & quantsIn)
{
    geneCounts.cMulti += quantsIn.geneCounts.cMulti;
    for (int itype=0; itype<geneCounts.nType; itype++)
    {
        geneCounts.cAmbig[itype] += quantsIn.geneCounts.cAmbig[itype];
        geneCounts.cNone[itype] += quantsIn.geneCounts.cNone[itype];
        for (uint32 ii=0; ii<geneCounts.nGe; ii++)
        {
            geneCounts.gCount[itype][ii] += quantsIn.geneCounts.gCount[itype][ii];
        };
    };
};