transrate 0.0.7 → 0.0.8

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: dfc72856627c9ac051379efaf1bd8e835851b16f
4
- data.tar.gz: cdd22a20b948adf89cb7707ceac2789a944f29a6
3
+ metadata.gz: ad3086d63ee5deaf6ed931c5df095e776e601e2e
4
+ data.tar.gz: 188ff6eb56896b42de4ec8e4cee31e23d8387bed
5
5
  SHA512:
6
- metadata.gz: 0ec91bfbb2991f784340b0df5fedb88bc4f009d5a51c2365ebd50bf8b573bbaedcd8cb2c7e516ca7281a8c00b807f6191834d3c58150aa0d6d9d8304e8fe57de
7
- data.tar.gz: 1aa48ef3d32ec27a17d25ecb586a4eca2085d2e1dc9499c8709fdd729d1902321d371fb0dd68a858da6989eb811195a914affbace3ea95533a4f008a698f58a2
6
+ metadata.gz: 949dd128cb648f481bd7f473e037d9873325407393981674888b04e1b07f9729a1da5cd9d1efb42fb55838cfabcd6c03e33b42b9cfd25f80168fe78175aac035
7
+ data.tar.gz: 985cdfc7335410d3c7bd7f1c086b8d0aa87bd66b3af6e8859cc86d000583cca4b8dd728fce76add4e37b14636cd30a04d1876181a3879ec473a11f58368aaa69
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ tmp
17
17
  .yardoc
18
18
  _yardoc
19
19
  doc/
20
+ .ruby-version
@@ -83,8 +83,8 @@ module Transrate
83
83
  "largest" => @assembly.last.length,
84
84
  "n_bases" => @n_bases,
85
85
  "mean_len" => mean,
86
- "n > 1k" => n1k,
87
- "n > 10k" => n10k
86
+ "n_1k" => n1k,
87
+ "n_10k" => n10k
88
88
  }.merge ns
89
89
  end
90
90
 
@@ -15,7 +15,7 @@ module Transrate
15
15
  def run
16
16
  rbu = self.reciprocal_best_ublast
17
17
  @ortholog_hit_ratio = self.ortholog_hit_ratio rbu
18
- @collapse_factor = self.collapse_factor @ra.l2r_hits
18
+ @collapse_factor = self.collapse_factor @ra.r2l_hits
19
19
  @reciprocal_hits = rbu.size
20
20
  {
21
21
  :reciprocal_hits => @reciprocal_hits,
@@ -29,23 +29,26 @@ module Transrate
29
29
  @ra.run
30
30
  end
31
31
 
32
- def ortholog_hit_ratio rbu
32
+ def ortholog_hit_ratio rbu=nil
33
33
  return @ortholog_hit_ratio unless @ortholog_hit_ratio.nil?
34
34
  rbu.reduce(0.0){ |sum, hit| sum += hit.last.tcov.to_f } / rbu.size
35
35
  end
36
36
 
37
- def collapse_factor hits
37
+ def collapse_factor hits=nil
38
38
  return @collapse_factor unless @collapse_factor.nil?
39
39
  targets = {}
40
40
  hits.each_pair do |query, hit|
41
- unless targets.has_key? query
42
- targets[query] = Set.new
41
+ target = hit.target
42
+ unless targets.has_key? target
43
+ targets[target] = Set.new
43
44
  end
44
- targets[query] << hit.target
45
+ targets[target] << query
45
46
  end
46
- targets.values.reduce(0.0){ |sum, val| sum += val.size } / targets.size
47
+ sum = targets.values.reduce(0.0){ |sum, val| sum += val.size }
48
+ puts "sum: #{sum}"
49
+ sum / targets.size
47
50
  end
48
51
 
49
52
  end # ComparativeMetrics
50
53
 
51
- end # Transrate
54
+ end # Transrate
@@ -2,6 +2,7 @@ module Transrate
2
2
 
3
3
  class ReadMetrics
4
4
 
5
+ attr_reader :total
5
6
  attr_reader :bad
6
7
  attr_reader :supported_bridges
7
8
 
@@ -17,9 +18,14 @@ module Transrate
17
18
  left, right,
18
19
  insertsize, insertsd)
