-
Notifications
You must be signed in to change notification settings - Fork 19
/
Transcript.cc
53 lines (45 loc) · 1.27 KB
/
Transcript.cc
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
52
// Copyright 2013 Nadia Davidson for Murdoch Childrens Research
// Institute Australia. This program is distributed under the GNU
// General Public License. We also ask that you cite this software in
// publications where you made use of it for any part of the data
// analysis.
//#include <string>
//#include <vector>
//#include <sstream>
//#include <cstdlib>
//#include <algorithm>
//#include <StringSet.h>
#include <Transcript.h>
#include <Read.h>
using namespace std;
// initialise the number of samples to 0.
// this will be set later on.
int Transcript::samples=0;
int Transcript::groups=0;
int Transcript::min_counts=10;
int Transcript::min_reads_for_link=1;
int Transcript::max_alignments=-1;
void Transcript::remove(){
for(int r=0; r<reads_.size() ; r++)
reads_.at(r)->remove(this);
};
Transcript::Transcript(string name){
name_=name;
// reached_min_counts_=false;
};
void Transcript::add_read( Read * read ){
// if(reads_.size()>=min_counts)//{
// reads_.clear();
// reached_min_counts_=true;
//} else {
reads_.push_back(read) ;
// }
};
bool Transcript::reached_min_counts(){
int counts=0;
for(int i=0; i<reads_.size(); i++){
counts+=reads_.at(i)->get_weight();
if(counts >= min_counts) return true;
}
return false;
}