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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd9af1e776474a382a6c83d27194d1001579e0e3
4
- data.tar.gz: 3cfbfb4aa4a9371f470cd129dc32ab9dcffd1838
3
+ metadata.gz: 14d742b51fba76ccd8b279d36ee672e2ee8cb329
4
+ data.tar.gz: 2bdc68dc8d289e3d9770373f856d9e05d6c1a0b0
5
5
  SHA512:
6
- metadata.gz: bfdc658e2d8b5bb1b635428038a7fe18e13e8c1cfabe934cda192e1091a3ee87f55f0113494a61ad7a85c0bc231ef9854e98af69ab589ef44f3cdadbb4c2f65f
7
- data.tar.gz: 37478156d0f3e00340ac6e0f4097e020f666c350e5f1e60e118f061bd996b2b4834036af579d2875e4a02fbbe20eb3e5f6f6a46ab2cdd1831df8b2fad8dbe8ff
6
+ metadata.gz: 0c36035231ab8a7a8608d545b617d2f23009479b625efd9385076f229e18b086dcddaff9eb9b49fa9431e9236c377442a1562861d9352317cfc8cc218160d09a
7
+ data.tar.gz: fc78b1e0a2e5e83a0841c8cb31706095e6b55a85dfd76ddb892f2f3873335dce664a91ffe410cc1b13c1de2521b0a034b15a8f75620fa0092fdd95af8b2110e2
@@ -6,4 +6,12 @@ rvm:
6
6
  - 2.2
7
7
  - 2.3
8
8
  - 2.4
9
- before_install: gem install bundler -v 1.14.6
9
+
10
+ addons:
11
+ apt:
12
+ packages:
13
+ - parallel
14
+ - ncbi-blast+
15
+
16
+ before_install:
17
+ - gem install bundler -v 1.14.6
data/README.md CHANGED
@@ -4,10 +4,25 @@
4
4
  [![Coverage Status](https://coveralls.io/repos/github/mooreryan/aai/badge.svg?branch=master)](https://coveralls.io/github/mooreryan/aai?branch=master)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- Or install it yourself as:
22
-
23
- $ gem install aai
36
+ ## Usage
24
37
 
25
- ## Requirements
38
+ ### Example
26
39
 
27
- - GNU Parallel
28
- - NCBI Blast suite
40
+ ```
41
+ $ ruby exe/aai.rb --infiles *.fa
42
+ ```
29
43
 
30
- ## Usage
44
+ ### Options
31
45
 
32
- TODO: Write usage instructions here
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
 
@@ -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
@@ -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]
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Aai
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  COPYRIGHT = "2017 Ryan Moore"
4
4
  CONTACT = "moorer@udel.edu"
5
5
  WEBSITE = "https://github.com/mooreryan/aai"
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.1.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.rb
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.rb
171
+ - exe/aai
172
172
  - lib/aai.rb
173
173
  - lib/aai/core_extensions.rb
174
174
  - lib/aai/utils.rb