ProteoWizard
Main Page
Namespaces
Classes
Files
File List
File Members
pwiz
analysis
eharmony
DistanceAttributes.hpp
Go to the documentation of this file.
1
//
2
// $Id: DistanceAttributes.hpp 2051 2010-06-15 18:39:13Z chambm $
3
//
4
//
5
// Original author: Kate Hoff <katherine.hoff@proteowizard.org>
6
//
7
// Copyright 2009 Center for Applied Molecular Medicine
8
// University of Southern California, Los Angeles, CA
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License");
11
// you may not use this file except in compliance with the License.
12
// You may obtain a copy of the License at
13
//
14
// http://www.apache.org/licenses/LICENSE-2.0
15
//
16
// Unless required by applicable law or agreed to in writing, software
17
// distributed under the License is distributed on an "AS IS" BASIS,
18
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
// See the License for the specific language governing permissions and
20
// limitations under the License.
21
//
22
23
#ifndef _DISTANCEATTRIBUTES_HPP_
24
#define _DISTANCEATTRIBUTES_HPP_
25
26
#include "
AMTContainer.hpp
"
27
#include "
Matrix.hpp
"
28
#include "
pwiz/utility/misc/Std.hpp
"
29
30
namespace
pwiz{
31
namespace
eharmony{
32
33
typedef
AMTContainer
Entry
;
34
35
enum
DistanceAttributeEnum
{
_Hamming
,
_NumberOfMS2IDs
,
_Random
,
_RTDiff
,
_WeightedHamming
};
36
37
struct
DistanceAttribute
38
{
39
DistanceAttribute
(){}
40
virtual
double
score
(
const
Entry
& a,
const
Entry
& b){
return
0;}
41
virtual
double
operator()
(
const
Entry
& a,
const
Entry
& b){
return
this->
score
(a,b);}
42
virtual
~DistanceAttribute
(){}
43
44
};
45
46
struct
NumberOfMS2IDs
:
public
DistanceAttribute
47
{
48
NumberOfMS2IDs
(){}
49
virtual
double
score
(
const
AMTContainer
& a,
const
AMTContainer
& b);
50
51
};
52
53
struct
RandomDistance
:
public
DistanceAttribute
54
{
55
virtual
double
score
(
const
Entry
& a,
const
Entry
& b);
56
57
};
58
59
struct
RTDiffDistribution
:
public
DistanceAttribute
60
{
61
virtual
double
score
(
const
Entry
& a,
const
Entry
& b);
62
63
};
64
65
struct
HammingDistance
:
public
DistanceAttribute
66
{
67
HammingDistance
(
const
vector<boost::shared_ptr<Entry> >& v);
68
virtual
double
score
(
const
Entry
& a,
const
Entry
& b);
69
70
vector<string>
allUniquePeptides
;
71
72
};
73
74
struct
WeightedHammingDistance
:
public
DistanceAttribute
75
{
76
WeightedHammingDistance
(
const
vector<boost::shared_ptr<Entry> >& v);
77
virtual
double
score
(
const
Entry
& a,
const
Entry
& b);
78
79
double
normalizationFactor
;
80
vector<string>
allUniquePeptides
;
81
82
};
83
84
struct
EditDistance
:
public
DistanceAttribute
85
{
86
EditDistance
();
87
virtual
double
score
(
const
Entry
& a,
const
Entry
& b);
88
89
double
insertionCost
;
90
double
deletionCost
;
91
double
translocationCost
;
92
93
private
:
94
95
Matrix
scoreMatrix
;
96
97
};
98
99
}
// namespace eharmony
100
}
// namespace pwiz
101
102
103
#endif
Generated on Mon Nov 26 2012 18:05:46 for ProteoWizard by
1.8.1.1