Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
protocols
noesy_assign
PeakFileFormat.hh
Go to the documentation of this file.
1
// (c) This file is part of the Rosetta software suite and is made available under license.
2
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
3
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
4
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
5
6
/// @file CrossPeakList.hh
7
/// @author Oliver Lange
8
9
#ifndef INCLUDED_protocols_noesy_assign_PeakFileFormat_hh
10
#define INCLUDED_protocols_noesy_assign_PeakFileFormat_hh
11
12
13
// Unit Headers
14
#include <
protocols/noesy_assign/CrossPeakInfo.hh
>
15
// AUTO-REMOVED #include <protocols/noesy_assign/CrossPeak.hh>
16
17
// Package Headers
18
19
// Project Headers
20
#include <
core/types.hh
>
21
//#include <core/id/NamedAtomID.fwd.hh>
22
//#include <core/chemical/AA.hh>
23
24
// Utility headers
25
// AUTO-REMOVED #include <utility/exit.hh>
26
// #include <utility/excn/Exceptions.hh>
27
#include <utility/vector1.hh>
28
#include <utility/pointer/ReferenceCount.hh>
29
// #include <numeric/numeric.functions.hh>
30
// #include <basic/prof.hh>
31
//#include <basic/Tracer.hh>
32
// #include <basic/options/option.hh>
33
// #include <basic/options/keys/abinitio.OptionKeys.gen.hh>
34
// #include <basic/options/keys/run.OptionKeys.gen.hh>
35
//#include <basic/options/keys/templates.OptionKeys.gen.hh>
36
37
//// C++ headers
38
// AUTO-REMOVED #include <cstdlib>
39
// AUTO-REMOVED #include <string>
40
// AUTO-REMOVED #include <list>
41
// AUTO-REMOVED #include <map>
42
43
#include <
protocols/noesy_assign/CrossPeak.fwd.hh
>
44
#include <
protocols/noesy_assign/PeakAssignment.fwd.hh
>
45
#include <
protocols/noesy_assign/ResonanceList.fwd.hh
>
46
47
48
namespace
protocols {
49
namespace
noesy_assign {
50
51
class
PeakFileFormat_Base
:
public
utility::pointer::ReferenceCount
{
52
public
:
53
PeakFileFormat_Base
()
54
:
ignore_assignments_
( false ),
55
min_VC_to_write_
( 0.0 ),
56
write_only_highest_VC_
( false )
57
{};
58
59
virtual
~PeakFileFormat_Base
() {
60
if
(
info1_
&&
info2_
) {
//should this really be in the destructor ?
61
info1_
->set_filename(
filename
() );
62
info2_
->set_filename(
filename
() );
63
}
64
};
65
66
virtual
void
write_peak
( std::ostream&,
core::Size
ct,
CrossPeak
const
& )
const
= 0;
67
virtual
void
write_resonances
( std::ostream&,
CrossPeak
const
& )
const
= 0;
68
virtual
void
write_strength
( std::ostream&,
CrossPeak
const
& )
const
= 0;
69
virtual
void
write_assignments
( std::ostream&,
CrossPeak
const
&,
std::string
const
& first_line_end )
const
= 0;
70
71
virtual
void
read_resonances
( std::istream&,
CrossPeak
& )
const
= 0;
72
virtual
void
read_assignments
( std::istream& is, std::istream& rest_line,
CrossPeak
&,
std::string
& new_peak_line )
const
= 0;
73
virtual
void
read_strength
( std::istream&,
CrossPeak
& )
const
= 0;
74
75
void
set_filename
(
std::string
str
) {
76
filename_
=
str
;
77
}
78
std::string
const
&
filename
()
const
{
79
return
filename_
;
80
}
81
82
virtual
void
set_format_from_peak
(
CrossPeak
const
& ) = 0;
83
virtual
void
write_header
( std::ostream& ) = 0;
84
virtual
bool
compatible_with_current_format
(
CrossPeak
const
& )
const
= 0;
85
virtual
CrossPeakOP
read_peak
( std::istream&,
std::string
&next_line )
const
= 0;
86
virtual
void
output_diagnosis
( std::ostream& )
const
{};
87
virtual
void
read_header
( std::istream&,
std::string
& next_line ) = 0;
88
89
bool
ignore_assignments
()
const
{
90
return
ignore_assignments_
;
91
}
92
void
set_ignore_assignments
(
bool
setting =
true
) {
93
ignore_assignments_
= setting;
94
}
95
96
bool
write_only_highest_VC
()
const
{
97
return
write_only_highest_VC_
;
98
}
99
100
void
set_write_only_highest_VC
(
bool
setting =
true
) {
101
write_only_highest_VC_
= setting;
102
}
103
104
core::Real
min_VC_to_write
()
const
{
105
return
min_VC_to_write_
;
106
}
107
108
void
set_min_VC_to_write
(
core::Real
setting ) {
109
min_VC_to_write_
=setting;
110
}
111
112
bool
ignore_negative_intensity
()
const
{
113
return
ignore_negative_intensity_
;
114
}
115
116
void
set_ignore_negative_intensity
(
bool
setting =
true
) {
117
ignore_negative_intensity_
= setting;
118
}
119
120
protected
:
121
CrossPeakInfoOP
info1_
;
122
CrossPeakInfoOP
info2_
;
123
std::string
filename_
;
124
125
private
:
126
bool
ignore_assignments_
;
127
core::Real
min_VC_to_write_
;
128
bool
write_only_highest_VC_
;
129
bool
ignore_negative_intensity_
;
130
// virtual void write_header( std::ostream& );
131
};
132
133
class
PeakFileFormat
:
public
PeakFileFormat_Base
{
134
public
:
135
PeakFileFormat
();
136
PeakFileFormat
(
ResonanceListOP
const
& );
137
virtual
~PeakFileFormat
();
138
virtual
void
write_peak
( std::ostream&,
core::Size
ct,
CrossPeak
const
& )
const
;
139
virtual
void
write_resonances
( std::ostream&,
CrossPeak
const
& )
const
;
140
virtual
void
write_strength
( std::ostream&,
CrossPeak
const
& )
const
;
141
virtual
void
write_assignments
( std::ostream&,
CrossPeak
const
&,
std::string
const
& first_line_end )
const
;
142
virtual
void
write_assignment
( std::ostream&,
PeakAssignment
const
& )
const
;
143
virtual
void
write_assignment_indent
( std::ostream&,
CrossPeak
const
& )
const
;
144
virtual
void
write_assignment_stats
( std::ostream& os,
PeakAssignment
& pa )
const
;
145
virtual
void
write_nil_assignment
( std::ostream&)
const
{};
146
virtual
void
read_resonances
( std::istream&,
CrossPeak
& )
const
;
147
virtual
void
read_assignments
( std::istream& is, std::istream& rest_line,
CrossPeak
&,
std::string
& next_line )
const
;
148
virtual
void
read_strength
( std::istream&,
CrossPeak
& )
const
;
149
150
virtual
CrossPeakOP
read_peak
( std::istream&,
std::string
& next_line )
const
;
151
virtual
void
read_header
( std::istream&,
std::string
& next_line );
152
// virtual void write_header( std::ostream& );
153
virtual
void
output_diagnosis
( std::ostream& )
const
;
154
155
virtual
void
set_format_from_peak
(
CrossPeak
const
& );
156
virtual
void
write_header
( std::ostream& );
157
virtual
bool
compatible_with_current_format
(
CrossPeak
const
& )
const
;
158
159
static
void
register_options
();
160
161
void
set_write_atom_names
(
bool
setting =
true
) {
162
write_atom_names_
= setting;
163
}
164
bool
write_atom_names
()
const
{
165
return
write_atom_names_
;
166
}
167
168
core::Size
ncol
()
const
{
return
col2proton_
.size(); }
169
ResonanceList
const
&
resonances
()
const
{
return
*
resonances_
; }
170
protected
:
171
utility::vector1< std::string >
column_labels_
;
//eg. NhH
172
utility::vector1< core::Size >
col2proton_
;
//up to 4 columns may read 1 1 2 2 or 1 2 1 (NhH) or 1 2 2 for hHN
173
utility::vector1< bool >
col2islabel_
;
// woulde be 0 0 1 for hHN and 1 0 0 for NhH
174
175
private
:
176
static
bool
options_registered_
;
177
ResonanceListOP
resonances_
;
178
bool
write_atom_names_
;
179
};
180
181
class
PeakFileFormat_xeasy
:
public
PeakFileFormat
{
182
public
:
183
PeakFileFormat_xeasy
() :
PeakFileFormat
() {};
184
PeakFileFormat_xeasy
(
ResonanceListOP
const
& rop ) :
PeakFileFormat
( rop ) {};
185
};
186
187
}
188
}
189
190
#endif
Generated on Sat Jun 1 2013 12:01:32 for Rosetta 3.5 by
1.8.4