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 +4 -4
- data/lib/sushi_fabric/sushiApp.rb +30 -13
- 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: f9006b34b7600a8d1eadd5016f972427a3b879c33773e71b73f824252c238e2c
|
4
|
+
data.tar.gz: 1211f6f928b02c9cb3257a000f13a57685dbabca9d947dfa8b3d3e0fea105c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = '
|
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
|
393
|
-
command_out = %x[ bash -lc "source #{@module_source}; module whatis #{
|
394
|
-
|
395
|
-
command_out.split("\n").each do |
|
396
|
-
|
397
|
-
|
398
|
-
|
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
|
-
|
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
|
422
|
-
modules_with_version.
|
423
|
-
|
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
|
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: 0.
|
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-
|
11
|
+
date: 2020-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|