Class: PreprocJobGenerator

Inherits:
JobGenerator show all
Defined in:
lib/generators/preproc_job_generator.rb

Overview

A class for parsing a data directory and creating a default Preprocessing Job Intialize a PreprocJobGenerator with a config hash including the following optional keys:

  • scans : A hash of scans upon which to base preprocessing.

    Used to extract the correct bold reps for SPM.
    See #ReconJobGenerator for options for the scans hash.
    

Instance Attribute Summary

Attributes inherited from JobGenerator

#previous_step, #spec

Instance Method Summary collapse

Methods inherited from JobGenerator

#config_requires, #spec_validates

Constructor Details

#initialize(config = {}) ⇒ PreprocJobGenerator

Returns a new instance of PreprocJobGenerator.



13
14
15
16
17
18
19
20
# File 'lib/generators/preproc_job_generator.rb', line 13

def initialize(config = {})
  config_defaults = {}
  super config_defaults.merge(config)
  
  @spec['step'] = 'preprocess'
  
  config_requires 'scans'
end

Instance Method Details

#buildObject

Build a job spec and return it.



23
24
25
26
27
28
29
30
# File 'lib/generators/preproc_job_generator.rb', line 23

def build
  bold_reps = []
  @spec['bold_reps'] = @config['scans'].collect do |scan| 
    scan['bold_reps'] - scan['volumes_to_skip']
  end
  
  return @spec
end