aai 0.1.0 → 0.2.0
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 +4 -4
- data/.travis.yml +9 -1
- data/README.md +30 -9
- data/aai.gemspec +0 -9
- data/exe/{aai.rb → aai} +4 -0
- data/lib/aai/utils.rb +23 -0
- data/lib/aai/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14d742b51fba76ccd8b279d36ee672e2ee8cb329
|
4
|
+
data.tar.gz: 2bdc68dc8d289e3d9770373f856d9e05d6c1a0b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c36035231ab8a7a8608d545b617d2f23009479b625efd9385076f229e18b086dcddaff9eb9b49fa9431e9236c377442a1562861d9352317cfc8cc218160d09a
|
7
|
+
data.tar.gz: fc78b1e0a2e5e83a0841c8cb31706095e6b55a85dfd76ddb892f2f3873335dce664a91ffe410cc1b13c1de2521b0a034b15a8f75620fa0092fdd95af8b2110e2
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -4,10 +4,25 @@
|
|
4
4
|
[](https://coveralls.io/github/mooreryan/aai?branch=master)
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
6
6
|
|
7
|
-
Calculate Seanie's multi-genome (or genome bin) amino acid similarity.
|
7
|
+
Calculate Seanie's multi-genome (or genome bin, or metagenome sample) amino acid similarity.
|
8
|
+
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
The following programs must be installed and on your `PATH` for `aai` to work.
|
12
|
+
|
13
|
+
- GNU Parallel
|
14
|
+
- NCBI Blast suite
|
8
15
|
|
9
16
|
## Installation
|
10
17
|
|
18
|
+
### Install with RubyGems
|
19
|
+
|
20
|
+
Run
|
21
|
+
|
22
|
+
$ gem install aai
|
23
|
+
|
24
|
+
### If bundling aai in another ruby program
|
25
|
+
|
11
26
|
Add this line to your application's Gemfile:
|
12
27
|
|
13
28
|
```ruby
|
@@ -18,18 +33,24 @@ And then execute:
|
|
18
33
|
|
19
34
|
$ bundle
|
20
35
|
|
21
|
-
|
22
|
-
|
23
|
-
$ gem install aai
|
36
|
+
## Usage
|
24
37
|
|
25
|
-
|
38
|
+
### Example
|
26
39
|
|
27
|
-
|
28
|
-
|
40
|
+
```
|
41
|
+
$ ruby exe/aai.rb --infiles *.fa
|
42
|
+
```
|
29
43
|
|
30
|
-
|
44
|
+
### Options
|
31
45
|
|
32
|
-
|
46
|
+
```
|
47
|
+
Options:
|
48
|
+
-i, --infiles=<s+> Input files
|
49
|
+
-o, --outdir=<s> Output directory (default: .)
|
50
|
+
-b, --basename=<s> Base name for output file (default: aai_scores)
|
51
|
+
-v, --version Print version and exit
|
52
|
+
-h, --help Show this message
|
53
|
+
```
|
33
54
|
|
34
55
|
## Development
|
35
56
|
|
data/aai.gemspec
CHANGED
@@ -14,15 +14,6 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/mooreryan/aai.git"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
# if spec.respond_to?(:metadata)
|
20
|
-
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
# else
|
22
|
-
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
-
# "public gem pushes."
|
24
|
-
# end
|
25
|
-
|
26
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
18
|
f.match(%r{^(test|spec|features)/})
|
28
19
|
end
|
data/exe/{aai.rb → aai}
RENAMED
@@ -38,6 +38,10 @@ end
|
|
38
38
|
abort_if opts[:infiles].nil? || opts[:infiles].empty?,
|
39
39
|
"No infiles given"
|
40
40
|
|
41
|
+
Aai.check_command "blastp"
|
42
|
+
Aai.check_command "makeblastdb"
|
43
|
+
Aai.check_command "parallel"
|
44
|
+
|
41
45
|
Aai.check_files opts[:infiles]
|
42
46
|
|
43
47
|
FileUtils.mkdir_p opts[:outdir]
|
data/lib/aai/utils.rb
CHANGED
@@ -32,5 +32,28 @@ module Aai
|
|
32
32
|
|
33
33
|
permutations
|
34
34
|
end
|
35
|
+
|
36
|
+
# from https://stackoverflow.com/questions/2108727/ \
|
37
|
+
# which-in-ruby-checking-if-program-exists-in-path-from-ruby
|
38
|
+
def command? cmd
|
39
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
40
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
41
|
+
exts.each do |ext|
|
42
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
43
|
+
return exe if File.executable?(exe) && !File.directory?(exe)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
return nil
|
48
|
+
end
|
49
|
+
|
50
|
+
def check_command cmd
|
51
|
+
path = command? cmd
|
52
|
+
|
53
|
+
AbortIf.abort_unless path,
|
54
|
+
"MIssing #{cmd} command. Is it on your path?"
|
55
|
+
|
56
|
+
path
|
57
|
+
end
|
35
58
|
end
|
36
59
|
end
|
data/lib/aai/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Moore
|
@@ -152,7 +152,7 @@ description: Calculate Seanie's amino acid similarity score between multiple gen
|
|
152
152
|
email:
|
153
153
|
- moorer@udel.edu
|
154
154
|
executables:
|
155
|
-
- aai
|
155
|
+
- aai
|
156
156
|
extensions: []
|
157
157
|
extra_rdoc_files: []
|
158
158
|
files:
|
@@ -168,7 +168,7 @@ files:
|
|
168
168
|
- aai.gemspec
|
169
169
|
- bin/console
|
170
170
|
- bin/setup
|
171
|
-
- exe/aai
|
171
|
+
- exe/aai
|
172
172
|
- lib/aai.rb
|
173
173
|
- lib/aai/core_extensions.rb
|
174
174
|
- lib/aai/utils.rb
|