macroape 3.3.0 → 3.3.1
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.
- data/README.md +7 -4
- data/lib/macroape/collection.rb +8 -0
- data/lib/macroape/exec/eval_similarity.rb +0 -1
- data/lib/macroape/exec/find_pvalue.rb +0 -1
- data/lib/macroape/exec/find_threshold.rb +0 -1
- data/lib/macroape/exec/preprocess_collection.rb +0 -1
- data/lib/macroape/exec/scan_collection.rb +0 -1
- data/lib/macroape/version.rb +1 -1
- data/macroape.gemspec +19 -19
- data/test/preprocess_collection_test.rb +4 -2
- data/test/scan_collection_test.rb +6 -6
- data/test/test_helper.rb +2 -0
- metadata +6 -6
data/README.md
CHANGED
@@ -41,14 +41,17 @@ Or install it yourself as:
|
|
41
41
|
require 'macroape'
|
42
42
|
background = [1,1,1,1]
|
43
43
|
discretization = 10
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
cmp =
|
44
|
+
pwm_first = Bioinform::PWM.new(File.read('first_pwm.pat')).background(background).discrete(discretization)
|
45
|
+
pwm_second = Bioinform::PWM.new(File.read('first_pwm.pat')).background(background).discrete(discretization)
|
46
|
+
|
47
|
+
cmp = Macroape::PWMCompare.new(pwm_first, pwm_second)
|
48
48
|
first_threshold = pwm_first.threshold(pvalue)
|
49
49
|
second_threshold = pwm_second.threshold(pvalue)
|
50
|
+
|
50
51
|
similarity_info = cmp.jaccard(first_threshold, second_threshold)
|
51
52
|
puts "Jaccard similarity: #{similarity_info[:similarity]}"
|
53
|
+
|
54
|
+
For more details look a source code of utilities in lib/exec/ folder
|
52
55
|
|
53
56
|
## Contributing
|
54
57
|
|
data/lib/macroape/collection.rb
CHANGED
@@ -10,5 +10,13 @@ module Macroape
|
|
10
10
|
@pwms[pwm.name] = pwm
|
11
11
|
@infos[pwm.name] = info
|
12
12
|
end
|
13
|
+
def ==(other)
|
14
|
+
@rough_discretization == other.rough_discretization &&
|
15
|
+
@precise_discretization == other.precise_discretization &&
|
16
|
+
@background == other.background &&
|
17
|
+
@pvalues == other.pvalues &&
|
18
|
+
@pwms == other.pwms &&
|
19
|
+
@infos == other.infos
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
data/lib/macroape/version.rb
CHANGED
data/macroape.gemspec
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/macroape/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["Ilya Vorontsov"]
|
6
|
-
gem.email = ["prijutme4ty@gmail.com"]
|
7
|
-
gem.description = %q{Macroape is an abbreviation for MAtrix CompaRisOn by Approximate P-value Estimation. It's a bioinformatic tool for evaluating similarity measure and best alignment between a pair of Position Weight Matrices(PWM), finding thresholds by P-values and inside out and even searching a collection of motifs for the most similar ones. Used approach and application described in manual at https://docs.google.com/document/pub?id=1_jsxhMNzMzy4d2d_byAd3n6Szg5gEcqG_Sf7w9tEqWw}
|
8
|
-
gem.summary = %q{PWM comparison tool using MACROAPE approach}
|
9
|
-
gem.homepage = "http://autosome.ru/macroape/"
|
10
|
-
|
11
|
-
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name = "macroape"
|
15
|
-
gem.require_paths = ["lib"]
|
16
|
-
gem.version = Macroape::VERSION
|
17
|
-
|
18
|
-
gem.add_dependency('bioinform', '
|
19
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/macroape/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Ilya Vorontsov"]
|
6
|
+
gem.email = ["prijutme4ty@gmail.com"]
|
7
|
+
gem.description = %q{Macroape is an abbreviation for MAtrix CompaRisOn by Approximate P-value Estimation. It's a bioinformatic tool for evaluating similarity measure and best alignment between a pair of Position Weight Matrices(PWM), finding thresholds by P-values and inside out and even searching a collection of motifs for the most similar ones. Used approach and application described in manual at https://docs.google.com/document/pub?id=1_jsxhMNzMzy4d2d_byAd3n6Szg5gEcqG_Sf7w9tEqWw}
|
8
|
+
gem.summary = %q{PWM comparison tool using MACROAPE approach}
|
9
|
+
gem.homepage = "http://autosome.ru/macroape/"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "macroape"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Macroape::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency('bioinform', '>= 0.1.1')
|
19
|
+
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'test_helper'
|
2
|
+
require 'yaml'
|
3
|
+
require 'macroape'
|
2
4
|
|
3
5
|
class TestPreprocessCollection < Test::Unit::TestCase
|
4
6
|
def test_multipvalue_preproceessing
|
5
|
-
system(Helpers.exec_cmd('preprocess_collection','
|
6
|
-
assert_equal
|
7
|
+
system(Helpers.exec_cmd('preprocess_collection','test/data/test_collection -o test/data/test_collection.yaml.tmp -p 0.0005 0.0001 0.00005 --silent'))
|
8
|
+
assert_equal YAML.load_file('test/data/test_collection.yaml'), YAML.load_file('test/data/test_collection.yaml.tmp')
|
7
9
|
File.delete 'test/data/test_collection.yaml.tmp'
|
8
10
|
end
|
9
11
|
end
|
@@ -2,16 +2,16 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class TestScanCollection < Test::Unit::TestCase
|
4
4
|
def test_scan_default_cutoff
|
5
|
-
assert_equal File.read('test/data/KLF4_f2_scan_results_default_cutoff.txt'),
|
6
|
-
IO.popen(Helpers.exec_cmd('scan_collection','test/data/KLF4_f2.pat test/data/test_collection.yaml --silent'), &:read)
|
5
|
+
assert_equal File.read('test/data/KLF4_f2_scan_results_default_cutoff.txt').gsub("\r\n", "\n"),
|
6
|
+
IO.popen(Helpers.exec_cmd('scan_collection','test/data/KLF4_f2.pat test/data/test_collection.yaml --silent'), &:read).gsub("\r\n","\n")
|
7
7
|
end
|
8
8
|
def test_scan_and_output_all_results
|
9
|
-
assert_equal File.read('test/data/KLF4_f2_scan_results_all.txt'),
|
10
|
-
IO.popen(Helpers.exec_cmd('scan_collection','test/data/KLF4_f2.pat test/data/test_collection.yaml --all --silent'), &:read)
|
9
|
+
assert_equal File.read('test/data/KLF4_f2_scan_results_all.txt').gsub("\r\n", "\n"),
|
10
|
+
IO.popen(Helpers.exec_cmd('scan_collection','test/data/KLF4_f2.pat test/data/test_collection.yaml --all --silent'), &:read).gsub("\r\n","\n")
|
11
11
|
|
12
12
|
end
|
13
13
|
def test_scan_precise_mode
|
14
|
-
assert_equal File.read('test/data/KLF4_f2_scan_results_precise_mode.txt'),
|
15
|
-
IO.popen(Helpers.exec_cmd('scan_collection','test/data/KLF4_f2.pat test/data/test_collection.yaml --precise --all --silent'), &:read)
|
14
|
+
assert_equal File.read('test/data/KLF4_f2_scan_results_precise_mode.txt').gsub("\r\n","\n"),
|
15
|
+
IO.popen(Helpers.exec_cmd('scan_collection','test/data/KLF4_f2.pat test/data/test_collection.yaml --precise --all --silent'), &:read).gsub("\r\n", "\n")
|
16
16
|
end
|
17
17
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macroape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bioinform
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.1.
|
21
|
+
version: 0.1.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.1.
|
29
|
+
version: 0.1.1
|
30
30
|
description: Macroape is an abbreviation for MAtrix CompaRisOn by Approximate P-value
|
31
31
|
Estimation. It's a bioinformatic tool for evaluating similarity measure and best
|
32
32
|
alignment between a pair of Position Weight Matrices(PWM), finding thresholds by
|