Class: Bio::MAF::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/maf/maf.rb

Overview

A MAF header, containing the variable-value pairs from the first line of the file as well as the alignment parameters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vars, params) ⇒ Header

Returns a new instance of Header.



32
33
34
35
# File 'lib/bio/maf/maf.rb', line 32

def initialize(vars, params)
  @vars = vars
  @alignment_params = params
end

Instance Attribute Details

#alignment_paramsHash

Alignment parameters from the MAF header.

Returns:

  • (Hash)


24
25
26
# File 'lib/bio/maf/maf.rb', line 24

def alignment_params
  @alignment_params
end

#varsHash

Variable-value pairs from the ##maf line

Returns:

  • (Hash)


21
22
23
# File 'lib/bio/maf/maf.rb', line 21

def vars
  @vars
end

Class Method Details

.defaultHeader

Create a default header with version=1.

Returns:



28
29
30
# File 'lib/bio/maf/maf.rb', line 28

def Header.default
  Header.new({:version => 1}, nil)
end

Instance Method Details

#scoringString

The optional scoring parameter, if present.

Returns:

  • (String)


45
46
47
# File 'lib/bio/maf/maf.rb', line 45

def scoring
  vars[:scoring]
end

#versionString

The required version parameter.

Returns:

  • (String)


39
40
41
# File 'lib/bio/maf/maf.rb', line 39

def version
  vars[:version]
end