lederhosen 0.2.0 → 0.2.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/lib/lederhosen/tasks/k_filter.rb +5 -1
- data/lib/version.rb +1 -1
- data/spec/pipeline_spec.rb +6 -1
- metadata +4 -4
@@ -23,14 +23,18 @@ module Lederhosen
|
|
23
23
|
total_reads = 0
|
24
24
|
|
25
25
|
ohai "counting kmers"
|
26
|
+
total_reads = `grep -c '^>' #{input}`.strip.split.first.to_i
|
27
|
+
pbar = ProgressBar.new 'count kmers', total_reads.to_i
|
26
28
|
File.open(input) do |handle|
|
27
29
|
records = Dna.new handle
|
28
30
|
records.each do |r|
|
31
|
+
pbar.inc
|
29
32
|
total_reads += 1
|
30
33
|
kmers = r.sequence.to_kmers(k_len)
|
31
34
|
kmers.each { |x| counting_table[x] += 1 }
|
32
35
|
end
|
33
36
|
end
|
37
|
+
pbar.finish
|
34
38
|
|
35
39
|
sum_of_kmers = counting_table.values.inject(:+)
|
36
40
|
|
@@ -65,7 +69,7 @@ module Lederhosen
|
|
65
69
|
kept += 1
|
66
70
|
output.puts r
|
67
71
|
end
|
68
|
-
pbar.inc
|
72
|
+
pbar.inc
|
69
73
|
end
|
70
74
|
end
|
71
75
|
|
data/lib/version.rb
CHANGED
data/spec/pipeline_spec.rb
CHANGED
@@ -22,8 +22,13 @@ describe 'the pipeline' do
|
|
22
22
|
$?.success?.should be_true
|
23
23
|
end
|
24
24
|
|
25
|
+
it 'should k_filter reads' do
|
26
|
+
`./bin/lederhosen k_filter --input=#{$test_dir}/sorted.fasta --output=#{$test_dir}/filtered.fasta -k=15 --cutoff 1`
|
27
|
+
$?.success?.should be_true
|
28
|
+
end
|
29
|
+
|
25
30
|
it 'should cluster reads' do
|
26
|
-
`./bin/lederhosen cluster --identity=0.80 --input=#{$test_dir}/
|
31
|
+
`./bin/lederhosen cluster --identity=0.80 --input=#{$test_dir}/filtered.fasta --output=#{$test_dir}/clusters.uc`
|
27
32
|
$?.success?.should be_true
|
28
33
|
end
|
29
34
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lederhosen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Austin G. Davis-Richardson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-30 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: dna
|