seqtrimnext 2.0.61 → 2.0.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ccbee45f33fe72b0b26f542ec15a54e16e91090
4
- data.tar.gz: d3637c75263534e59c4a4fc3f2175b15eb7745ac
3
+ metadata.gz: 1fb6845331e9b46e2a53f29312fce204869a91cf
4
+ data.tar.gz: 18d138fe1b899582daae2e4118cd6118853afc29
5
5
  SHA512:
6
- metadata.gz: b76e76001e951d7e1d104e59dd20042cd50274ed313e8531620962a639c8f294cdd9eb7c558f4e79a336a9f58d1d87e5357c21c4ddb2129cdb4d5048ff7a97ce
7
- data.tar.gz: e19042628ff07b65c4fd08c11b719175e1656a343d10e7811a434fbd8d6923f2a2b0060f8c74fec894e2a09e82d7a35fcad4b4aa074e63516d399c163554163c
6
+ metadata.gz: d22ad436ce0b15ff783d15b871491adaa5947f9c1da4a7247712f7d6e9e790978ad90ab22657dc7768b51a61d6122f874c7853e9d0279f0dd408702a681ca5f0
7
+ data.tar.gz: 67d4af5e0bb8dc2eba127b6fe1ff04684c7b96db3fbad9e94cb6a222d88d4da3b5b5fd204022f70c0e14d2511ae476a7814f3ec32d21900c73f2370462207faa
@@ -27,29 +27,40 @@ ARGV.each do |file_path|
27
27
  stats=JSON::parse(File.read(file_path))
28
28
 
29
29
  res={}
30
+
31
+ total=0
32
+
30
33
 
31
34
  begin
32
35
  stats.keys.each do |k|
33
36
  if stats[k]['execution_time']
34
37
  res[k]=stats[k]['execution_time']['total_seconds']
38
+ total+=res[k]
35
39
  end
36
40
  end
41
+
42
+ res["TOTAL_plugins"]=total
37
43
 
38
44
  rescue Excepcion => e
39
45
 
40
46
  puts "Error reading #{file_path}"
41
47
  end
42
48
 
49
+ if stats['scbi_mapreduce']
50
+ res['TOTAL_workers']=stats['scbi_mapreduce']['connected_workers']
51
+ res['TOTAL_read']=stats['scbi_mapreduce']['total_read_time']
52
+ res['TOTAL_write']=stats['scbi_mapreduce']['total_write_time']
53
+ res['TOTAL_manager_idle']=stats['scbi_mapreduce']['total_manager_idle_time']
54
+ res['TOTAL_execution']=stats['scbi_mapreduce']['total_seconds']
55
+ end
56
+
43
57
  if puts_json
44
58
  puts JSON::pretty_generate(res)
45
59
  else
46
- total=0
47
60
  res.keys.sort.each do |k|
48
61
  puts "#{k}\t#{res[k]}"
49
- total+=res[k]
50
62
  end
51
- puts "-"*20
52
- puts "TOTAL (plugins):\t#{total}"
53
63
  end
64
+
54
65
  end
55
66
 
data/bin/seqtrimnext CHANGED
@@ -362,6 +362,7 @@ $LOG.datetime_format = "%Y-%m-%d %H:%M:%S"
362
362
  #DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
363
363
 
364
364
  $LOG.info("SeqTrimNext version #{Seqtrimnext::SEQTRIM_VERSION}")
365
+ $LOG.info("STN command: #{$0}")
365
366
 
366
367
 
367
368
  $LOG.info("Using BLASTDB: "+ $FORMATTED_DB_PATH)
@@ -0,0 +1,21 @@
1
+ require "seqtrim_action"
2
+
3
+ ########################################################
4
+ # Author: Dario Guerrero
5
+ #
6
+ # Defines the main methods that are necessary to execute Plugin1
7
+ # Inherit: Plugin
8
+ ########################################################
9
+
10
+ class ActionTrim < SeqtrimAction
11
+ def initialize(start_pos,end_pos)
12
+
13
+ super(start_pos,end_pos)
14
+ @cut =true
15
+ end
16
+
17
+ def apply_decoration(char)
18
+ return char.red.italic
19
+ end
20
+
21
+ end
@@ -87,13 +87,6 @@ class SeqtrimWorkManager < ScbiMapreduce::WorkManager
87
87
 
88
88
  def self.end_work_manager
89
89
 
90
- puts "FULL STATS:\n" +JSON.pretty_generate(@@full_stats)
91
-
92
- # create stats file
93
- f = File.open(STATS_PATH,'w')
94
- f.puts JSON.pretty_generate(@@full_stats)
95
- f.close
96
-
97
90
  # if initial files doesn't exists, create it
98
91
  if !File.exists?(File.join(OUTPUT_PATH,'initial_stats.json'))
99
92
  File.open(File.join(OUTPUT_PATH,'initial_stats.json'),'w') do |f|
@@ -102,10 +95,10 @@ class SeqtrimWorkManager < ScbiMapreduce::WorkManager
102
95
  end
103
96
 
104
97
  # load stats
105
- r=File.read(STATS_PATH)
106
- stats=JSON::parse(r)
107
-
98
+ #r=File.read(STATS_PATH)
99
+ #stats=JSON::parse(r)
108
100
 
101
+ stats=@@full_stats
109
102
 
110
103
  # make graphs
111
104
  gs=GraphStats.new(stats)
@@ -120,11 +113,18 @@ class SeqtrimWorkManager < ScbiMapreduce::WorkManager
120
113
  file.close
121
114
  end
