seqtrimnext 2.0.42 → 2.0.45

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.
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ === 2.0.45 2012-03-05
2
+
3
+ Improved LowComplexity plugin to ignore low complexity regions inside low qual regions
4
+
5
+ === 2.0.44 2012-02-23
6
+
7
+ Skip output
8
+
9
+ === 2.0.43 2012-02-22
10
+
11
+ Lower logger levels
12
+
1
13
  === 2.0.42 2012-02-01
2
14
 
3
15
  Added custom cd-hit cmd parameters
data/bin/seqtrimnext CHANGED
@@ -265,6 +265,16 @@ optparse = OptionParser.new do |opts|
265
265
  opts.on( '-j', '--json', 'Save results in json file' ) do
266
266
  options[:json] = true
267
267
  end
268
+
269
+ options[:skip_output] = false
270
+ opts.on( '-K', '--no-verbose', 'Change to no verbose mode. Every sequence will not be written to output log' ) do
271
+ options[:skip_output] = true
272
+ end
273
+
274
+ options[:skip_report] = false
275
+ opts.on( '-R', '--no-report', 'Change to no verbose mode. Every sequence will not be written to output log' ) do
276
+ options[:skip_report] = true
277
+ end
268
278
 
269
279
  # This displays the help screen, all programs are
270
280
  # assumed to have this option.
@@ -300,6 +310,8 @@ $LOG.datetime_format = "%Y-%m-%d %H:%M:%S"
300
310
 
301
311
  #DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
302
312
 
313
+ $LOG.info("SeqTrimNext version #{Seqtrimnext::SEQTRIM_VERSION}")
314
+
303
315
 
304
316
  $LOG.info("Using BLASTDB: "+ $FORMATTED_DB_PATH)
305
317
  $LOG.info("Using options: "+ options.to_json)
@@ -370,13 +382,20 @@ end
370
382
 
371
383
  s = Seqtrim.new(options)
372
384
 
373
- #generate report
374
385
 
375
386
 
376
- if system("which generate_report.rb > /dev/null ")
387
+ #generate report
388
+
389
+ if !options[:skip_report] && system("which generate_report.rb > /dev/null ")
377
390
  cmd="generate_report.rb output_files 2> report_generation_errors.log"
378
391
  $LOG.info "Generating report #{cmd}"
379
392
  `#{cmd}`
380
393
  else
381
- $LOG.info "If you want a detailed report in PDF format, install the optional seqtrimnext_report gem (gem install seqtrimnext_report)"
394
+ skip_text='.'
395
+
396
+ if options[:skip_report]
397
+ skip_text=' and remove the -R option from the command line.'
398
+ end
399
+
400
+ $LOG.info "If you want a detailed report in PDF format, be sure you have installed the optional seqtrimnext_report gem (gem install seqtrimnext_report)#{skip_text}"
382
401
  end
data/lib/seqtrimnext.rb CHANGED
@@ -30,7 +30,7 @@ module Seqtrimnext
30
30
  # SEQTRIM_VERSION_STAGE = 'b'
31
31
  # SEQTRIM_VERSION = "2.0.0#{SEQTRIM_VERSION_STAGE}#{SEQTRIM_VERSION_REVISION}"
32
32
 
33
- VERSION = '2.0.42'
33
+ VERSION = '2.0.45'
34
34
 
35
35
  SEQTRIM_VERSION = VERSION
36
36
 
@@ -11,8 +11,10 @@ class ActionLowQuality < SeqtrimAction
11
11
 
12
12
  def initialize(start_pos,end_pos)
13
13
  super(start_pos,end_pos)
14
+ # esto es cut=false porque al principio el plugin lowqual estaba al inicio del pipeline y habia que dejar
15
+ # la secuencia larga para que se encontrasen los contaminantes y vectores
16
+ # Tambien esta por si un linker tiene baja calidad que pueda encontrarlo
14
17
  @cut =false
15
-
16
18
  end
17
19
 
18
20
  # def apply_to(seq)
@@ -13,11 +13,13 @@ STATS_PATH=File.join(OUTPUT_PATH,'stats.json')
13
13
 
14
14
  class SeqtrimWorkManager < ScbiMapreduce::WorkManager
15
15
 
16
- def self.init_work_manager(sequence_reader, params, chunk_size = 100, use_json=false)
16
+ def self.init_work_manager(sequence_reader, params, chunk_size = 100, use_json=false, skip_output=false)
17
17
  @@full_stats={}
18
18
  @@params= params
19
19
  @@exit = false
20
20
 
21
+ @@skip_output=skip_output
22
+
21
23
  @@chunk_size = chunk_size
22
24
 
23
25
 
@@ -173,17 +175,17 @@ class SeqtrimWorkManager < ScbiMapreduce::WorkManager
173
175
 
174
176
  # reset count stats since they are repeated by checkpointing
175
177
 
