sushi_fabric 0.9.9 → 1.0.4

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: 379a56d5261eb7ed21137bd452583eb76e416cf774c987628b0d1c847bed6040
4
- data.tar.gz: b68363a7da5c166ab7c38d8310b9d151ce490a1d3d4f6d48bdfa5a3484c0abf1
3
+ metadata.gz: 3a9c780f513fc42be122da7a0cb97e5e8c4a70e84af98ea746964a5b7853f1c5
4
+ data.tar.gz: 4d14ca10808dbee2401088cc885d77ac2c4040ca73a984993f833b42d049ade8
5
5
  SHA512:
6
- metadata.gz: 15cbf3c8954c15999a91a5ab0e0f53dffc9a2ded3ecc5b0633e1d31c6480102cf44e245c94735c2d52251bdbc58c6262c7070b0b9853e7048659dbd5135130e9
7
- data.tar.gz: b936c6a57a6683b1a19874627eb9bc4ba1719d0664f85794e4ee9d0face5eba3d424e06fd60158afbb53dc9b3b1c9b1330e94fdacdc17262f64ed1fdd1310eac
6
+ metadata.gz: 8639f58865956062ecd97f269dd426c2674ada7d602850520b323370150b50e99cfed4a5a60e67fa001fbd9035a806a4ef426f1b7db03fb5312a0fa5d36a412e
7
+ data.tar.gz: 0d2f463786f8397c73cba8026cd2b1ac0f4a1fbda5252ca598c39f4aaf81d25c1d6d6c9020739f2c31ecee59857ee5d09ace1f4f9a1aa675694c4cf932273b59
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20200724-111508'
3
+ # Version = '20210115-105702'
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'
@@ -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
@@ -448,6 +459,13 @@ cd $SCRATCH_DIR || exit 1
448
459
  end
449
460
  def job_footer
450
461
  @out.print "#### JOB IS DONE WE PUT THINGS IN PLACE AND CLEAN AUP\n"
462
+ if File.exist?("/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh")
463
+ @out.print <<-EOS
464
+ . "/usr/local/ngseq/miniconda3/etc/profile.d/conda.sh"
465
+ conda activate sushi
466
+ EOS
467
+ end
468
+
451
469
  if @output_files
452
470
  @output_files.map{|header| next_dataset[header]}.each do |file|
453
471
  # in actual case, to save under /srv/gstore/
@@ -477,6 +495,7 @@ rm -rf #{@scratch_dir} || exit 1
477
495
  gsub_options = []
478
496
  gsub_options << "-c #{@params['cores']}" unless @params['cores'].to_s.empty?
479
497
  gsub_options << "-n #{@params['node']}" unless @params['node'].to_s.empty?
498
+ gsub_options << "-p #{@params['partition']}" unless @params['partition'].to_s.empty?
480
499
  gsub_options << "-r #{@params['ram']}" unless @params['ram'].to_s.empty?
481
500
  gsub_options << "-s #{@params['scratch']}" unless @params['scratch'].to_s.empty?
482
501
  command = "wfm_monitoring --server #{WORKFLOW_MANAGER} --user #{@user} --project #{@project.gsub(/p/,'')} --logdir #{@gstore_script_dir} #{job_script} #{gsub_options.join(' ')}"
@@ -845,17 +864,7 @@ rm -rf #{@scratch_dir} || exit 1
845
864
  save_parameters_as_tsv
846
865
  save_input_dataset_as_tsv
847
866
 
848
- if SushiFabric::Application.config.fgcz?
849
- # this causes sqlite3 IO error in Mac OSX (Yosemite)
850
- pid = Process.fork do
851
- Process.fork do
852
- main
853
- end # grand-child process
854
- end # child process
855
- Process.waitpid pid
856
- else
857
- main
858
- end
867
+ main
859
868
  end
860
869
  def make_dummy_files
861
870
  dummy_files_header = []
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "0.9.9"
2
+ VERSION = "1.0.4"
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.9
4
+ version: 1.0.4
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-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler