sequence_logo 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a3490689a2063bc701ce8f9e50d270dfa22ba7f
4
- data.tar.gz: 9ea7a0c46fdbeeb7d5a21ecd29b6959079ad19b5
3
+ metadata.gz: 885b0f25932abe6a453fcbfb48eaae9e5227383a
4
+ data.tar.gz: fc7ca0ff71c311e8d7301d086ed3b4d153f0493f
5
5
  SHA512:
6
- metadata.gz: 57241901c85514889fb98f22ac717a480e36f5ab5917217797532e6d647f9364f3353316bf632c30574411c666d55515d0ac12ca08f7f23bd713149a7ad99116
7
- data.tar.gz: ca2a674b8f2fa4db523f09a7f468a57f499ff8ab0edeb8d532b20dfa3fd0234b3341925ff53c5509b5fecc1780b6bbfed74db9d57721f0328f149ebdb13206cb
6
+ metadata.gz: c47be1cb8060cd2ed305d4d21862b86db24d6b24b7b5989fbe86a4fb245c2b8db6a07595a2719c922d0a32bdd10d59f8e916c87c23610911c1a18ca547148ce8
7
+ data.tar.gz: cfc2df9b0029a19f17070a9937e6a5c61ccebee6ff0c1e65dac5da573c8e5e23de23b23ae240f00dcfc06b525f8e748c35ebfdd006765e2cd608e820450dc72f
@@ -1,10 +1,11 @@
1
1
  require_relative '../../sequence_logo'
2
2
  require 'fileutils'
3
3
  require 'cgi'
4
+ require 'tempfile'
4
5
 
5
6
  def generate_glued_logo(alignment_infos, options, total_orientation, output_file)
6
7
  logos = {}
7
- logo_filenames = []
8
+ logo_files = []
8
9
  rightmost_side = alignment_infos.map do |line|
9
10
  filename, shift, orientation, motif_name = line.strip.split("\t")
10
11
  shift = shift.to_i
@@ -22,21 +23,21 @@ def generate_glued_logo(alignment_infos, options, total_orientation, output_file
22
23
  shift = rightmost_side - shift - ppm.length
23
24
  end
24
25
  checkerr("bad input file: #{filename}") { ppm == nil }
25
- logo_filename = "#{filename}_temp.png"
26
- logo_filenames << logo_filename
26
+ logo_file = Tempfile.new(filename)
27
+ logo_files << logo_file
27
28
  case orientation
28
29
  when 'direct'
29
- SequenceLogo.draw_logo(ppm, options).write(logo_filename)
30
+ SequenceLogo.draw_logo(ppm, options).write("PNG:#{logo_file.path}")
30
31
  when 'revcomp'
31
- SequenceLogo.draw_logo(ppm.revcomp, options).write(logo_filename)
32
+ SequenceLogo.draw_logo(ppm.revcomp, options).write("PNG:#{logo_file.path}")
32
33
  else
33
34
  raise "Unknown orientation #{orientation} for #{motif_name}"
34
35
  end
35
- logos[logo_filename] = {shift: shift, length: ppm.length, name: motif_name}
36
+ logos[logo_file.path] = {shift: shift, length: ppm.length, name: motif_name}
36
37
  end
37
38
 
38
39
  SequenceLogo.glue_files(logos, output_file, options)
39
- logo_filenames.each{|filename| File.delete(filename) }
40
+ logo_files.each(&:close)
40
41
  end
41
42
 
42
43
  begin
@@ -1,3 +1,3 @@
1
1
  module SequenceLogo
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequence_logo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Vorontsov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick