transrate 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +16 -1
- data/.travis.yml +8 -0
- data/README.md +45 -43
- data/Rakefile +36 -0
- data/bin/transrate +98 -50
- data/deps/deps.yaml +55 -0
- data/lib/transrate.rb +19 -4
- data/lib/transrate/assembly.rb +93 -182
- data/lib/transrate/bowtie2.rb +37 -13
- data/lib/transrate/cmd.rb +19 -0
- data/lib/transrate/comparative_metrics.rb +239 -19
- data/lib/transrate/contig.rb +212 -0
- data/lib/transrate/contig_metrics.rb +76 -0
- data/lib/transrate/read_metrics.rb +83 -41
- data/lib/transrate/samtools.rb +73 -0
- data/lib/transrate/transrater.rb +31 -11
- data/lib/transrate/version.rb +1 -1
- data/test/data/150uncovered.l.fq +892 -0
- data/test/data/150uncovered.r.fq +892 -0
- data/test/data/Os.protein.2.fa +95 -0
- data/test/data/Os.protein.fa +199 -0
- data/test/data/assembly.2.fa +26 -0
- data/test/{assembly.fasta → data/assembly.fasta} +0 -0
- data/test/data/bridging_reads.l.fastq +20 -0
- data/test/data/bridging_reads.r.fastq +20 -0
- data/test/data/sorghum_transcript.fa +4 -0
- data/test/data/tiny.sam +4 -0
- data/test/helper.rb +33 -2
- data/test/test_bowtie.rb +54 -0
- data/test/test_cmd.rb +15 -0
- data/test/test_comp_metrics.rb +177 -0
- data/test/test_contig.rb +61 -0
- data/test/test_contig_metrics.rb +50 -0
- data/test/test_inline.rb +10 -9
- data/test/test_read_metrics.rb +68 -0
- data/test/test_samtools.rb +22 -0
- data/test/test_transrate.rb +40 -0
- data/test/test_transrater.rb +68 -0
- data/transrate.gemspec +16 -10
- metadata +232 -57
- data/lib/transrate/express.rb +0 -37
- data/lib/transrate/log.rb +0 -16
- data/lib/transrate/rb_hit.rb +0 -33
- data/lib/transrate/reciprocal_annotation.rb +0 -105
- data/lib/transrate/usearch.rb +0 -66
- data/test/test_test.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb3aec952569895cd9b811cafc879305a0636831
|
4
|
+
data.tar.gz: 45e521994f0d7e53fa956482826756987198960d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a4e34d60e180f0b6496868c5bad95f840b60a6fb0ffa85242cae4bffdc30e596b99b2a741807d69b75a20ecff0b5a7b919531a2663286fcb4f610d83df5044
|
7
|
+
data.tar.gz: cabfa0bb4df8906c334ba9c94bb7fc3e0f6a2e091f0136797595b4e62802a34b42546d3804a2a1a67bb7818b5aa0428b15c235c3ab176ae237cbf08cfcd566a1
|
data/.gitignore
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
.config
|
5
5
|
Gemfile.lock
|
6
6
|
coverage
|
7
|
+
test_data
|
7
8
|
InstalledFiles
|
8
9
|
lib/bundler/man
|
9
10
|
pkg
|
@@ -13,6 +14,8 @@ test/tmp
|
|
13
14
|
test/version_tmp
|
14
15
|
tmp
|
15
16
|
*~
|
17
|
+
.#*
|
18
|
+
\#*
|
16
19
|
|
17
20
|
# YARD artifacts
|
18
21
|
.yardoc
|
@@ -21,4 +24,16 @@ doc/
|
|
21
24
|
.ruby-version
|
22
25
|
|
23
26
|
# large test files not for repo
|
24
|
-
dryrun
|
27
|
+
dryrun
|
28
|
+
*.blast
|
29
|
+
*.phr
|
30
|
+
*.pin
|
31
|
+
*.psq
|
32
|
+
*.nhr
|
33
|
+
*.nin
|
34
|
+
*.nsq
|
35
|
+
*.bt2
|
36
|
+
*.fai
|
37
|
+
*.bam
|
38
|
+
*.csv
|
39
|
+
*.coverage
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -3,6 +3,18 @@ Transrate
|
|
3
3
|
|
4
4
|
Quality analysis and comparison of transcriptome assemblies.
|
5
5
|
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/transrate.png)][gem]
|
7
|
+
[![Build Status](https://secure.travis-ci.org/Blahah/transrate.png?branch=master)][travis]
|
8
|
+
[![Dependency Status](https://gemnasium.com/Blahah/transrate.png?travis)][gemnasium]
|
9
|
+
[![Code Climate](https://codeclimate.com/github/Blahah/transrate.png)][codeclimate]
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/Blahah/transrate/badge.png?branch=master)][coveralls]
|
11
|
+
|
12
|
+
[gem]: https://badge.fury.io/rb/transrate
|
13
|
+
[travis]: https://travis-ci.org/Blahah/transrate
|
14
|
+
[gemnasium]: https://gemnasium.com/Blahah/transrate
|
15
|
+
[codeclimate]: https://codeclimate.com/github/Blahah/transrate
|
16
|
+
[coveralls]: https://coveralls.io/r/Blahah/transrate
|
17
|
+
|
6
18
|
## Contents
|
7
19
|
|
8
20
|
1. [Development status](https://github.com/Blahah/transrate#development-status)
|
@@ -15,24 +27,12 @@ Quality analysis and comparison of transcriptome assemblies.
|
|
15
27
|
5. [Requirements](https://github.com/Blahah/transrate#requirements)
|
16
28
|
- [Ruby](https://github.com/Blahah/transrate#ruby)
|
17
29
|
- [RubyGems](https://github.com/Blahah/transrate#rubygems)
|
18
|
-
- [
|
30
|
+
- [Blast+, Bowtie 2](https://github.com/Blahah/transrate#blast+-and-bowtie2)
|
19
31
|
6. [Getting help](https://github.com/Blahah/transrate#getting-help)
|
20
32
|
|
21
33
|
## Development status
|
22
34
|
|
23
|
-
This software is
|
24
|
-
|
25
|
-
[![Gem Version](https://badge.fury.io/rb/transrate.png)][gem]
|
26
|
-
[![Build Status](https://secure.travis-ci.org/Blahah/transrate.png?branch=master)][travis]
|
27
|
-
[![Dependency Status](https://gemnasium.com/Blahah/transrate.png?travis)][gemnasium]
|
28
|
-
[![Code Climate](https://codeclimate.com/github/Blahah/transrate.png)][codeclimate]
|
29
|
-
[![Coverage Status](https://coveralls.io/repos/Blahah/transrate/badge.png?branch=master)][coveralls]
|
30
|
-
|
31
|
-
[gem]: https://badge.fury.io/rb/transrate
|
32
|
-
[travis]: https://travis-ci.org/Blahah/transrate
|
33
|
-
[gemnasium]: https://gemnasium.com/Blahah/transrate
|
34
|
-
[codeclimate]: https://codeclimate.com/github/Blahah/transrate
|
35
|
-
[coveralls]: https://coveralls.io/r/Blahah/transrate
|
35
|
+
This software is being actively developed. Please be aware that they may be bugs. If you find any, please report them on the [issue tracker](https://github.com/Blahah/transrate/issues).
|
36
36
|
|
37
37
|
## Transcriptome assembly quality metrics
|
38
38
|
|
@@ -40,57 +40,59 @@ This software is in early development. Users should be aware that until the firs
|
|
40
40
|
|
41
41
|
## Installation
|
42
42
|
|
43
|
-
Assuming
|
43
|
+
Assuming you've got a recent version of Ruby installed (see below), you can install transrate very easily. Just run at the terminal:
|
44
44
|
|
45
45
|
`gem install transrate`
|
46
46
|
|
47
|
-
|
47
|
+
Next all the software Transrate depends on needs to be installed. Luckily, transrate is clever enough to do this itself. Simply run
|
48
|
+
|
49
|
+
`transrate --install-deps`
|
50
|
+
|
51
|
+
Transrate will check whether its dependencies are installed, and if not will download and install them for you.
|
48
52
|
|
49
53
|
## Usage
|
50
54
|
|
51
55
|
### Command line
|
52
56
|
|
53
|
-
`transrate --help` will
|
57
|
+
`transrate --help` will display basic usage instructions.
|
54
58
|
|
55
59
|
```
|
56
|
-
Transrate v0.0
|
60
|
+
Transrate v0.2.0 by Richard Smith-Unna <rds45@cam.ac.uk>
|
57
61
|
|
58
|
-
DESCRIPTION:
|
59
|
-
Analyse a de-novo transcriptome
|
60
|
-
assembly using three kinds of metrics:
|
62
|
+
DESCRIPTION:
|
63
|
+
Analyse a de-novo transcriptome
|
64
|
+
assembly using three kinds of metrics:
|
61
65
|
|
62
|
-
1. contig-based
|
63
|
-
2. read-mapping
|
64
|
-
3. reference-based
|
66
|
+
1. contig-based
|
67
|
+
2. read-mapping (if --left and --right are provided)
|
68
|
+
3. reference-based (if --reference is provided)
|
65
69
|
|
66
|
-
|
67
|
-
|
70
|
+
Bug reports and feature requests at:
|
71
|
+
http://github.com/blahah/transrate
|
68
72
|
|
69
|
-
|
70
|
-
|
73
|
+
USAGE:
|
74
|
+
transrate <options>
|
71
75
|
|
72
|
-
|
73
|
-
transrate
|
76
|
+
EXAMPLES:
|
77
|
+
transrate --assembly contigs.fa --reference Athaliana_protein.fa --threads 8
|
74
78
|
|
75
|
-
OPTIONS:
|
76
|
-
--assembly, -a <s>: assembly file in FASTA format
|
79
|
+
OPTIONS:
|
80
|
+
--assembly, -a <s>: assembly file(s) in FASTA format, comma-separated
|
77
81
|
--reference, -r <s>: reference proteome file in FASTA format
|
78
82
|
--left, -l <s>: left reads file in FASTQ format
|
79
83
|
--right, -i <s>: right reads file in FASTQ format
|
80
84
|
--insertsize, -n <i>: mean insert size (default: 200)
|
81
85
|
--insertsd, -s <i>: insert size standard deviation (default: 50)
|
82
86
|
--threads, -t <i>: number of threads to use (default: 8)
|
87
|
+
--outfile, -o <s>: filename to use for CSV output (default: transate_results.csv)
|
88
|
+
--loglevel, -g <s>: the amount of information to print. one of [error, info, warn, debug] (default: info)
|
89
|
+
--install-deps, -d: install any missing dependencies
|
90
|
+
--profile, -p: debug option: profile the code as it runs
|
83
91
|
--version, -v: Print version and exit
|
84
92
|
--help, -h: Show this message
|
85
93
|
```
|
86
94
|
|
87
|
-
|
88
|
-
|
89
|
-
`head -2000000 left.fastq > left_500k.fastq`
|
90
|
-
|
91
|
-
`head -2000000 right.fastq > right_500k.fastq`
|
92
|
-
|
93
|
-
FASTQ records are 4 lines long, so make sure you multiply the number of reads you want by 4, and be sure to run the same command on both the left and right read files.
|
95
|
+
See the [getting started guide] on the website for more instructions, and see the [command-line options] part of the manual for details.
|
94
96
|
|
95
97
|
#### Example
|
96
98
|
|
@@ -123,13 +125,13 @@ puts t.assembly_score
|
|
123
125
|
|
124
126
|
### Ruby
|
125
127
|
|
126
|
-
First, you'll need Ruby
|
128
|
+
First, you'll need Ruby v2.0.0 or greater installed. You can check with:
|
127
129
|
|
128
130
|
`ruby --version`
|
129
131
|
|
130
132
|
If you don't have Ruby installed, or you need a higher version, I recommend using [RVM](http://rvm.io/) as your Ruby Version Manager. To install RVM along with the latest Ruby, just run:
|
131
133
|
|
132
|
-
`\curl -L https://get.rvm.io | bash -s stable`
|
134
|
+
`\curl -L https://get.rvm.io | bash -s stable --ruby`
|
133
135
|
|
134
136
|
### Rubygems
|
135
137
|
|
@@ -139,9 +141,9 @@ Your Ruby installation *should* come with RubyGems, the package manager for Ruby
|
|
139
141
|
|
140
142
|
If you don't have it installed, I recommend installing the latest version of Ruby and RubyGems using the RVM instructions above (in the [Requirements:Ruby](https://github.com/Blahah/transrate#ruby) section).
|
141
143
|
|
142
|
-
|
144
|
+
## Other software
|
143
145
|
|
144
|
-
|
146
|
+
Transrate uses a variety of other software including NCBI BLAST+, Bowtie2 and Samtools. But you don't need to worry about installing those yourself - Transrate does that automatically using the [bindeps](https://github.com/Blahah/bindeps) gem.
|
145
147
|
|
146
148
|
## Getting help
|
147
149
|
|
data/Rakefile
CHANGED
@@ -4,5 +4,41 @@ Rake::TestTask.new do |t|
|
|
4
4
|
t.libs << 'test'
|
5
5
|
end
|
6
6
|
|
7
|
+
Rake::TestTask.new do |t|
|
8
|
+
t.name = :recip
|
9
|
+
t.libs << 'test'
|
10
|
+
t.test_files = ['test/test_reciprocal.rb']
|
11
|
+
end
|
12
|
+
|
13
|
+
Rake::TestTask.new do |t|
|
14
|
+
t.name = :comp
|
15
|
+
t.libs << 'test'
|
16
|
+
t.test_files = ['test/test_comp_metrics.rb']
|
17
|
+
end
|
18
|
+
|
19
|
+
Rake::TestTask.new do |t|
|
20
|
+
t.name = :contig
|
21
|
+
t.libs << 'test'
|
22
|
+
t.test_files = ['test/test_contig_metrics.rb']
|
23
|
+
end
|
24
|
+
|
25
|
+
Rake::TestTask.new do |t|
|
26
|
+
t.name = :read
|
27
|
+
t.libs << 'test'
|
28
|
+
t.test_files = ['test/test_read_metrics.rb']
|
29
|
+
end
|
30
|
+
|
31
|
+
Rake::TestTask.new do |t|
|
32
|
+
t.name = :bowtie
|
33
|
+
t.libs << 'test'
|
34
|
+
t.test_files = ['test/test_bowtie.rb']
|
35
|
+
end
|
36
|
+
|
37
|
+
Rake::TestTask.new do |t|
|
38
|
+
t.name = :rater
|
39
|
+
t.libs << 'test'
|
40
|
+
t.test_files = ['test/test_transrater.rb']
|
41
|
+
end
|
42
|
+
|
7
43
|
desc "Run tests"
|
8
44
|
task :default => :test
|
data/bin/transrate
CHANGED
@@ -3,16 +3,17 @@
|
|
3
3
|
require 'trollop'
|
4
4
|
require 'transrate'
|
5
5
|
require 'csv'
|
6
|
+
require 'bindeps'
|
7
|
+
require 'ruby-prof'
|
6
8
|
|
7
9
|
opts = Trollop::options do
|
8
10
|
version Transrate::VERSION::STRING.dup
|
9
11
|
banner <<-EOS
|
10
12
|
|
11
|
-
Transrate v#{Transrate::VERSION::STRING.dup} by Richard Smith <rds45@cam.ac.uk>
|
13
|
+
Transrate v#{Transrate::VERSION::STRING.dup} by Richard Smith-Unna <rds45@cam.ac.uk>
|
12
14
|
|
13
15
|
DESCRIPTION:
|
14
|
-
Analyse a de-novo transcriptome
|
15
|
-
assembly using three kinds of metrics:
|
16
|
+
Analyse a de-novo transcriptome assembly using three kinds of metrics:
|
16
17
|
|
17
18
|
1. contig-based
|
18
19
|
2. read-mapping (if --left and --right are provided)
|
@@ -25,13 +26,19 @@ opts = Trollop::options do
|
|
25
26
|
transrate <options>
|
26
27
|
|
27
28
|
EXAMPLES:
|
29
|
+
# just check dependencies and install any that are missing
|
30
|
+
transrate --install-deps
|
31
|
+
# contig metrics only
|
32
|
+
transrate --assembly contigs.fa
|
33
|
+
# contig and reference-based metrics with 8 threads
|
28
34
|
transrate --assembly contigs.fa --reference Athaliana_protein.fa --threads 8
|
35
|
+
# contig and read-based metrics for two assemblies with 32 threads
|
36
|
+
transrate --assembly one.fa,two.fa --left l.fq --right r.fq --threads 32
|
29
37
|
|
30
38
|
OPTIONS:
|
31
39
|
|
32
40
|
EOS
|
33
41
|
opt :assembly, "assembly file(s) in FASTA format, comma-separated",
|
34
|
-
:required => true,
|
35
42
|
:type => String
|
36
43
|
opt :reference, "reference proteome file in FASTA format",
|
37
44
|
:type => String
|
@@ -48,7 +55,36 @@ opts = Trollop::options do
|
|
48
55
|
opt :threads, "number of threads to use",
|
49
56
|
:default => 8,
|
50
57
|
:type => Integer
|
51
|
-
opt :
|
58
|
+
opt :outfile, "filename to use for CSV output",
|
59
|
+
:default => 'transate_results.csv'
|
60
|
+
opt :loglevel, "the amount of information to print. " +
|
61
|
+
"one of [error, info, warn, debug]",
|
62
|
+
:default => 'info'
|
63
|
+
opt :install_deps, "install any missing dependencies"
|
64
|
+
opt :profile, "debug option: profile the code as it runs"
|
65
|
+
end
|
66
|
+
|
67
|
+
if opts.install_deps
|
68
|
+
puts "Checking dependencies"
|
69
|
+
gem_dir = Gem.loaded_specs['transrate'].full_gem_path
|
70
|
+
gem_deps = File.join(gem_dir, 'deps', 'deps.yaml')
|
71
|
+
Bindeps.require gem_deps
|
72
|
+
puts "All dependencies installed"
|
73
|
+
exit
|
74
|
+
end
|
75
|
+
|
76
|
+
unless opts.assembly
|
77
|
+
raise ArgumentError.new "Option --assembly must be specified. " +
|
78
|
+
"Try --help for help."
|
79
|
+
end
|
80
|
+
|
81
|
+
if opts.reference && !File.exist?(opts.reference)
|
82
|
+
raise IOError.new "Reference fasta file does not exist: #{opts.reference}"
|
83
|
+
end
|
84
|
+
|
85
|
+
if opts.profile
|
86
|
+
logger.info "Starting profiler"
|
87
|
+
RubyProf.start
|
52
88
|
end
|
53
89
|
|
54
90
|
def pretty_print_hash hash, width
|
@@ -57,101 +93,105 @@ def pretty_print_hash hash, width
|
|
57
93
|
if v.to_f.round(2).to_s.split('.').last.to_i > 0
|
58
94
|
v = v.to_f.round(2)
|
59
95
|
end
|
96
|
+
if v.is_a? Float
|
97
|
+
v = v.round(2)
|
98
|
+
end
|
60
99
|
pad = (width - (k.to_s.length + v.to_s.length))
|
61
|
-
|
100
|
+
pad = [pad, 0].max
|
101
|
+
logger.info "#{k.to_s.split('_').join(' ')}" +
|
62
102
|
"#{" " * pad}" +
|
63
103
|
"#{v}"
|
64
|
-
end.join("\n")
|
65
|
-
end
|
66
|
-
|
67
|
-
# don't log if --quiet is set
|
68
|
-
$quiet = opts.quiet
|
69
|
-
def log msg
|
70
|
-
unless $quiet
|
71
|
-
puts msg
|
72
104
|
end
|
73
105
|
end
|
74
106
|
|
75
107
|
include Transrate
|
76
108
|
|
77
|
-
|
78
|
-
|
109
|
+
unless %w[error info warn debug].include? opts.loglevel
|
110
|
+
raise "Loglevel #{opts.loglevel} is not valid. " +
|
111
|
+
"It must be one of: error, info, warn, debug."
|
112
|
+
end
|
113
|
+
|
114
|
+
logger.level = Yell::Level.new opts.loglevel.to_sym
|
115
|
+
|
116
|
+
logger.info "Loading reference dataset"
|
117
|
+
|
118
|
+
r = opts.reference ? Assembly.new(opts.reference) : nil
|
119
|
+
report_width = 35
|
79
120
|
|
80
121
|
# loop through the assemblies, storing their outputs in an array of hashes
|
81
122
|
all = []
|
82
123
|
opts.assembly.split(',').each do |assembly|
|
83
124
|
|
125
|
+
logger.info "Loading assembly: #{assembly}"
|
126
|
+
|
84
127
|
a = Assembly.new assembly
|
128
|
+
transrater = Transrater.new(a, r,
|
129
|
+
left: opts.left,
|
130
|
+
right: opts.right,
|
131
|
+
insertsize: opts.insertsize,
|
132
|
+
insertsd: opts.insertsd,
|
133
|
+
threads: opts.threads)
|
85
134
|
|
86
|
-
transrater = Transrater.new(a, r,
|
87
|
-
opts.left,
|
88
|
-
opts.right,
|
89
|
-
opts.insertsize,
|
90
|
-
opts.insertsd)
|
91
135
|
|
92
|
-
|
136
|
+
logger.info "Analysing assembly: #{assembly}"
|
93
137
|
|
94
138
|
contig_results = {}
|
95
139
|
|
96
|
-
|
140
|
+
logger.info "Calculating contig metrics..."
|
97
141
|
t0 = Time.now
|
98
142
|
contig_results = transrater.assembly_metrics.basic_stats
|
99
|
-
|
143
|
+
contig_results.merge! transrater.assembly.contig_metrics.results
|
100
144
|
if contig_results
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
log pretty_print_hash(contig_results, report_width)
|
145
|
+
logger.info "Contig metrics:"
|
146
|
+
logger.info "-" * report_width
|
147
|
+
pretty_print_hash(contig_results, report_width)
|
105
148
|
end
|
106
149
|
|
107
|
-
|
150
|
+
logger.info "Contig metrics done in #{Time.now - t0} seconds"
|
108
151
|
|
109
152
|
read_results = {}
|
110
153
|
|
111
154
|
if (opts.left && opts.right)
|
112
|
-
|
155
|
+
logger.info "Calculating read diagnostics..."
|
113
156
|
t0 = Time.now
|
114
|
-
read_results = transrater.read_metrics(opts.left,
|
157
|
+
read_results = transrater.read_metrics(opts.left,
|
158
|
+
opts.right).read_stats
|
115
159
|
|
116
160
|
if read_results
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
log pretty_print_hash(read_results, report_width)
|
161
|
+
logger.info "Read mapping metrics:"
|
162
|
+
logger.info "-" * report_width
|
163
|
+
pretty_print_hash(read_results, report_width)
|
121
164
|
end
|
122
165
|
|
123
|
-
|
166
|
+
logger.info "Read metrics done in #{Time.now - t0} seconds"
|
124
167
|
else
|
125
|
-
|
168
|
+
logger.info "No reads provided, skipping read diagnostics"
|
126
169
|
end
|
127
170
|
|
128
171
|
comparative_results={}
|
129
172
|
|
130
173
|
if opts.reference
|
131
|
-
|
174
|
+
logger.info "Calculating comparative metrics..."
|
132
175
|
t0 = Time.now
|
133
176
|
comparative_metrics = transrater.comparative_metrics
|
134
177
|
comparative_results = comparative_metrics.comp_stats
|
135
178
|
|
136
179
|
if comparative_results
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
log pretty_print_hash(comparative_results, report_width)
|
180
|
+
logger.info "Comparative metrics:"
|
181
|
+
logger.info "-" * report_width
|
182
|
+
pretty_print_hash(comparative_results, report_width)
|
141
183
|
end
|
142
184
|
|
143
|
-
|
144
|
-
|
185
|
+
logger.info "Comparative metrics done in #{Time.now - t0} seconds"
|
145
186
|
|
146
|
-
|
147
|
-
log "-" * report_width
|
187
|
+
logger.info "-" * report_width
|
148
188
|
score = transrater.assembly_score
|
149
189
|
unless score.nil?
|
150
|
-
|
151
|
-
|
190
|
+
logger.info "OVERALL SCORE: #{score.to_f.round(2) * 100}%"
|
191
|
+
logger.info "-" * report_width
|
152
192
|
end
|
153
193
|
else
|
154
|
-
|
194
|
+
logger.info "No reference provided, skipping comparative diagnostics"
|
155
195
|
end
|
156
196
|
|
157
197
|
all << contig_results.
|
@@ -163,6 +203,7 @@ end
|
|
163
203
|
|
164
204
|
# write out all resuls to .csv
|
165
205
|
outfile = opts.out || 'transrate.csv'
|
206
|
+
logger.info "Writing analysis results to #{outfile}"
|
166
207
|
CSV.open(outfile, 'wb') do |file|
|
167
208
|
keys = all[0].keys
|
168
209
|
keys.delete(:assembly)
|
@@ -171,4 +212,11 @@ CSV.open(outfile, 'wb') do |file|
|
|
171
212
|
all.each do |row|
|
172
213
|
file << head.map { |x| row[x] }
|
173
214
|
end
|
174
|
-
end
|
215
|
+
end
|
216
|
+
|
217
|
+
if opts.profile
|
218
|
+
logger.info "Writing profiling results to transrate_profile.txt"
|
219
|
+
result = RubyProf.stop
|
220
|
+
printer = RubyProf::FlatPrinter.new(result)
|
221
|
+
printer.print(File.open('transrate_profile.txt', 'w'))
|
222
|
+
end
|