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 +4 -4
- data/.gitignore +1 -0
- data/lib/transrate/assembly.rb +2 -2
- data/lib/transrate/comparative_metrics.rb +11 -8
- data/lib/transrate/read_metrics.rb +8 -1
- data/lib/transrate/transrater.rb +5 -1
- data/lib/transrate/version.rb +1 -1
- data/transrate.gemspec +2 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad3086d63ee5deaf6ed931c5df095e776e601e2e
|
4
|
+
data.tar.gz: 188ff6eb56896b42de4ec8e4cee31e23d8387bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949dd128cb648f481bd7f473e037d9873325407393981674888b04e1b07f9729a1da5cd9d1efb42fb55838cfabcd6c03e33b42b9cfd25f80168fe78175aac035
|
7
|
+
data.tar.gz: 985cdfc7335410d3c7bd7f1c086b8d0aa87bd66b3af6e8859cc86d000583cca4b8dd728fce76add4e37b14636cd30a04d1876181a3879ec473a11f58368aaa69
|
data/.gitignore
CHANGED
data/lib/transrate/assembly.rb
CHANGED
@@ -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.
|
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
|
-
|
42
|
-
|
41
|
+
target = hit.target
|
42
|
+
unless targets.has_key? target
|
43
|
+
targets[target] = Set.new
|
43
44
|
end
|
44
|
-
targets[
|
45
|
+
targets[target] << query
|
45
46
|
end
|
46
|
-
targets.values.reduce(0.0){ |sum, val| sum += val.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
|
data/lib/transrate/transrater.rb
CHANGED
@@ -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
|
data/lib/transrate/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|