transrate 0.0.16 → 0.1.0

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: 11e11ad4e926162c2f5abf2a77c77be603dee85a
4
- data.tar.gz: cd9d544e1ab00d43314bba1b3fcebf2fb9cac2f9
3
+ metadata.gz: cfac9099c06f657ebaa995763f287339e1527a5d
4
+ data.tar.gz: 5281dc92d37cccc7f518622c223ffcbdeef86fff
5
5
  SHA512:
6
- metadata.gz: 39385d5c1e6badec90cfc732cd50daa78a38fb7756ccd97223dfcc512de2445c04cdb03c79910e367c2f141653d33a298325d67565e13d4ee5b0fde0a424ae66
7
- data.tar.gz: 75b91afe62981e0b71e16fb9e80325ba7950f44d2b81716565d123bef591085f3b273d44d1ed75882b25533724ae2e6a86efa3c500a0c3f3ee96bf3efa9ef13e
6
+ metadata.gz: 56715785fb5dd0f8f50cae0092d35cb5ef38c80a84c4f9575cac936f520056fac3e5c626a56d07b83bcaf12d5827472d8ca6378b33bed4efd4fcebc12a122a4c
7
+ data.tar.gz: 032e000796a0df849f2650cf861c9a5756272c0cde7fb8ffd3ba0a31117e003c5806a717f10fcc021947048ba12578ae8016ad6944f0b5f22953a899c5d88198
data/bin/transrate CHANGED
@@ -141,14 +141,17 @@ opts.assembly.split(',').each do |assembly|
141
141
  end
142
142
 
143
143
  log "Comparative metrics done in #{Time.now - t0} seconds"
144
- end
145
144
 
146
- log "\n"
147
- log "-" * report_width
148
- score = transrater.assembly_score
149
- unless score.nil?
150
- log "OVERALL SCORE: #{score.to_f.round(2) * 100}%"
145
+
146
+ log "\n"
151
147
  log "-" * report_width
148
+ score = transrater.assembly_score
149
+ unless score.nil?
150
+ log "OVERALL SCORE: #{score.to_f.round(2) * 100}%"
151
+ log "-" * report_width
152
+ end
153
+ else
154
+ log "\nNo reference provided, skipping comparative diagnostics"
152
155
  end
153
156
 
154
157
  all << contig_results.
@@ -87,6 +87,9 @@ module Transrate
87
87
  # @return [Hash] basic statistics about the assembly
88
88
  def basic_stats threads=8
89
89
 
90
+ # disable threading basic stats for now
91
+ threads = 1
92
+
90
93
  # create a work queue to process contigs in parallel
91
94
  queue = Queue.new
92
95
 
@@ -167,10 +170,10 @@ module Transrate
167
170
  # the next value to set the next cutoff. we take a copy
168
171
  # of the Array so we can use the intact original to collect
169
172
  # the results later
170
- # x = [90, 70, 50, 30, 10]
171
- # x2 = x.clone
172
- # cutoff = x2.pop / 100.0
173
- # res = []
173
+ x = [90, 70, 50, 30, 10]
174
+ x2 = x.clone
175
+ cutoff = x2.pop / 100.0
176
+ res = []
174
177
  n1k = 0
175
178
  n10k = 0
176
179
  orf_length_sum = 0
@@ -193,19 +196,20 @@ module Transrate
193
196
  # cutoff has been reached. if it has, store the Nx value and
194
197
  # get the next cutoff
195
198
  cumulative_length += contig.length
196
- # if cumulative_length >= @n_bases * cutoff
197
- # res << contig.length
198
- # if x2.empty?
199
- # cutoff=1
200
- # else
201
- # cutoff = x2.pop / 100.0
202
- # end
203
- # end
199
+ if cumulative_length >= @n_bases * cutoff
200
+ res << contig.length
201
+ if x2.empty?
202
+ cutoff=1
203
+ else
204
+ cutoff = x2.pop / 100.0
205
+ end
206
+ end
207
+
204
208
  end
205
209
 
206
210
  # calculate and return the statistics as a hash
207
211
  mean = cumulative_length / @assembly.size
208
- # ns = Hash[x.map { |n| "N#{n}" }.zip(res)]
212
+ ns = Hash[x.map { |n| "N#{n}" }.zip(res)]
209
213
  {
210
214
  'n_seqs' => bin.size,
211
215
  'smallest' => bin.first.length,
@@ -215,8 +219,7 @@ module Transrate
215
219
  'n_1k' => n1k,
216
220
  'n_10k' => n10k,
217
221
  'orf_percent' => 300 * orf_length_sum / (@assembly.size * mean)
218
- }
219
- # }.merge ns
222
+ }.merge ns
220
223
 
221
224
  end # basic_bin_stats
222
225
 
@@ -24,7 +24,9 @@ module Transrate
24
24
  # @param insertsd [Integer] standard deviation of the read pair insert size
25
25
  def initialize assembly, reference, left=nil, right=nil, insertsize=nil, insertsd=nil
26
26
  @assembly = assembly.is_a?(Assembly) ? assembly : Assembly.new(assembly)
27
- @reference = reference.is_a?(Assembly) ? reference : Assembly.new(reference)
27
+ if reference
28
+ @reference = reference.is_a?(Assembly) ? reference : Assembly.new(reference)
29
+ end
28
30
  @read_metrics = ReadMetrics.new @assembly
29
31
  @comparative_metrics = ComparativeMetrics.new(@assembly, @reference)
30
32
  end
@@ -9,8 +9,8 @@ module Transrate
9
9
  # Semantic Versioning 2.0 (http://semver.org/).
10
10
  module VERSION
11
11
  MAJOR = 0
12
- MINOR = 0
13
- PATCH = 16
12
+ MINOR = 1
13
+ PATCH = 0
14
14
  BUILD = nil
15
15
 
16
16
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Smith