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 +4 -4
- data/lib/sushi_fabric/sushiApp.rb +32 -23
- 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: 3a9c780f513fc42be122da7a0cb97e5e8c4a70e84af98ea746964a5b7853f1c5
|
4
|
+
data.tar.gz: 4d14ca10808dbee2401088cc885d77ac2c4040ca73a984993f833b42d049ade8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 = '
|
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
|
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'
|
@@ -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
|
@@ -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
|
-
|
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 = []
|
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.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:
|
11
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|