-
Notifications
You must be signed in to change notification settings - Fork 1
/
GeneModelList.h
72 lines (54 loc) · 1.65 KB
/
GeneModelList.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* GeneModelList.h
*
* Created on: 28 oct. 2016
* Author: mdubarry
*/
#ifndef GENEMODELLIST_H_
#define GENEMODELLIST_H_
#include "GeneModel.h"
#include <iostream>
#include <sstream>
#include <string>
#include <map>
#include <list>
using namespace std;
typedef list<GeneModel> GeneModelL;
typedef map<string, GeneModel> MapModel;
struct get_second : public std::unary_function<MapModel::value_type, string>
{
GeneModel operator()(const MapModel::value_type& value) const
{
return value.second;
}
};
bool sortCds(const GeneModel &model1, const GeneModel& model2) ;
bool sortCdsB(const GeneModel* model1, const GeneModel* model2) ;
class GeneModelList{
protected:
GeneModelL _models;
public:
GeneModelList(){}
GeneModelList(map<string, GeneModel> mapGeneModel){
transform(mapGeneModel.begin(), mapGeneModel.end(), back_inserter(_models), get_second() );//XXX This is slow !!
_models.sort(sortCds);
}
~GeneModelList(){}
/* Methods */
void deleteIncludedModel();
void longestCDS();
void bestScore();
void catchModelOnUTR(GeneModel * longestModel);
void insertModels(GeneModelList );
void includedMono(); // a mono CDs overlap a pluri and the mono is < 300
void clusterLocation();//Cluster location sur les CDS !!
void fusionCluster(s32 formerCluster, s32 newCluster, map<s32,list<GeneModel*> >& mapClusterModel);
void deleteSmallCDS(s32 min_size_cds);
void ratioCdsUtr();
s32 printOut(ofstream& ,bool);
void filter(bool,s32,char* longReadsFilename);
/* Accessors */
s32 getSize()const {return _models.size();}
GeneModelL getModels() const {return _models;}
};
#endif /* GENEMODELLIST_H_ */