Top Level Namespace

Defined Under Namespace

Classes: BlastStringParser, KingdomDB

Constant Summary collapse

SCRIPT_NAME =
"phyta-extract"
INSTALLED_CSV =
CSV
PHYTA_VERSION =
File.new(File.join(rootpath,'VERSION')).read.chomp
QUERY_SEQ_REGEXP =

Make sure this is exactly the same as in BlastStringParser in Kingdom-Assignment

/\A(\S+)\s.*\z/
PROTEIN_TABLE_NAME =
'proteinGiToTaxonId'
NAMES_TABLE_NAME =
'names'
NODES_TABLE_NAME =
'nodes'

Instance Method Summary collapse

Instance Method Details

#table_to_set(table, header) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'bin/phyta-extract', line 5

def table_to_set(table, header)
  result = Set.new()
  table.each do |current_row|
    current = current_row[header]
    if current.nil?
      raise "Error: no entry found for header " + header.to_s + " at " + current_row.inspect
    end
    
    unless result.include?(current)
      result.add(current)
    else
      raise "Error: duplicate entry for " + current.to_s
    end
  end
  return result
end