Class: BioDSL::SliceAlign::PosIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/BioDSL/commands/slice_align.rb

Overview

Class for indexing gapped sequence positions to non-gapped sequence positions.

Instance Method Summary collapse

Constructor Details

#initialize(entry, indels) ⇒ PosIndex

Constructor for PosIndex.

Parameters:

  • entry (BioDSL::Seq)

    Gapped sequence entry.

  • indels (String)

    String with indel alphabet.



368
369
370
371
372
# File 'lib/BioDSL/commands/slice_align.rb', line 368

def initialize(entry, indels)
  @entry  = entry
  @indels = indels
  @index  = index_positions
end

Instance Method Details

#[](pos) ⇒ Integer

Given a non-gapped sequence postion return the gapped position.

Parameters:

  • pos (Integer)

    Non-gapped sequence position.

Returns:

  • (Integer)

    Gapped sequence position



379
380
381
# File 'lib/BioDSL/commands/slice_align.rb', line 379

def [](pos)
  @index[pos]
end