bio-velvet 0.3.0 → 0.4.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/README.md +2 -0
- data/VERSION +1 -1
- data/lib/bio-velvet/runner.rb +20 -2
- data/spec/runner_spec.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c57762cbeea6210a80415e335e38894efc69aa
|
4
|
+
data.tar.gz: 9a8aba9cfb9a98b76679b025e0833ca366554e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7deb192d00d7c4a8461c2e6953a1529ed9b66d2f5191840b71fcbe78d953f1f35c0f807ee62e572af0b6d196e961700d5fb45d1dfa181af054803e3d280478f8
|
7
|
+
data.tar.gz: 7938fc6ecdacb84be8b1720fe00cdeff46f2d8edb4a866bbe9fe0d0b449ab275275f0dc5c2453276dac1e54e30bc3eb312a3db099536c11b67e7d698cf6c1df6
|
data/README.md
CHANGED
@@ -21,6 +21,8 @@ velvet_result = Bio::Velvet::Runner.new.velvet(87, '-short /path/to/reads.fa') #
|
|
21
21
|
|
22
22
|
contigs_file = velvet_result.contigs_path #=> path to contigs file as a String
|
23
23
|
lastgraph_file = velvet_result.last_graph_path #=> path to last graph file as a String
|
24
|
+
|
25
|
+
Bio::Velvet::Runner.new.binary_version #=> e.g. "1.2.08"
|
24
26
|
```
|
25
27
|
|
26
28
|
By default, the ```velvet``` method passes no parameters to ```velvetg``` other than the velvet directory created by velveth. This directory is a temporary directory by default, but this can also be set. For instance, to run velvet using with a ```-cov_cutoff``` parameter in the ```velvet_dir``` directory:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/bio-velvet/runner.rb
CHANGED
@@ -24,7 +24,7 @@ module Bio
|
|
24
24
|
result = Result.new
|
25
25
|
outdir = nil
|
26
26
|
if options[:output_assembly_path]
|
27
|
-
log.debug "Using pre-defined assembly directory: #{options[:output_assembly_path]}"
|
27
|
+
log.debug "Using pre-defined assembly directory: #{options[:output_assembly_path] }"
|
28
28
|
outdir = options[:output_assembly_path]
|
29
29
|
else
|
30
30
|
outdir = Files.create.root
|
@@ -45,7 +45,8 @@ module Bio
|
|
45
45
|
end
|
46
46
|
|
47
47
|
# Run velvetg, with a Bio::Velvet::Result object
|
48
|
-
# generated with velveth
|
48
|
+
# generated with velveth, and velvetg arguments as a String (no need to specify the velvet directory, just the extra
|
49
|
+
# arguments).
|
49
50
|
def velvetg(velveth_result_object, velvetg_arguments)
|
50
51
|
cmd = "velvetg #{velveth_result_object.result_directory} #{velvetg_arguments}"
|
51
52
|
log.info "Running velvetg: #{cmd}" if log.info?
|
@@ -58,6 +59,23 @@ module Bio
|
|
58
59
|
|
59
60
|
return velveth_result_object
|
60
61
|
end
|
62
|
+
|
63
|
+
# Detect the binary version currently in use and return
|
64
|
+
# as a String
|
65
|
+
def binary_version
|
66
|
+
cmd = 'velveth'
|
67
|
+
log.info "Running velveth: #{cmd}" if log.info?
|
68
|
+
status, stdout, stderr = systemu cmd
|
69
|
+
if status.exitstatus != 0
|
70
|
+
raise VelvetRunnerException, "Error running velveth: #{stderr}\n#{stdout}"
|
71
|
+
end
|
72
|
+
splits = stdout.split("\n")
|
73
|
+
if splits.length > 1 and matches = splits[1].match(/^Version (.+)$/)
|
74
|
+
return matches[1]
|
75
|
+
else
|
76
|
+
raise "Unable to parse the version number from running `#{cmd}', the output was: #{stdout}"
|
77
|
+
end
|
78
|
+
end
|
61
79
|
end
|
62
80
|
|
63
81
|
class VelvetRunnerException < Exception; end
|
data/spec/runner_spec.rb
CHANGED
@@ -18,7 +18,7 @@ describe "BioVelvet" do
|
|
18
18
|
ATAATGGAGAGTATACTGGTCAAGCAACTATATCTGTAACTAATGGCAATGAAGCTGGAA
|
19
19
|
GTATAATAAATAATATTACTATGAATGATGGCAATGTATTATTTAATGTACAAATTAAAA
|
20
20
|
ACTATGCTGGTATTTCACTTCCAGGTACAGG'+"\n"
|
21
|
-
exp.gsub!(/
|
21
|
+
exp.gsub!(/ / ,'')
|
22
22
|
|
23
23
|
File.open(contigs_path).read.should == exp
|
24
24
|
|
@@ -51,7 +51,7 @@ describe "BioVelvet" do
|
|
51
51
|
ATAATGGAGAGTATACTGGTCAAGCAACTATATCTGTAACTAATGGCAATGAAGCTGGAA
|
52
52
|
GTATAATAAATAATATTACTATGAATGATGGCAATGTATTATTTAATGTACAAATTAAAA
|
53
53
|
ACTATGCTGGTATTTCACTTCCAGGTACAGG'+"\n"
|
54
|
-
exp.gsub!(/
|
54
|
+
exp.gsub!(/ / ,'')
|
55
55
|
|
56
56
|
File.open(contigs_path).read.should == exp
|
57
57
|
|
@@ -64,4 +64,8 @@ describe "BioVelvet" do
|
|
64
64
|
FileUtils.remove_entry_secure(result.result_directory, true)
|
65
65
|
File.exist?(outdir).should == false
|
66
66
|
end
|
67
|
+
|
68
|
+
it 'should detect binary_version' do
|
69
|
+
Bio::Velvet::Runner.new.binary_version.match(/^1\..+/).should_not be_nil #will velvet every make it out of version 1.X ? If so, this test will fail.
|
70
|
+
end
|
67
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-velvet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben J Woodcroft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bio-logger
|