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_lengths ⇒ Object
- #target_names ⇒ Object
- #to_ptr ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#struct ⇒ Object
13 14 15 |
# File 'lib/hts/bam/header.rb', line 13 def struct @sam_hdr end |
#target_count ⇒ Object
21 22 23 |
# File 'lib/hts/bam/header.rb', line 21 def target_count @sam_hdr[:n_targets] end |
#target_lengths ⇒ Object
31 32 33 34 35 |
# File 'lib/hts/bam/header.rb', line 31 def target_lengths Array.new(target_count) do |i| LibHTS.sam_hdr_tid2len(@sam_hdr, i) end end |
#target_names ⇒ Object
25 26 27 28 29 |
# File 'lib/hts/bam/header.rb', line 25 def target_names Array.new(target_count) do |i| LibHTS.sam_hdr_tid2name(@sam_hdr, i) end end |
#to_ptr ⇒ Object
17 18 19 |
# File 'lib/hts/bam/header.rb', line 17 def to_ptr @sam_hdr.to_ptr end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/hts/bam/header.rb', line 37 def to_s LibHTS.sam_hdr_str(@sam_hdr) end |