19
20
  self.analyse_read_mappings(samfile, insertsize, insertsd)
21
+ @percent_mapping = @total.to_f / @num_pairs.to_f * 100.0
22
+ @pc_good_mapping = @good.to_f / @num_pairs.to_f * 100.0
20
23
  {
24
+ :num_pairs => @num_pairs,
21
25
  :total_mappings => @total,
26
+ :percent_mapping => @percent_mapping,
22
27
  :good_mappings => @good,
28
+ :pc_good_mapping => @pc_good_mapping,
23
29
  :bad_mappings => @bad,
24
30
  :both_mapped => @both_mapped,
25
31
  :properly_paired => @properly_paired,
@@ -54,6 +60,7 @@ module Transrate
54
60
  end
55
61
 
56
62
  def initial_values
63
+ @num_pairs = 100000
57
64
  @total = 0
58
65
  @good = 0
59
66
  @bad = 0
@@ -158,4 +165,4 @@ module Transrate
158
165
 
159
166
  end # ReadMetrics
160
167
 
161
- end # Transrate
168
+ end # Transrate
@@ -2,6 +2,10 @@ module Transrate
2
2
 
3
3
  class Transrater
4
4
 
5
+ attr_reader :assembly
6
+ attr_reader :read_metrics
7
+ attr_reader :comparative_metrics
8
+
5
9
  def initialize assembly, reference, left, right, insertsize=nil, insertsd=nil
6
10
  @assembly = Assembly.new assembly
7
11
  @reference = reference.is_a?(Assembly) ? reference : Assembly.new(reference)
@@ -18,4 +22,4 @@ module Transrate
18
22
 
19
23
  end # Transrater
20
24
 
21
- end # Transrate
25
+ end # Transrate
@@ -4,7 +4,7 @@ module Transrate
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- PATCH = 7
7
+ PATCH = 8
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/transrate.gemspec CHANGED
@@ -6,6 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.name = 'transrate'
7
7
  gem.authors = [ "Richard Smith" ]
8
8
  gem.email = "rds45@cam.ac.uk"
9
+ gem.licenses = ["MIT"]
9
10
  gem.homepage = 'https://github.com/blahah/assemblotron'
10
11
  gem.summary = %q{ quality assessment of de-novo transcriptome assemblies }
11
12
  gem.description = %q{ a library and command-line tool for quality assessment of de-novo transcriptome assemblies }
@@ -25,4 +26,4 @@ Gem::Specification.new do |gem|
25
26
  gem.add_development_dependency 'simplecov'
26
27
  gem.add_development_dependency 'shoulda-context'
27
28
  gem.add_development_dependency 'coveralls', '~> 0.6.7'
28
- end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-19 00:00:00.000000000 Z
11
+ date: 2013-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -146,7 +146,6 @@ extra_rdoc_files: []
146
146
  files:
147
147
  - .gitignore
148
148
  - Gemfile
149
- - Gemfile.lock
150
149
  - LICENSE
151
150
  - README.md
152
151
  - bin/transrate
@@ -162,7 +161,8 @@ files:
162
161
  - lib/transrate/version.rb
163
162
  - transrate.gemspec
164
163
  homepage: https://github.com/blahah/assemblotron
165
- licenses: []
164
+ licenses:
165
+ - MIT
166
166
  metadata: {}
167
167
  post_install_message:
168
168
  rdoc_options: []
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  requirements: []
182
182
  rubyforge_project:
183
- rubygems_version: 2.0.3
183
+ rubygems_version: 2.1.4
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: quality assessment of de-novo transcriptome assemblies