sushi_fabric 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5979375fed31ca635c84b55e996d5fc40254c3de
4
- data.tar.gz: 9814016fb3137614502cc9a34fc2e041d6e6e85a
3
+ metadata.gz: ed4f8e395298758aef808482287e2bf1c5a0bcfe
4
+ data.tar.gz: d97617cc762c64bf0835cb76a31a6a1dacd51e43
5
5
  SHA512:
6
- metadata.gz: 42a57301a53a0bd6ea81c66302d38658e4516095853740c279e6abca13c774270f2ab3935e02be1e7aa8f25abfafc62e1f5128953383c18ff7cbf7275637bf89
7
- data.tar.gz: 6f152feb2f8466f42c8914591059d406a4873c5030572d6dd4216168f5aa3fa192a8cf907786a3fa9f33cecdb947841fb6450ace952974d64e0e3df9785dc0c0
6
+ metadata.gz: 6ced57e208f262dd3c0018d5fb2f100961c10fd420a0d23b7330f93a9b6898cd5a2159775b81d313719f92549b0b66e4c22d36aff2a6c7281743d30f28eced28
7
+ data.tar.gz: d369c6a5bbaebaeff3b7b2522544cec99b5e092e1b9c3f4b6900a398e4be736327d1f90728103e4011f2c05f9b3498af030c003f4f6c8af891785b6549b80091
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20170324-161522'
3
+ # Version = '20170410-034927'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -17,6 +17,7 @@ module SushiFabric
17
17
  config.gstore_dir = File.join(default_root, 'public/gstore/projects')
18
18
  config.sushi_app_dir = default_root
19
19
  config.scratch_dir = '/tmp/scratch'
20
+ config.module_source = nil
20
21
  end
21
22
 
22
23
  # load custmized parameters if there is
@@ -35,6 +36,7 @@ module SushiFabric
35
36
  config.gstore_dir = File.join(#{default_root}, 'public/gstore/projects')
36
37
  config.sushi_app_dir = #{default_root}
37
38
  config.scratch_dir = '/tmp/scratch'
39
+ config.module_source = nil
38
40
  end
39
41
  end
40
42
  EOF
@@ -46,6 +48,7 @@ end
46
48
  GSTORE_DIR = config.gstore_dir
47
49
  SUSHI_APP_DIR = config.sushi_app_dir
48
50
  SCRATCH_DIR = config.scratch_dir
51
+ MODULE_SOURCE = config.module_source
49
52
 
50
53
  unless File.exist?(GSTORE_DIR)
51
54
  FileUtils.mkdir_p GSTORE_DIR
@@ -192,6 +195,7 @@ class SushiApp
192
195
  attr_reader :analysis_category
193
196
  attr_reader :description
194
197
  attr_reader :name
198
+ attr_reader :modules
195
199
  attr_accessor :dataset_tsv_file
196
200
  attr_accessor :parameterset_tsv_file
197
201
  attr_accessor :dataset_sushi_id
@@ -217,6 +221,8 @@ class SushiApp
217
221
  @params['process_mode'] = 'SAMPLE'
218
222
  @job_ids = []
219
223
  @required_columns = []
224
+ @module_source = MODULE_SOURCE
225
+ @modules = []
220
226
  #@workflow_manager = workflow_manager_instance||DRbObject.new_with_uri(WORKFLOW_MANAGER)
221
227
  end
222
228
  def set_input_dataset
@@ -360,6 +366,20 @@ class SushiApp
360
366
  FileUtils.mkdir_p(@scratch_result_dir)
361
367
  FileUtils.mkdir_p(@job_script_dir)
362
368
  end
369
+ def check_latest_module_version(mod)
370
+ command = "module whatis #{mod}"
371
+ IO.popen(command) do |io|
372
+ latest_mod = nil
373
+ while line = io.gets
374
+ unless line.chomp.strip.empty?
375
+ latest_mod = line.split.first
376
+ break
377
+ end
378
+ end
379
+ end
380
+ latest_mod = nil if latest_mod == "Failed"
381
+ latest_mod
382
+ end
363
383
  def job_header
364
384
  @scratch_dir = if @params['process_mode'] == 'SAMPLE'
365
385
  @scratch_result_dir + "_" + @dataset['Name'] + '_temp$$'
@@ -372,6 +392,19 @@ class SushiApp
372
392
  else
373
393
  ''
374
394
  end
395
+ module_src_command = if @module_source and @modules and !@modules.empty?
396
+ "source #{@module_source}"
397
+ else
398
+ ""
399
+ end
400
+ module_add_commands = if @modules and !@modules.empty?
401
+ #modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
402
+ #modules_with_version.compact!
403
+ #"module add #{modules_with_version.join(' ')}"
404
+ "module add #{@modules.join(' ')}"
405
+ else
406
+ ""
407
+ end
375
408
  @out.print <<-EOF
376
409
  #!/bin/bash
377
410
  #{hold_jid_option}
@@ -386,6 +419,8 @@ echo "Job runs on `hostname`"
386
419
  echo "at $SCRATCH_DIR"
387
420
  mkdir $SCRATCH_DIR || exit 1
388
421
  cd $SCRATCH_DIR || exit 1
422
+ #{module_src_command}
423
+ #{module_add_commands}
389
424
 
390
425
  EOF
391
426
  end
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sushi_fabric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Functional Genomics Center Zurich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler