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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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