Module: Bio::MAF::KVHelpers Private

Included in:
Filter, Filters, KyotoIndex
Defined in:
lib/bio/maf/index.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Binary record packing and unpacking.

Defined Under Namespace

Classes: KEY, VAL

Constant Summary collapse

KEY_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

KEY.fmt
KEY_SCAN_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

KEY.extractor_fmt(:seq_id, :bin, :seq_start, :seq_end)
CHROM_BIN_PREFIX_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

KEY.extractor_fmt(:marker, :seq_id, :bin)
VAL_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

VAL.fmt
VAL_IDX_OFFSET_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

VAL.extractor_fmt(:offset, :length)
VAL_TEXT_SIZE_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

VAL.extractor_fmt(:text_size)
VAL_N_SEQ_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

VAL.extractor_fmt(:n_seq)
VAL_SPECIES_FMT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

VAL.extractor_fmt(:species_vec)

Class Method Summary collapse

Class Method Details

.bin_start_prefix(chrom_id, bin) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



59
60
61
# File 'lib/bio/maf/index.rb', line 59

def bin_start_prefix(chrom_id, bin)
  [0xFF, chrom_id, bin].pack(CHROM_BIN_PREFIX_FMT)
end

.extract_index_offset(entry) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
# File 'lib/bio/maf/index.rb', line 47

def extract_index_offset(entry)
  entry[1].unpack(VAL_IDX_OFFSET_FMT)
end

.extract_n_sequences(entry) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



43
44
45
# File 'lib/bio/maf/index.rb', line 43

def extract_n_sequences(entry)
  entry[1].unpack(VAL_N_SEQ_FMT)[0]
end

.extract_species_vec(entry) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def extract_species_vec(entry)
  entry[1].unpack(VAL_SPECIES_FMT)[0]
end

.extract_text_size(entry) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



51
52
53
# File 'lib/bio/maf/index.rb', line 51

def extract_text_size(entry)
  entry[1].unpack(VAL_TEXT_SIZE_FMT)[0]
end

.unpack_key(ks) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



55
56
57
# File 'lib/bio/maf/index.rb', line 55

def unpack_key(ks)
  ks.unpack(KEY_FMT)
end