-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogisticSensor.H
More file actions
51 lines (45 loc) · 1.74 KB
/
LogisticSensor.H
File metadata and controls
51 lines (45 loc) · 1.74 KB
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
/****************************************************************
LogisticSensor.H
Copyright (C)2017 William H. Majoros (martiandna@gmail.com).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
****************************************************************/
#ifndef INCL_LogisticSensor_H
#define INCL_LogisticSensor_H
#include "BOOM/String.H"
#include "BOOM/Array2D.H"
#include "SignalSensor.H"
#include "TrainingSequence.H"
#include "GarbageCollector.H"
class LogisticSensor : public SignalSensor
{
protected:
BOOM::Array2D<float> matrix;
//BOOM::Array2D<float> Pmatrix;
float intercept;
void load(istream &);
void revComplementSelf();
void swap(char,char);
void convertToLogs();
LogisticSensor(GarbageCollector &);
public:
LogisticSensor(GarbageCollector &,const LogisticSensor &other,
bool reverseComplement=false);
LogisticSensor(GarbageCollector &,BOOM::String &filename);
LogisticSensor(GarbageCollector&,istream &);
// This constructor is for training:
LogisticSensor(GarbageCollector &,BOOM::Vector<TrainingSequence*> &,
SignalType,int consensusOffset,int consensusLength);
virtual SignalSensor *reverseComplement();
virtual bool save(const BOOM::String &filename);
virtual bool save(ostream &os);
virtual void useLogOdds(SignalSensor &nullModel);
virtual void useLogOdds_anonymous(ContentSensor &nullModel);
double getLogP(const Sequence &,const BOOM::String &,int begin);
double getRawScore(const Sequence &,const BOOM::String &,int begin);
float divergence(LogisticSensor &);
BOOM::Array2D<float> &getMatrix() {return matrix;}
// Specific to this class:
double applyLogistic(double BX); // P(splice site | sequence)
};
#endif