176
- # if @@full_stats['sequences'] && @@full_stats['repeated']
177
- # @@full_stats['sequences']['count']['repeated']=0
178
- # end
179
- #
180
- # if @@full_stats['sequences'] && @@full_stats['processed']
181
- # @@full_stats['sequences']['processed']['count']=0
182
- # end
183
- #
184
- # if @@full_stats['sequences'] && @@full_stats['total']
185
- # @@full_stats['sequences']['total']['count']=0
186
- # end
178
+ if @@full_stats['sequences'] && @@full_stats['repeated']
179
+ @@full_stats['sequences']['count']['repeated']=0
180
+ end
181
+
182
+ if @@full_stats['sequences'] && @@full_stats['processed']
183
+ @@full_stats['sequences']['processed']['count']=0
184
+ end
185
+
186
+ if @@full_stats['sequences'] && @@full_stats['total']
187
+ @@full_stats['sequences']['total']['count']=0
188
+ end
187
189
 
188
190
  super
189
191
  # return checkpoint
@@ -288,14 +290,16 @@ class SeqtrimWorkManager < ScbiMapreduce::WorkManager
288
290
  # end
289
291
 
290
292
  def work_received(obj)
291
-
293
+
292
294
  res = obj
293
295
 
294
296
  # collect stats
295
297
  @@full_stats.add_stats(obj.stats)
296
298
 
297
299
  # print output in screen
298
- puts obj.output_text
300
+ if !@@skip_output
301
+ puts obj.output_text
302
+ end
299
303
 
300
304
  # save results to files
301
305
  save_files(obj)
@@ -74,8 +74,11 @@ class SeqtrimWorker < ScbiMapreduce::Worker
74
74
  end
75
75
 
76
76
  def starting_worker
77
+
77
78
  # $WORKER_LOG.level = Logger::ERROR
79
+ $WORKER_LOG.level = Logger::WARN
78
80
  $WORKER_LOG.info "Loading actions"
81
+
79
82
  @action_manager = ActionManager.new
80
83
 
81
84
  $WORKER_LOG.info "Loading plugins"
@@ -137,6 +137,7 @@ class Seqtrim
137
137
  comment='Seqtrim version'
138
138
  default_value=Seqtrimnext::SEQTRIM_VERSION
139
139
  params.check_param(errors,'seqtrim_version','String',default_value,comment)
140
+
140
141
 
141
142
  if !errors.empty?
142
143
  $LOG.error 'Please, define the following global parameters in params file:'
@@ -308,7 +309,7 @@ class Seqtrim
308
309
  else
309
310
  $LOG.info 'Starting server'
310
311
 
311
- SeqtrimWorkManager.init_work_manager(sequence_reader, params,chunk_size,use_json)
312
+ SeqtrimWorkManager.init_work_manager(sequence_reader, params,chunk_size,use_json,options[:skip_output])
312
313
 
313
314
  begin
314
315
  cpus=1
@@ -54,17 +54,33 @@ class PluginLowComplexity < Plugin
54
54
  # puts found_dust.to_json
55
55
  total_dust=0
56
56
  if !dust_query.nil?
57
+ # low_quals=seq.get_actions(ActionLowQuality)
58
+
57
59
  dust_query.dust.each do |dust|
58
60
  start=dust[0]
59
61
  stop=dust[1]
60
62
  dust_size=dust[1]-dust[0]+1
61
- total_dust+=dust_size
63
+
62
64
 
63
65
  if (dust_size)>=MIN_DUST_SIZE
64
66
 
65
- a = seq.new_action(start,stop,'ActionLowComplexity')
66
- # a.left_action=true
67
- actions.push a
67
+ # check if low complexity is inside a lowqual region
68
+ # in_low_qual=false
69
+ # low_quals.each do |lq|
70
+ # if lq.contains_action?(start,stop,0)
71
+ # in_low_qual=true
72
+ # break
73
+ # end
74
+ # end
75
+
76
+ if !seq.range_inside_action_type?(start,stop,ActionLowQuality)
77
+
78
+ total_dust+=dust_size
79
+ a = seq.new_action(start,stop,'ActionLowComplexity')
80
+ # a.left_action=true
81
+ actions.push a
82
+
83
+ end
68
84
  # break
69
85
  end
70
86
  end
@@ -2,7 +2,7 @@
2
2
  # General parameters to extract Amplicons
3
3
  # ======================================
4
4
 
5
- plugin_list = PluginLowHighSize,PluginKey,PluginMids,PluginIndeterminations,PluginAbAdapters,PluginLowQuality,PluginAmplicons
5
+ plugin_list = PluginLowHighSize,PluginKey,PluginMids,PluginIndeterminations,PluginAbAdapters,PluginAmplicons,PluginLowQuality
6
6
 
7
7
  # do not remove cloned sequences
8
8
  remove_clonality=false
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: seqtrimnext
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.42
5
+ version: 2.0.45
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dario Guerrero & Almudena Bocinos
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-02-01 00:00:00 Z
13
+ date: 2012-03-05 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: narray