Class: HTS::Bam::Header
- Inherits:
-
Object
- Object
- HTS::Bam::Header
- Defined in:
- lib/hts/bam/header.rb
Instance Method Summary collapse
-
#initialize(hts_file) ⇒ Header
constructor
A new instance of Header.
- #struct ⇒ Object
- #target_count ⇒ Object
- #target_len ⇒ Object
- #target_names ⇒ Object
- #to_ptr ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(hts_file) ⇒ Header
6 7 8 |
# File 'lib/hts/bam/header.rb', line 6 def initialize(hts_file) @sam_hdr = LibHTS.sam_hdr_read(hts_file) end |
Instance Method Details
#struct ⇒ Object
10 11 12 |
# File 'lib/hts/bam/header.rb', line 10 def struct @sam_hdr end |
#target_count ⇒ Object
18 19 20 |
# File 'lib/hts/bam/header.rb', line 18 def target_count @sam_hdr[:n_targets] end |
#target_len ⇒ Object
28 29 30 31 32 |
# File 'lib/hts/bam/header.rb', line 28 def target_len Array.new(target_count) do |i| LibHTS.sam_hdr_tid2len(@sam_hdr, i) end end |
#target_names ⇒ Object
22 23 24 25 26 |
# File 'lib/hts/bam/header.rb', line 22 def target_names Array.new(target_count) do |i| LibHTS.sam_hdr_tid2name(@sam_hdr, i) end end |
#to_ptr ⇒ Object
14 15 16 |
# File 'lib/hts/bam/header.rb', line 14 def to_ptr @sam_hdr.to_ptr end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/hts/bam/header.rb', line 34 def to_s LibHTS.sam_hdr_str(@sam_hdr) end |