Module: CagnutPicard::CheckTools

Defined in:
lib/cagnut_picard/check_tools.rb

Instance Method Summary collapse

Instance Method Details

#check_Picard(path) ⇒ Object



9
10
11
12
13
# File 'lib/cagnut_picard/check_tools.rb', line 9

def check_Picard path
  check_tool_ver 'Picard' do
    `#{@java} -jar #{path} AddOrReplaceReadGroups --version 2>&1` if path
  end
end

#check_picard_dict(ref_path) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/cagnut_picard/check_tools.rb', line 15

def check_picard_dict ref_path
  tool = 'Sequence Dictionary'
  file = ref_path.gsub '.fasta', '.dict'
  command =
    "#{@java} -jar #{@config['tools']['picard']} CreateSequenceDictionary REFERENCE=#{ref_path} OUTPUT=#{file}"
  check_ref_related file, tool, command
end


23
24
25
26
27
28
29
30
31
32
# File 'lib/cagnut_picard/check_tools.rb', line 23

def check_ref_related file, tool, command
  if File.exist?(file)
    puts "\t#{tool}: Done"
  else
    puts "\t#{tool}: Not Found!"
    puts "\tPlease execute command:"
    puts "\t\t#{command}"
    @check_completed = false
  end
end

#check_tool(tools_path, refs = nil) ⇒ Object



3
4
5
6
7
# File 'lib/cagnut_picard/check_tools.rb', line 3

def check_tool tools_path, refs=nil
  super if defined?(super)
  ver = check_Picard tools_path['picard'] if @java
  check_picard_dict refs['ref_fasta'] if !ver.blank?
end