Class: Bio::PolyploidTools::ChromosomeArm

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/PolyploidTools/ChromosomeArm.rb

Constant Summary collapse

@@arm_selection_functions =
Hash.new

Class Method Summary collapse

Class Method Details

.getArmSelection(name) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/bio/PolyploidTools/ChromosomeArm.rb', line 42

def self.getArmSelection(name)
  arr = name.split(",")
  if arr.size == 2
     @@arm_selection_functions[name.to_sym] = lambda do |contig_name|
        separator, field = arr
        field = field.to_i
        ret = contig_name.split(separator)[field]
        return ret
      end
  end
  @@arm_selection_functions[name.to_sym]
end

.getValidFunctionsObject



55
56
57
58
59
# File 'lib/bio/PolyploidTools/ChromosomeArm.rb', line 55

def self.getValidFunctions
  tmp = @@arm_selection_functions.keys.map { |e| e.to_s }
  tmp.unshift "<sep>,<index>"
  tmp
end