seqtrimnext_report 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ === 0.0.5 2012-03-01
2
+
3
+ Fixed bug with report generation
4
+
5
+ === 0.0.4 2011-07-14
6
+
7
+ Added extra rejected causes
8
+
1
9
  === 0.0.3 2011-06-16
2
10
 
3
11
  Corrected errors with empty plugins
@@ -6,7 +6,6 @@
6
6
  ROOT_PATH=File.dirname(File.dirname(__FILE__))
7
7
  # $: << File.expand_path(File.join(ROOT_PATH, 'lib','seqtrimnext_report','classes'))
8
8
  # $: << File.expand_path(File.join(ROOT_PATH, 'lib'))
9
-
10
9
  # $: << '/Users/dariogf/progs/ruby/gems/seqtrimnext/lib'
11
10
 
12
11
  #---------------------------------------------- gems
@@ -47,6 +46,7 @@ end
47
46
 
48
47
  #---------------------------------------------- check if files exists
49
48
  output_files=ARGV.shift
49
+
50
50
  if !Dir.exists?(output_files)
51
51
  puts "Directory #{output_files} doesn't exists"
52
52
  exit(-1)
@@ -8,5 +8,5 @@ ROOT_PATH=File.join(File.dirname(__FILE__),'seqtrimnext_report')
8
8
  $: << File.expand_path(File.join(ROOT_PATH, 'classes'))
9
9
 
10
10
  module SeqtrimnextReport
11
- VERSION = '0.0.3'
11
+ VERSION = '0.0.5'
12
12
  end
@@ -32,8 +32,7 @@ class RejectedReport
32
32
  rejected_hash['rejected']=data_hash
33
33
 
34
34
  if (!stats['sequences']['rejected'].nil?)
35
- rejected_hash = load_plugins_info(stats, rejected_hash, input_seqs, plugin_fix_hash)
36
-
35
+ rejected_hash2 = load_plugins_info(stats, rejected_hash, input_seqs, plugin_fix_hash)
37
36
  #-------------------------------------------------- build table
38
37
  output3.puts '\begin{table}[H]'
39
38
  output3.puts '\begin{center}'
@@ -66,7 +65,7 @@ class RejectedReport
66
65
  output3.puts '\hline'
67
66
 
68
67
  #the hash of hashes is ordered by value (number of sequences rejected)
69
- rejected_ordered = rejected_hash.sort {|a,b| b[1]['value']<=>a[1]['value']}
68
+ rejected_ordered = rejected_hash2.sort {|a,b| b[1]['value']<=>a[1]['value']}
70
69
 
71
70
  rejected_ordered.each do |plugin|
72
71
 
@@ -75,12 +74,7 @@ class RejectedReport
75
74
  my_percent = plugin[1]['percent']
76
75
  my_warning = plugin[1]['warning']
77
76
 
78
- if (plugin[0] != 'rejected')
79
- if (plugin[0] == 'Indeterminations in middle of sequence')
80
- plugin[0] = plugin[0].sub(' in middle of sequence','')
81
- end
82
- output3.puts "#{my_name}&#{my_value}&#{my_percent} \\%&#{my_warning}\\\\"
83
- end
77
+ output3.puts "#{my_name}&#{my_value}&#{my_percent} \\%&#{my_warning}\\\\"
84
78
  end
85
79
 
86
80
  output3.puts '\hline'
@@ -94,8 +88,10 @@ class RejectedReport
94
88
 
95
89
  rejected_ordered.each do |plugin|
96
90
  if (plugin[1]['warning'] != 'OK')
97
- plugin[1]['warning_msg'].gsub!('my_percent',"#{rejected_hash["#{plugin[0]}"]['percent']}")
98
- output3.puts '\noindent\fcolorbox{black}{yellow}{'+"\n"+'\begin{minipage}{\linewidth}{'+"\n"+'\textbf{'+"#{plugin[1]['warning']} #{plugin[1]['warning_msg']}"+'}'+"\n"+'}'+"\n"+'\end{minipage}'+"\n"+'}\\\\\\\\'
91
+ if (!rejected_hash2[plugin[0]].nil?)
92
+ plugin[1]['warning_msg'].gsub!('my_percent',"#{rejected_hash2["#{plugin[0]}"]['percent']}")
93
+ output3.puts '\noindent\fcolorbox{black}{yellow}{'+"\n"+'\begin{minipage}{\linewidth}{'+"\n"+'\textbf{'+"#{plugin[1]['warning']} #{plugin[1]['warning_msg']}"+'}'+"\n"+'}'+"\n"+'\end{minipage}'+"\n"+'}\\\\\\\\'
94
+ end
99
95
  end
100
96
  end
101
97
  else
@@ -128,7 +124,6 @@ class RejectedReport
128
124
  rejected_hash[key]['warning_msg'] = plugin_fix_hash[key]['msg']
129
125
  end
130
126
  end
131
-
132
127
  return rejected_hash
133
128
  end
134
129
 
@@ -193,6 +188,13 @@ class RejectedReport
193
188
  plugin_fix_hash['Indeterminations in middle of sequence'] = msgs_hash
194
189
  msgs_hash = {}
195
190
 
191
+ msgs_hash['msg'] = "Warning!, a my_percent \\% of your sequences are too big or too small"
192
+ msgs_hash['threshold'] = 1
193
+ msgs_hash['warning'] = 'W9'
194
+
195
+ plugin_fix_hash['size out of limits'] = msgs_hash
196
+ msgs_hash = {}
197
+
196
198
  msgs_hash['msg'] = "WT Warning!, a my_percent \\% of your sequences were rejected!"
197
199
  msgs_hash['threshold'] = 25
198
200
  msgs_hash['warning'] = 'WT'
@@ -60,6 +60,12 @@
60
60
  "threshold": 0.01,
61
61
  "warning": "rdW7"
62
62
  },
63
+ "size out of limits": {
64
+ "name": "Size Out Of Limits",
65
+ "msg": "Warning!, a my_percent \\% of your sequences are too big or too small",
66
+ "threshold": 1,
67
+ "warning": "rdW9"
68
+ },
63
69
  "rejected": {
64
70
  "name": "Total Rejected",
65
71
  "msg": "Warning!, a my_percent \\% of your sequences were rejected!",
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: seqtrimnext_report
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Noe Fernandez & Dario Guerrero
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-16 00:00:00 Z
13
+ date: 2012-03-01 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: seqtrimnext