Method: Bio::PAML::Common#dump_parameters
- Defined in:
- lib/bio/appl/paml/common.rb
#dump_parameters ⇒ Object
Shows parameters (content of control file) as a string. The string can be used for control file.
- Returns
-
string representation of the parameters (String)
270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/bio/appl/paml/common.rb', line 270 def dump_parameters keyorder = DEFAULT_PARAMETERS_ORDER keys = parameters.keys str = '' keys.sort do |x, y| (keyorder.index(x) || (keyorder.size + keys.index(x))) <=> (keyorder.index(y) || (keyorder.size + keys.index(y))) end.each do |key| value = parameters[key] # Note: spaces are required in both side of the "=". str.concat "#{key.to_s} = #{value.to_s}\n" if value end str end |