Class: CagnutGatk::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/cagnut_gatk/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#analyze_covariates_paramsObject

Returns the value of attribute analyze_covariates_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def analyze_covariates_params
  @analyze_covariates_params
end

#base_recalibrator_paramsObject

Returns the value of attribute base_recalibrator_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def base_recalibrator_params
  @base_recalibrator_params
end

#count_reads_paramsObject

Returns the value of attribute count_reads_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def count_reads_params
  @count_reads_params
end

#depth_of_coverage_paramsObject

Returns the value of attribute depth_of_coverage_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def depth_of_coverage_params
  @depth_of_coverage_params
end

#haplotype_caller_paramsObject

Returns the value of attribute haplotype_caller_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def haplotype_caller_params
  @haplotype_caller_params
end

#indel_realigner_paramsObject

Returns the value of attribute indel_realigner_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def indel_realigner_params
  @indel_realigner_params
end

Returns the value of attribute print_reads_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def print_reads_params
  @print_reads_params
end

#realigner_target_creator_paramsObject

Returns the value of attribute realigner_target_creator_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def realigner_target_creator_params
  @realigner_target_creator_params
end

#unified_genotyper_paramsObject

Returns the value of attribute unified_genotyper_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def unified_genotyper_params
  @unified_genotyper_params
end

#variant_eval_paramsObject

Returns the value of attribute variant_eval_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def variant_eval_params
  @variant_eval_params
end

#variant_filtration_paramsObject

Returns the value of attribute variant_filtration_params.



7
8
9
# File 'lib/cagnut_gatk/configuration.rb', line 7

def variant_filtration_params
  @variant_filtration_params
end

Class Method Details

.load(config, params) ⇒ Object



15
16
17
# File 'lib/cagnut_gatk/configuration.rb', line 15

def load config, params
  instance.load config, params
end

Instance Method Details

#add_java_params(method_params, verbose = false) ⇒ Object



44
45
46
47
48
49
50
51
52
53
# File 'lib/cagnut_gatk/configuration.rb', line 44

def add_java_params method_params, verbose=false
  return if method_params.blank?
  array = method_params['java'].dup
  array << "-verbose:sizes" if verbose
  array << "-jar #{@config['tools']['gatk']}"
  {
    'java' => array,
    'params' => method_params['params']
  }
end

#attributesObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/cagnut_gatk/configuration.rb', line 28

def attributes
  {
    analyze_covariates_params: add_java_params(@params['analyze_covariates']),
    base_recalibrator_params: add_java_params(@params['base_recalibrator']),
    count_reads_params: add_java_params(@params['count_reads']),
    depth_of_coverage_params: add_java_params(@params['depth_of_coverage'], true),
    haplotype_caller_params: add_java_params(@params['haplotype_caller']),
    indel_realigner_params: add_java_params(@params['indel_realigner']),
    print_reads_params: add_java_params(@params['print_reads']),
    realigner_target_creator_params: add_java_params(@params['realigner_target_creator']),
    unified_genotyper_params: add_java_params(@params['unified_genotyper']),
    variant_eval_params: add_java_params(@params['variant_eval']),
    variant_filtration_params: add_java_params(@params['variant_filtration'])
  }
end

#load(config, params) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/cagnut_gatk/configuration.rb', line 20

def load config, params
  @config = config
  @params = params
  attributes.each do |name, value|
    send "#{name}=", value if respond_to? "#{name}="
  end
end