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 +4 -4
- data/lib/sushi_fabric/sushiApp.rb +27 -25
- data/lib/sushi_fabric/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fdb24b4bbe247b331be53dd1a57f117e3c44dccd12a52686fc4533e17222451
|
4
|
+
data.tar.gz: 30b5cc93c26df8e4a5ce07196774e27d9576ec94f13f95d5286e3acbe40f8c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = '
|
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
|
394
|
-
command_out = %x[ bash -lc "source #{@module_source}; module whatis #{
|
395
|
-
|
396
|
-
command_out.split("\n").each do |
|
397
|
-
|
398
|
-
|
399
|
-
|
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
|
-
|
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
|
-
"
|
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
|
423
|
-
modules_with_version.
|
424
|
-
|
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
|
-
|
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 = []
|
data/lib/sushi_fabric/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|