bio-kmer_counter 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -3
- data/VERSION +1 -1
- data/bin/kmer_counter.rb +2 -2
- data/lib/bio-kmer_counter/kmer_counter.rb +10 -1
- data/test/test_bio-kmer_counter.rb +7 -0
- metadata +147 -157
- data/README.rdoc +0 -48
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Note: this software is under active development!
|
|
15
15
|
## Installation
|
16
16
|
|
17
17
|
```sh
|
18
|
-
|
18
|
+
gem install bio-kmer_counter
|
19
19
|
```
|
20
20
|
|
21
21
|
## Usage
|
@@ -25,11 +25,16 @@ content, reporting the fingerprint of 5kb windows in each sequence separately,
|
|
25
25
|
plus the leftover part if it is longer than 2kb:
|
26
26
|
|
27
27
|
```sh
|
28
|
-
|
28
|
+
kmer_counter.rb <fasta_file> >tetranucleotide_content.csv
|
29
29
|
```
|
30
30
|
|
31
31
|
The fingerprints are reported in percentages. Well, between 0 and 1, that is.
|
32
|
-
From there it is up to you how to use the fingerprints, sorry.
|
32
|
+
From there it is up to you how to use the fingerprints, sorry. For the full
|
33
|
+
gamut of options, see
|
34
|
+
|
35
|
+
```sh
|
36
|
+
kmer_counter.rb -h
|
37
|
+
```
|
33
38
|
|
34
39
|
## Project home page
|
35
40
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/bin/kmer_counter.rb
CHANGED
@@ -23,7 +23,7 @@ options = {
|
|
23
23
|
:progressbar => true,
|
24
24
|
}
|
25
25
|
|
26
|
-
OptionParser.new do |opts|
|
26
|
+
o = OptionParser.new do |opts|
|
27
27
|
opts.banner = USAGE
|
28
28
|
|
29
29
|
opts.on("-w", "--window-size SIZE", "Length of the window to be used [default #{options[:window_size]}]") do |v|
|
@@ -92,7 +92,7 @@ OptionParser.new do |opts|
|
|
92
92
|
opts.on("--trace options",String,"Set log level [default INFO]. e.g. '--trace debug' to set logging level to DEBUG") do | s |
|
93
93
|
Bio::Log::CLI.trace(s)
|
94
94
|
end
|
95
|
-
end.parse!
|
95
|
+
end; o.parse!
|
96
96
|
if ARGV.length != 1
|
97
97
|
$stderr.puts o
|
98
98
|
exit 1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
module Bio
|
3
3
|
class Sequence
|
4
4
|
class NA
|
@@ -12,6 +12,8 @@ module Bio
|
|
12
12
|
end
|
13
13
|
|
14
14
|
class Kmer
|
15
|
+
# Return a hash of Strings to 0, for each kmer of length k. For instance
|
16
|
+
# empty_full_kmer_hash(1) => {'A'=>0, 'T'=>0, 'C'=>0, 'G'=>0}
|
15
17
|
def self.empty_full_kmer_hash(k=4)
|
16
18
|
return @empty_full_hash.dup unless @empty_full_hash.nil?
|
17
19
|
|
@@ -29,6 +31,13 @@ module Bio
|
|
29
31
|
counts
|
30
32
|
end
|
31
33
|
|
34
|
+
# Take a kmer hash, and merge those keys to the lowest lexigraphical form
|
35
|
+
# (See Bio::Sequence::NA#lowest_lexigraphical_form for what this means)
|
36
|
+
# When 2 keys are reverse complements they get merged into one hash entry,
|
37
|
+
# where the key is the lowest_lexigraphical_form of the two and the
|
38
|
+
# value is the sum of the original 2 values
|
39
|
+
#
|
40
|
+
# For instance {'A'=>2,'T'=>5} #=> {'A'=>7}
|
32
41
|
def self.merge_down_to_lowest_lexigraphical_form(hash)
|
33
42
|
keys = empty_full_kmer_hash.keys
|
34
43
|
|
@@ -95,4 +95,11 @@ class TestBioKmerCounter < Test::Unit::TestCase
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
98
|
+
|
99
|
+
should "print help when no arguments are given" do
|
100
|
+
command = "#{script_path}"
|
101
|
+
Open3.popen3(command) do |stdin, stdout, stderr|
|
102
|
+
assert stderr.readlines[0].match(/^Usage: kmer_counter/)
|
103
|
+
end
|
104
|
+
end
|
98
105
|
end
|
metadata
CHANGED
@@ -1,179 +1,175 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-kmer_counter
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ben J Woodcroft
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 3
|
27
|
-
segments:
|
28
|
-
- 1
|
29
|
-
- 4
|
30
|
-
- 2
|
31
|
-
version: 1.4.2
|
32
|
-
version_requirements: *id001
|
12
|
+
date: 2012-07-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
33
15
|
name: bio
|
34
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.4.2
|
35
22
|
type: :runtime
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 51
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
- 11
|
46
|
-
- 0
|
47
|
-
version: 0.11.0
|
48
|
-
version_requirements: *id002
|
49
|
-
name: progressbar
|
50
23
|
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.4.2
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: progressbar
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.11.0
|
51
38
|
type: :runtime
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
|
-
requirements:
|
56
|
-
- - ">="
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 41
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
- 5
|
62
|
-
- 17
|
63
|
-
version: 0.5.17
|
64
|
-
version_requirements: *id003
|
65
|
-
name: parallel
|
66
39
|
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.11.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: parallel
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.5.17
|
67
54
|
type: :runtime
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
|
-
requirements:
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 21
|
75
|
-
segments:
|
76
|
-
- 1
|
77
|
-
- 0
|
78
|
-
- 1
|
79
|
-
version: 1.0.1
|
80
|
-
version_requirements: *id004
|
81
|
-
name: bio-logger
|
82
55
|
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.5.17
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bio-logger
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.0.1
|
83
70
|
type: :runtime
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
|
-
requirements:
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
hash: 3
|
91
|
-
segments:
|
92
|
-
- 0
|
93
|
-
version: "0"
|
94
|
-
version_requirements: *id005
|
95
|
-
name: shoulda
|
96
71
|
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.0.1
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: shoulda
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
97
86
|
type: :development
|
98
|
-
|
99
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
89
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
|
106
|
-
- 3
|
107
|
-
- 12
|
108
|
-
version: "3.12"
|
109
|
-
version_requirements: *id006
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
110
95
|
name: rdoc
|
111
|
-
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '3.12'
|
112
102
|
type: :development
|
113
|
-
|
114
|
-
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
115
105
|
none: false
|
116
|
-
requirements:
|
106
|
+
requirements:
|
117
107
|
- - ~>
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
|
120
|
-
|
121
|
-
- 1
|
122
|
-
- 8
|
123
|
-
- 3
|
124
|
-
version: 1.8.3
|
125
|
-
version_requirements: *id007
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.12'
|
110
|
+
- !ruby/object:Gem::Dependency
|
126
111
|
name: jeweler
|
127
|
-
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.8.3
|
128
118
|
type: :development
|
129
|
-
- !ruby/object:Gem::Dependency
|
130
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
|
-
requirements:
|
133
|
-
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
hash: 61
|
136
|
-
segments:
|
137
|
-
- 1
|
138
|
-
- 0
|
139
|
-
- 21
|
140
|
-
version: 1.0.21
|
141
|
-
version_requirements: *id008
|
142
|
-
name: bundler
|
143
119
|
prerelease: false
|
144
|
-
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
requirement: &id009 !ruby/object:Gem::Requirement
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
121
|
none: false
|
148
|
-
requirements:
|
122
|
+
requirements:
|
149
123
|
- - ~>
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.8.3
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: bundler
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 1.0.21
|
134
|
+
type: :development
|
158
135
|
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 1.0.21
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rdoc
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ~>
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '3.12'
|
159
150
|
type: :development
|
160
|
-
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '3.12'
|
158
|
+
description: A biogem for counting small kmers for fingerprinting nucleotide sequences.
|
159
|
+
See README for details.
|
161
160
|
email: gmail.com after donttrustben
|
162
|
-
executables:
|
161
|
+
executables:
|
163
162
|
- kmer_counter.rb
|
164
163
|
extensions: []
|
165
|
-
|
166
|
-
extra_rdoc_files:
|
164
|
+
extra_rdoc_files:
|
167
165
|
- LICENSE.txt
|
168
166
|
- README.md
|
169
|
-
|
170
|
-
files:
|
167
|
+
files:
|
171
168
|
- .document
|
172
169
|
- .travis.yml
|
173
170
|
- Gemfile
|
174
171
|
- LICENSE.txt
|
175
172
|
- README.md
|
176
|
-
- README.rdoc
|
177
173
|
- Rakefile
|
178
174
|
- VERSION
|
179
175
|
- bin/kmer_counter.rb
|
@@ -182,37 +178,31 @@ files:
|
|
182
178
|
- test/helper.rb
|
183
179
|
- test/test_bio-kmer_counter.rb
|
184
180
|
homepage: http://github.com/wwood/bioruby-kmer_counter
|
185
|
-
licenses:
|
181
|
+
licenses:
|
186
182
|
- MIT
|
187
183
|
post_install_message:
|
188
184
|
rdoc_options: []
|
189
|
-
|
190
|
-
require_paths:
|
185
|
+
require_paths:
|
191
186
|
- lib
|
192
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
188
|
none: false
|
194
|
-
requirements:
|
195
|
-
- -
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
|
198
|
-
segments:
|
189
|
+
requirements:
|
190
|
+
- - ! '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
segments:
|
199
194
|
- 0
|
200
|
-
|
201
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
|
+
hash: -309263761
|
196
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
197
|
none: false
|
203
|
-
requirements:
|
204
|
-
- -
|
205
|
-
- !ruby/object:Gem::Version
|
206
|
-
|
207
|
-
segments:
|
208
|
-
- 0
|
209
|
-
version: "0"
|
198
|
+
requirements:
|
199
|
+
- - ! '>='
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
210
202
|
requirements: []
|
211
|
-
|
212
203
|
rubyforge_project:
|
213
204
|
rubygems_version: 1.8.24
|
214
205
|
signing_key:
|
215
206
|
specification_version: 3
|
216
207
|
summary: A biogem for counting small kmers for fingerprinting nucleotide sequences
|
217
208
|
test_files: []
|
218
|
-
|
data/README.rdoc
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
= bio-kmer_counter
|
2
|
-
|
3
|
-
{<img
|
4
|
-
src="https://secure.travis-ci.org/wwood/bioruby-kmer_counter.png"
|
5
|
-
/>}[http://travis-ci.org/#!/wwood/bioruby-kmer_counter]
|
6
|
-
|
7
|
-
Full description goes here
|
8
|
-
|
9
|
-
Note: this software is under active development!
|
10
|
-
|
11
|
-
== Installation
|
12
|
-
|
13
|
-
gem install bio-kmer_counter
|
14
|
-
|
15
|
-
== Usage
|
16
|
-
|
17
|
-
== Developers
|
18
|
-
|
19
|
-
To use the library
|
20
|
-
|
21
|
-
require 'bio-kmer_counter'
|
22
|
-
|
23
|
-
The API doc is online. For more code examples see also the test files in
|
24
|
-
the source tree.
|
25
|
-
|
26
|
-
== Project home page
|
27
|
-
|
28
|
-
Information on the source tree, documentation, issues and how to contribute, see
|
29
|
-
|
30
|
-
http://github.com/wwood/bioruby-kmer_counter
|
31
|
-
|
32
|
-
The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
|
33
|
-
|
34
|
-
== Cite
|
35
|
-
|
36
|
-
If you use this software, please cite one of
|
37
|
-
|
38
|
-
* [BioRuby: bioinformatics software for the Ruby programming language](http://dx.doi.org/10.1093/bioinformatics/btq475)
|
39
|
-
* [Biogem: an effective tool-based approach for scaling up open source software development in bioinformatics](http://dx.doi.org/10.1093/bioinformatics/bts080)
|
40
|
-
|
41
|
-
== Biogems.info
|
42
|
-
|
43
|
-
This Biogem is published at http://biogems.info/index.html#bio-kmer_counter
|
44
|
-
|
45
|
-
== Copyright
|
46
|
-
|
47
|
-
Copyright (c) 2012 Ben J Woodcroft. See LICENSE.txt for further details.
|
48
|
-
|