Skip to content

Commit

Permalink
Round log output and results to appropriate SF (fixes #136)
Browse files Browse the repository at this point in the history
  • Loading branch information
blahah committed Jun 15, 2015
1 parent 1fb051c commit bbeea6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions bin/transrate
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ assemblies.split(',').each do |assembly|
pretty_print_hash(contig_results, report_width)
end

logger.info "Contig metrics done in #{Time.now - t0} seconds"
logger.info "Contig metrics done in #{(Time.now - t0).round} seconds"

read_results = {}

Expand All @@ -305,7 +305,7 @@ assemblies.split(',').each do |assembly|
pretty_print_hash(read_results, report_width)
end

logger.info "Read metrics done in #{Time.now - t0} seconds"
logger.info "Read metrics done in #{(Time.now - t0).round} seconds"
else
logger.info "No reads provided, skipping read diagnostics"
end
Expand All @@ -324,7 +324,7 @@ assemblies.split(',').each do |assembly|
pretty_print_hash(comparative_results, report_width)
end

logger.info "Comparative metrics done in #{Time.now - t0} seconds"
logger.info "Comparative metrics done in #{(Time.now - t0).round} seconds"

logger.info "-" * report_width
else
Expand Down Expand Up @@ -366,7 +366,7 @@ assemblies.split(',').each do |assembly|
csv << basic_metrics.keys
first = false
end
csv << basic_metrics.values
csv << basic_metrics.values.map{ |x| x.is_a?(Float) ? x.round(6) : x }
end
end

Expand All @@ -388,6 +388,9 @@ CSV.open(outfile, 'wb') do |file|
head = [:assembly] + keys
file << head
all.each do |row|
file << head.map { |x| row[x] }
file << head.map { |x|
entry = row[x]
entry = entry.round(5) if entry.is_a? Float
}
end
end
2 changes: 1 addition & 1 deletion lib/transrate/score_optimiser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def optimal_score(prefix='assembly')
out = CSV.open("#{prefix}_score_optimisation.csv", 'w')
out << %w[cutoff assembly_score]
cutoffscores.each do |c, score|
out << [c, score]
out << [c.round(5), score.round(5)]
if score > @optimal
@optimal = score
@cutoff = c
Expand Down

0 comments on commit bbeea6b

Please sign in to comment.