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.
@@ -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.1471, optimiser.raw_score.round(4), 0.005
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.4252, optimal.round(4), 0.02
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
 
@@ -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
- assert_equal 21000, stats[:fragments_mapped], 'number mapping'
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 17382, stats[:good_mappings], 50, 'good mapping'
38
- assert_in_delta 0.6945,stats[:p_good_mapping].round(3), 0.005,
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 3637, stats[:bad_mappings], 50, 'bad mapping'
41
- assert_equal 1, stats[:potential_bridges], 'bridges'
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 72, stats[:contigs_lowcovered], 'lowcovered contig'
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.8302, b[:p_good].round(4), 0.01, "prop of good mappings"
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], '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
 
@@ -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.14760, score.round(5) # regression test
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.5', '>= 0.5.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.beta3
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-02-23 00:00:00.000000000 Z
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.5'
100
+ version: '0.6'
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.5.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.5'
110
+ version: '0.6'
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 0.5.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