sequence_logo 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sequence_logo/exec/glue_logos.rb +8 -7
- data/lib/sequence_logo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 885b0f25932abe6a453fcbfb48eaae9e5227383a
|
4
|
+
data.tar.gz: fc7ca0ff71c311e8d7301d086ed3b4d153f0493f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
26
|
-
|
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(
|
30
|
+
SequenceLogo.draw_logo(ppm, options).write("PNG:#{logo_file.path}")
|
30
31
|
when 'revcomp'
|
31
|
-
SequenceLogo.draw_logo(ppm.revcomp, options).write(
|
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[
|
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
|
-
|
40
|
+
logo_files.each(&:close)
|
40
41
|
end
|
41
42
|
|
42
43
|
begin
|
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.
|
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-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|