sushi_fabric 1.0.0 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 795af5bedd1d25f2f6c41bcab16b699b015df28615ff1ef5a975f330ba8f7255
4
- data.tar.gz: ebc667d556828450ae331a4e63ed07bde0b4871b97d18747bc71ff6e407f185a
3
+ metadata.gz: 9fdb24b4bbe247b331be53dd1a57f117e3c44dccd12a52686fc4533e17222451
4
+ data.tar.gz: 30b5cc93c26df8e4a5ce07196774e27d9576ec94f13f95d5286e3acbe40f8c73
5
5
  SHA512:
6
- metadata.gz: 6ae60c4d4acef1444c9b1bfdb11f2dc6455add3414cfc63412603051d992c402c67037c45ff136b905ac2166100e36fa3f1e3c8d313cea80bc24c31a3b7f2577
7
- data.tar.gz: 8a046912e3b798e662b9e1131d5a0151f36cbb83e4eb986c9827dff6e410e1910c2965d383daba7a1dc9a5798f08c566feb72bb3c812cbdcbf1f7fe9d4cf575d
6
+ metadata.gz: 6401d7f668742a1b66dba932c5adb70e8cf82d37da5d57cb3009798aedd32c017a2c6bc63d5a4e1fe8705b53de271c96610306f91f826d36a616e0e3ed0b1208
7
+ data.tar.gz: 5ac2a7cd2b3269b998f9edcf0714b91c904c51a53aecdd658d8d361c59539d6956eb4b932424e77691a38308149bf5858fef2405e88c4798738ebac4af8dccbb
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20200724-120813'
3
+ # Version = '20210121-101344'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -238,6 +238,7 @@ class SushiApp
238
238
  @params['scratch'] = nil
239
239
  @params['node'] = ''
240
240
  @params['queue'] = ''
241
+ @params['partition'] = ''
241
242
  @params['process_mode'] = 'SAMPLE'
242
243
  @params['samples'] = ''
243
244
  @job_ids = []
@@ -390,16 +391,18 @@ class SushiApp
390
391
  FileUtils.mkdir_p(@scratch_result_dir)
391
392
  FileUtils.mkdir_p(@job_script_dir)
392
393
  end
393
- def check_latest_module_version(mod)
394
- command_out = %x[ bash -lc "source #{@module_source}; module whatis #{mod} 2>&1" ]
395
- latest_mod = nil
396
- command_out.split("\n").each do |line|
397
- if line =~ /#{mod}/
398
- latest_mod = line.split.first
399
- break
394
+ def check_latest_modules_version(modules)
395
+ command_out = %x[ bash -lc "source #{@module_source}; module whatis #{modules.join(" ")} 2>&1" | cut -f 1 -d " " | uniq ]
396
+ latest_modules = []
397
+ command_out.split("\n").each do |line_|
398
+ line = line_.chomp
399
+ unless line.empty?
400
+ if line =~ /#{modules.join("|")}/
401
+ latest_modules << line
402
+ end
400
403
  end
401
404
  end
402
- latest_mod
405
+ latest_modules
403
406
  end
404
407
  def job_header
405
408
  @scratch_dir = if @params['process_mode'] == 'SAMPLE'
@@ -408,8 +411,8 @@ class SushiApp
408
411
  @scratch_result_dir + '_temp$$'
409
412
  end
410
413
  hold_jid_option = if @dataset_sushi_id and parent_data_set = DataSet.find_by_id(@dataset_sushi_id.to_i) and !parent_data_set.jobs.empty?
411
- parent_data_set_job_ids = parent_data_set.jobs.map{|job| job.submit_job_id}.join(",")
412
- "#\$ -hold_jid #{parent_data_set_job_ids}"
414
+ parent_data_set_job_ids = parent_data_set.jobs.map{|job| job.submit_job_id}.join(":")
415
+ "#SBATCH --dependency=afterany:#{parent_data_set_job_ids}"
413
416
  else
414
417
  ''
415
418
  end
@@ -419,9 +422,17 @@ class SushiApp
419
422
  ""
420
423
  end
421
424
  module_add_commands = if @modules and !@modules.empty?
422
- modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
423
- modules_with_version.compact!
424
- "module add #{modules_with_version.join(' ')}"
425
+ modules_with_version = check_latest_modules_version(@modules)
426
+ if @modules.length == modules_with_version.length
427
+ modules_with_version.compact!
428
+ "module add #{modules_with_version.join(' ')}"
429
+ else
430
+ @logger.error("#"*100)
431
+ @logger.error("# Error in checking modules ")
432
+ @logger.error("# Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}")
433
+ @logger.error("#"*100)
434
+ "exit # Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}"
435
+ end
425
436
  else
426
437
  ""
427
438
  end
@@ -484,6 +495,7 @@ rm -rf #{@scratch_dir} || exit 1
484
495
  gsub_options = []
485
496
  gsub_options << "-c #{@params['cores']}" unless @params['cores'].to_s.empty?
486
497
  gsub_options << "-n #{@params['node']}" unless @params['node'].to_s.empty?
498
+ gsub_options << "-p #{@params['partition']}" unless @params['partition'].to_s.empty?
487
499
  gsub_options << "-r #{@params['ram']}" unless @params['ram'].to_s.empty?
488
500
  gsub_options << "-s #{@params['scratch']}" unless @params['scratch'].to_s.empty?
489
501
  command = "wfm_monitoring --server #{WORKFLOW_MANAGER} --user #{@user} --project #{@project.gsub(/p/,'')} --logdir #{@gstore_script_dir} #{job_script} #{gsub_options.join(' ')}"
@@ -852,17 +864,7 @@ rm -rf #{@scratch_dir} || exit 1
852
864
  save_parameters_as_tsv
853
865
  save_input_dataset_as_tsv
854
866
 
855
- if SushiFabric::Application.config.fgcz?
856
- # this causes sqlite3 IO error in Mac OSX (Yosemite)
857
- pid = Process.fork do
858
- Process.fork do
859
- main
860
- end # grand-child process
861
- end # child process
862
- Process.waitpid pid
863
- else
864
- main
865
- end
867
+ main
866
868
  end
867
869
  def make_dummy_files
868
870
  dummy_files_header = []
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.5"
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: 1.0.0
4
+ version: 1.0.5
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: 2020-07-24 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler