-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMotif.h
More file actions
93 lines (75 loc) · 2.13 KB
/
Motif.h
File metadata and controls
93 lines (75 loc) · 2.13 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//////////////////////////////////////////////////////////////////////////////////
//
// STAMP version 1.3
//
// Written By: Shaun Mahony
//
// Motif.h
//
// Started: 31st Oct 2005
//
// Copyright 2007-2015 Shaun Mahony
//
// This file is part of STAMP.
//
// STAMP is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// STAMP is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with STAMP; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////////
#ifndef Motif_MARK
#define Motif_MARK
#include "globals.h"
#include <stdio.h>
#include <stdlib.h>
const double CONS1 = 0.6;
const double CONS2 = 0.8;
const double CONS3 = 0.99;
class Motif {
public:
int len;
double **f;
double **n;
double **pwm;
double *gaps;
double members;
char name[STR_LEN];
double weighting; //Only used to provide weighting for motifs in an FBP.
char famName[STR_LEN]; //Only used in testing!
//Constructor
Motif(int l=0);
//Accessors
int GetLen(){return len;}
char* GetName(){return name;}
//Reverse-complement the motif
void RevCompMotif(Motif* out);
//Reverse complement a single column
void RevCompColumn(int i);
//Copy a motif
void CopyMotif(Motif* out);
//Consensus letter for a column (taken from f)
char ColConsensus(int i);
//Find the information content of a column in f
double Info(int i);
//Print the motif in TRANSFAC format
void PrintMotif(FILE* out=NULL, bool famNames=false);
//Print the motif's consensus
void PrintMotifConsensus();
//log base 2
double log_2(double x){ return(log(x) / LOG_2);}
//Reset method
void Reset();
//Destructor
~Motif();
};
#endif