sushi_fabric 0.9.7 → 1.0.2

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: 8ca5afb9de9e23912a2d514c547ff22d2edaf0a6c440e3663a0ac3fce59933f9
4
- data.tar.gz: 7a906efa08a1bd3ee1b33dd02ff9a4350f241042626120278b720b3b3294d013
3
+ metadata.gz: f9006b34b7600a8d1eadd5016f972427a3b879c33773e71b73f824252c238e2c
4
+ data.tar.gz: 1211f6f928b02c9cb3257a000f13a57685dbabca9d947dfa8b3d3e0fea105c57
5
5
  SHA512:
6
- metadata.gz: 482274611996c4e8c2d483088d1bcd8966d6136f849f7b77782d5ac0834556a56682fc2049f8c70da3aa48131bfa71ae13322a8e001252d4744d76787d9c2a23
7
- data.tar.gz: 561434d611bc97fe9e30a035db0f3e3b71cbec89dc767f2531e2bf1b03905030364cf1bd833a0c432cad0d184a87a6552ae90430fe03c47f272611799d35cdea
6
+ metadata.gz: 8a0d8d0cee0aba783393f144ff6eaf7f22b01e5ec9e781870bec342e7ad7bdf04fa10ecd10d49f548cd010c576e606d38b76846093314a554564eafae868ec14
7
+ data.tar.gz: e7909f64a0328680f1fd680ec1bfed5fc852c4e64876d74eff3b113cfcddabd2baf23199d89c734344dd298bea6a44c798978788269b999be953ac0f1f531d75
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20200703-164839'
3
+ # Version = '20201109-225541'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -237,6 +237,7 @@ class SushiApp
237
237
  @params['ram'] = nil
238
238
  @params['scratch'] = nil
239
239
  @params['node'] = ''
240
+ @params['queue'] = ''
240
241
  @params['process_mode'] = 'SAMPLE'
241
242
  @params['samples'] = ''
242
243
  @job_ids = []
@@ -389,16 +390,18 @@ class SushiApp
389
390
  FileUtils.mkdir_p(@scratch_result_dir)
390
391
  FileUtils.mkdir_p(@job_script_dir)
391
392
  end
392
- def check_latest_module_version(mod)
393
- command_out = %x[ bash -lc "source #{@module_source}; module whatis #{mod} 2>&1" ]
394
- latest_mod = nil
395
- command_out.split("\n").each do |line|
396
- if line =~ /#{mod}/
397
- latest_mod = line.split.first
398
- break
393
+ def check_latest_modules_version(modules)
394
+ command_out = %x[ bash -lc "source #{@module_source}; module whatis #{modules.join(" ")} 2>&1" | cut -f 1 -d " " | uniq ]
395
+ latest_modules = []
396
+ command_out.split("\n").each do |line_|
397
+ line = line_.chomp
398
+ unless line.empty?
399
+ if line =~ /#{modules.join("|")}/
400
+ latest_modules << line
401
+ end
399
402
  end
400
403
  end
401
- latest_mod
404
+ latest_modules
402
405
  end
403
406
  def job_header
404
407
  @scratch_dir = if @params['process_mode'] == 'SAMPLE'
@@ -418,9 +421,17 @@ class SushiApp
418
421
  ""
419
422
  end
420
423
  module_add_commands = if @modules and !@modules.empty?
421
- modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
422
- modules_with_version.compact!
423
- "module add #{modules_with_version.join(' ')}"
424
+ modules_with_version = check_latest_modules_version(@modules)
425
+ if @modules.length == modules_with_version.length
426
+ modules_with_version.compact!
427
+ "module add #{modules_with_version.join(' ')}"
428
+ else
429
+ @logger.error("#"*100)
430
+ @logger.error("# Error in checking modules ")
431
+ @logger.error("# Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}")
432
+ @logger.error("#"*100)
433
+ "exit # Please check if all modules are correctly installed, searched #{@modules.join(",")} but only detected #{modules_with_version.join(",")}"
434
+ end
424
435
  else
425
436
  ""
426
437
  end
@@ -447,6 +458,13 @@ cd $SCRATCH_DIR || exit 1
447
458
  end
448
459
  def job_footer
449
460
  @out.print "#### JOB IS DONE WE PUT THINGS IN PLACE AND CLEAN AUP\n"
461
+ if File.exist?("/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh")
462
+ @out.print <<-EOS
463
+ . "/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh"
464
+ conda activate sushi
465
+ EOS
466
+ end
467
+
450
468
  if @output_files
451
469
  @output_files.map{|header| next_dataset[header]}.each do |file|
452
470
  # in actual case, to save under /srv/gstore/
@@ -794,7 +812,6 @@ rm -rf #{@scratch_dir} || exit 1
794
812
  if next_dataset.workunit_id
795
813
  @job_scripts.each do |job_script|
796
814
  open(job_script, "a") do |out|
797
- out.puts "module load Dev/Python"
798
815
  out.puts "WORKUNIT_ID=#{next_dataset.workunit_id}"
799
816
  out.puts "update_resource_size -w $WORKUNIT_ID"
800
817
  end
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "0.9.7"
2
+ VERSION = "1.0.2"
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.9.7
4
+ version: 1.0.2
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-03 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler