transrate 1.0.0.beta3 → 1.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/Rakefile +1 -1
- data/bin/transrate +12 -8
- data/deps/deps.yaml +6 -3
- data/lib/transrate/assembly.rb +4 -0
- data/lib/transrate/comparative_metrics.rb +97 -210
- data/lib/transrate/read_metrics.rb +11 -2
- data/lib/transrate/salmon.rb +13 -3
- data/lib/transrate/score_optimiser.rb +6 -1
- data/lib/transrate/snap.rb +1 -2
- data/lib/transrate/transrater.rb +2 -2
- data/lib/transrate/version.rb +1 -1
- data/test/data/sorghum_100.fa +1 -1
- data/test/data/test.sf +19 -19
- data/test/test_assembly.rb +2 -2
- data/test/test_bin.rb +1 -0
- data/test/test_comp_metrics.rb +333 -162
- data/test/test_optimiser.rb +2 -2
- data/test/test_read_metrics.rb +9 -9
- data/test/test_salmon.rb +13 -1
- data/test/test_transrater.rb +1 -1
- data/transrate.gemspec +1 -1
- metadata +6 -8
data/test/test_optimiser.rb
CHANGED
@@ -17,9 +17,9 @@ class TestOptimiser < Test::Unit::TestCase
|
|
17
17
|
|
18
18
|
should "get optimal score" do
|
19
19
|
optimiser = Transrate::ScoreOptimiser.new(@assembly, @readmetrics)
|
20
|
-
assert_in_delta 0.
|
20
|
+
assert_in_delta 0.1507, optimiser.raw_score.round(4), 0.005
|
21
21
|
optimal, cutoff = optimiser.optimal_score
|
22
|
-
assert_in_delta 0.
|
22
|
+
assert_in_delta 0.4529, optimal.round(4), 0.05
|
23
23
|
assert_in_delta 0.5638, cutoff.round(4), 0.04
|
24
24
|
end
|
25
25
|
|
data/test/test_read_metrics.rb
CHANGED
@@ -31,17 +31,17 @@ class TestReadMetrics < Test::Unit::TestCase
|
|
31
31
|
stats = @read_metrics.read_stats
|
32
32
|
assert @read_metrics.has_run, "has run"
|
33
33
|
assert_equal 25006, stats[:fragments], 'number of read pairs'
|
34
|
-
|
34
|
+
assert_in_delta 21744, stats[:fragments_mapped], 10, 'number mapping'
|
35
35
|
assert_in_delta 0.84, stats[:p_fragments_mapped].round(4), 0.05
|
36
36
|
'proportion mapping'
|
37
|
-
assert_in_delta
|
38
|
-
assert_in_delta 0.
|
37
|
+
assert_in_delta 17983, stats[:good_mappings], 50, 'good mapping'
|
38
|
+
assert_in_delta 0.719,stats[:p_good_mapping].round(3), 0.005,
|
39
39
|
'percent good mapping'
|
40
|
-
assert_in_delta
|
41
|
-
|
40
|
+
assert_in_delta 3761, stats[:bad_mappings], 50, 'bad mapping'
|
41
|
+
assert_in_delta 2, stats[:potential_bridges], 1, 'bridges'
|
42
42
|
assert_equal 93, stats[:contigs_uncovbase], 'uncovered base contig'
|
43
43
|
assert_equal 28, stats[:contigs_uncovered], 'uncovered contig'
|
44
|
-
assert_equal
|
44
|
+
assert_equal 71, stats[:contigs_lowcovered], 'lowcovered contig'
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -65,7 +65,7 @@ class TestReadMetrics < Test::Unit::TestCase
|
|
65
65
|
assert_in_delta 0.9364, edit_b.round(4), 0.01, "edit distance 2"
|
66
66
|
|
67
67
|
assert_in_delta 0.5714, a[:p_good].round(4), 0.01, "prop of good mappings"
|
68
|
-
assert_in_delta 0.
|
68
|
+
assert_in_delta 0.8421, b[:p_good].round(4), 0.01, "prop of good mappings"
|
69
69
|
|
70
70
|
# uncovered bases
|
71
71
|
unc_a = contigs[0].uncovered_bases
|
@@ -137,9 +137,9 @@ class TestReadMetrics < Test::Unit::TestCase
|
|
137
137
|
end
|
138
138
|
stats = @read_metrics.read_stats
|
139
139
|
assert @read_metrics.has_run, "has run"
|
140
|
-
assert_equal 1, stats[:potential_bridges],
|
140
|
+
assert_equal 1, stats[:potential_bridges], "bridges"
|
141
|
+
assert_in_delta 2, contigs.length, 1, "number of bridging contigs found"
|
141
142
|
assert_equal "Sb01g002430.1", contigs[0].name
|
142
|
-
assert_equal "Sb05g009350.1", contigs[1].name
|
143
143
|
end
|
144
144
|
end
|
145
145
|
end
|
data/test/test_salmon.rb
CHANGED
@@ -19,12 +19,24 @@ class TestSalmon < Test::Unit::TestCase
|
|
19
19
|
assert_equal 549.279, results['scaffold1'][:tpm], "tpm is wrong"
|
20
20
|
end
|
21
21
|
|
22
|
+
should "detect wrong number of columns in the expression file" do
|
23
|
+
file = File.join(File.dirname(__FILE__), 'data', 'test.sf')
|
24
|
+
Dir.mktmpdir do |dir|
|
25
|
+
Dir.chdir dir do
|
26
|
+
`cut -f1,2,3 #{file} > broken.sf`
|
27
|
+
assert_raises(Transrate::SalmonError) do
|
28
|
+
@salmon.load_expression 'broken.sf'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
22
34
|
should "build a command to run salmon" do
|
23
35
|
cmd = @salmon.build_command "assembly.fa", "alignments.bam"
|
24
36
|
cmd = cmd.split(" ")[1..-1].join(" ") # remove command so test is portabl
|
25
37
|
test = "quant --libType IU --alignments alignments.bam "
|
26
38
|
test << "--targets assembly.fa --threads 4 --sampleOut "
|
27
|
-
test << "--sampleUnaligned --output ."
|
39
|
+
test << "--sampleUnaligned --output . --useVBOpt --useErrorModel"
|
28
40
|
assert_equal test, cmd, "cmd is wrong"
|
29
41
|
end
|
30
42
|
|
data/test/test_transrater.rb
CHANGED
@@ -59,7 +59,7 @@ class TestTransrater < Test::Unit::TestCase
|
|
59
59
|
Dir.chdir tmpdir do
|
60
60
|
all = @rater.all_metrics(@left, @right)
|
61
61
|
score = @rater.assembly_score
|
62
|
-
assert_equal 0.
|
62
|
+
assert_equal 0.154, score.round(3) # regression test
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/transrate.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.add_dependency 'trollop', '~> 2.0', '>= 2.0.0'
|
22
22
|
gem.add_dependency 'bindeps', '~> 1.1', '>= 1.1.2'
|
23
23
|
gem.add_dependency 'bio', '~> 1.4', '>= 1.4.3'
|
24
|
-
gem.add_dependency 'crb-blast', '~> 0.
|
24
|
+
gem.add_dependency 'crb-blast', '~> 0.6', '>= 0.6.4'
|
25
25
|
gem.add_dependency 'fix-trinity-output', '~> 1.0', '>= 1.0'
|
26
26
|
|
27
27
|
gem.add_development_dependency 'rake', '~> 10.3', '>= 10.3.2'
|
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: 1.0.0.
|
4
|
+
version: 1.0.0.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Smith-Unna
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yell
|
@@ -97,20 +97,20 @@ dependencies:
|
|
97
97
|
requirements:
|
98
98
|
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: '0.
|
100
|
+
version: '0.6'
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.6.4
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0.
|
110
|
+
version: '0.6'
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 0.
|
113
|
+
version: 0.6.4
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: fix-trinity-output
|
116
116
|
requirement: !ruby/object:Gem::Requirement
|
@@ -301,8 +301,6 @@ files:
|
|
301
301
|
- lib/transrate/salmon.rb
|
302
302
|
- lib/transrate/score_optimiser.rb
|
303
303
|
- lib/transrate/snap.rb
|
304
|
-
- lib/transrate/transrate.bundle
|
305
|
-
- lib/transrate/transrate.so
|
306
304
|
- lib/transrate/transrater.rb
|
307
305
|
- lib/transrate/version.rb
|
308
306
|
- lib/transrate/writer.rb
|