122
115
 
123
- if File.exists?('scbi_drb_checkpoint')
124
- File.delete('scbi_drb_checkpoint')
125
- end
126
116
  end
127
117
 
118
+ def self.work_manager_finished
119
+ @@full_stats['scbi_mapreduce']=@@stats
120
+
121
+ puts "FULL STATS:\n" +JSON.pretty_generate(@@full_stats)
122
+
123
+ # create stats file
124
+ f = File.open(STATS_PATH,'w')
125
+ f.puts JSON.pretty_generate(@@full_stats)
126
+ f.close
127
+ end
128
128
 
129
129
  def error_received(worker_error, obj)
130
130
  @@errors_file.puts "Error while processing object #{obj.inspect}\n" + worker_error.original_exception.message + ":\n" +worker_error.original_exception.backtrace.join("\n")
@@ -82,6 +82,7 @@ class SeqtrimWorker < ScbiMapreduce::Worker
82
82
 
83
83
  # $WORKER_LOG.level = Logger::ERROR
84
84
  $WORKER_LOG.level = Logger::WARN
85
+ #$WORKER_LOG.level = Logger::INFO
85
86
  $WORKER_LOG.info "Loading actions"
86
87
 
87
88
  @action_manager = ActionManager.new
@@ -362,6 +362,7 @@ class Seqtrim
362
362
  server.retry_stuck_jobs=true
363
363
  server.start_server
364
364
 
365
+
365
366
  # close sequence reader
366
367
  sequence_readers.each do |file|
367
368
  file.close
@@ -35,6 +35,9 @@ class Plugin
35
35
  return true
36
36
  end
37
37
 
38
+ def exec_seq(seq,blast_query)
39
+ end
40
+
38
41
  #Begins the plugin's execution whit the sequence "seq"
39
42
  def execute(seqs)
40
43
  blasts=do_blasts(seqs)
@@ -0,0 +1,58 @@
1
+ require "plugin"
2
+
3
+ ########################################################
4
+ # Author: Dario Guerrero
5
+ #
6
+ # Defines the main methods that are necessary to execute PluginSizeTrim
7
+ # Inherit: Plugin
8
+ # Trims the output sequences to a fixed size
9
+ ########################################################
10
+
11
+ class PluginSizeTrim < Plugin
12
+
13
+ def exec_seq(seq,blast_query)
14
+ #$LOG.debug "[#{self.class.to_s}, seq: #{seq.seq_name}]: checking if insert of sequence has enought size"
15
+ # puts "inserto #{seq.insert_start}, #{seq.insert_end} size #{seq.seq_fasta.size}"
16
+
17
+
18
+ tr_size = @params.get_param('trim_size_file_'+(seq.order_in_tuple+1).to_s)
19
+
20
+ trim_size=-1
21
+
22
+ if tr_size
23
+ trim_size=tr_size.to_i
24
+ end
25
+
26
+ # $WORKER_LOG.info "TRIM_SIZE=#{trim_size}, #{seq.order_in_tuple+1}"
27
+
28
+ if trim_size>0
29
+
30
+ if (seq.seq_fasta.size > trim_size)
31
+ a_beg,a_end = trim_size, seq.seq_fasta.size # position from an empty insert
32
+
33
+ actions=[]
34
+
35
+ type = "ActionTrim"
36
+
37
+ a=seq.new_action(a_beg,a_end,type)
38
+ actions.push a
39
+ add_stats('trim_sizes',a_end-a_beg+1)
40
+
41
+ seq.add_actions(actions)
42
+ end
43
+ end
44
+
45
+ end
46
+
47
+ #Returns an array with the errors due to parameters are missing
48
+ def self.check_params(params)
49
+ errors=[]
50
+
51
+ self.check_param(errors,params,'trim_size_file_1','Integer',-1)
52
+ self.check_param(errors,params,'trim_size_file_2','Integer',-1)
53
+
54
+ return errors
55
+ end
56
+
57
+
58
+ end
@@ -1,4 +1,4 @@
1
1
  module Seqtrimnext
2
- VERSION = "2.0.61"
2
+ VERSION = "2.0.62"
3
3
  SEQTRIM_VERSION = VERSION
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seqtrimnext
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.61
4
+ version: 2.0.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dario Guerrero
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-19 00:00:00.000000000 Z
12
+ date: 2016-01-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -288,6 +288,7 @@ files:
288
288
  - lib/seqtrimnext/actions/action_sanger_left_adapter.rb
289
289
  - lib/seqtrimnext/actions/action_sanger_right_adapter.rb
290
290
  - lib/seqtrimnext/actions/action_short_insert.rb
291
+ - lib/seqtrimnext/actions/action_trim.rb
291
292
  - lib/seqtrimnext/actions/action_unexpected_poly_t.rb
292
293
  - lib/seqtrimnext/actions/action_unexpected_vector.rb
293
294
  - lib/seqtrimnext/actions/action_user_contaminant.rb
@@ -331,6 +332,7 @@ files:
331
332
  - lib/seqtrimnext/plugins/plugin_mids.rb
332
333
  - lib/seqtrimnext/plugins/plugin_sanger_adapters.rb
333
334
  - lib/seqtrimnext/plugins/plugin_short_insert.rb
335
+ - lib/seqtrimnext/plugins/plugin_size_trim.rb
334
336
  - lib/seqtrimnext/plugins/plugin_user_contaminants.rb
335
337
  - lib/seqtrimnext/plugins/plugin_vectors.rb
336
338
  - lib/seqtrimnext/plugins_old/.DS_Store