bio-samtools 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +2 -0
- data/Gemfile +6 -4
- data/README.md +112 -0
- data/Rakefile +3 -0
- data/VERSION +1 -1
- data/bio-samtools.gemspec +30 -17
- data/ext/Makefile-bioruby.patch +8 -23
- data/ext/Makefile-suse.patch +11 -0
- data/ext/mkrf_conf.rb +2 -0
- data/lib/bio/db/sam.rb +18 -14
- data/lib/bio/db/sam/external/VERSION +1 -1
- data/lib/bio/db/sam/library.rb +2 -2
- data/lib/bio/db/sam/sam.rb +1 -1
- data/test/samples/pipe_char/test.bam +0 -0
- data/test/samples/pipe_char/test.bam.bai +0 -0
- data/test/samples/pipe_char/test.tam +10 -0
- data/test/samples/pipe_char/test_chr.fasta +1000 -0
- data/test/samples/pipe_char/test_chr.fasta.fai +1 -0
- data/test/test_basic.rb +32 -0
- metadata +74 -64
- data/Gemfile.lock +0 -32
- data/README.rdoc +0 -88
@@ -0,0 +1 @@
|
|
1
|
+
gi|123|chr_1 69930 14 70 71
|
data/test/test_basic.rb
CHANGED
@@ -312,6 +312,38 @@ class TestBioDbSam < Test::Unit::TestCase
|
|
312
312
|
assert_equal(10,vcf_list.length)
|
313
313
|
vcf_list.each {|p| assert_kind_of(Bio::DB::Vcf, p)}
|
314
314
|
end
|
315
|
+
|
316
|
+
# test whether command line calls to mpileup are correctly escaped
|
317
|
+
def test_mpileup_escaping
|
318
|
+
test_dir = File.join('test','samples','pipe_char')
|
319
|
+
sam = Bio::DB::Sam.new(
|
320
|
+
:fasta => File.join(test_dir,'test_chr.fasta'),
|
321
|
+
:bam => File.join(test_dir, 'test.bam')
|
322
|
+
)
|
323
|
+
pileup_list = []
|
324
|
+
sam.mpileup(:region => "gi|123|chr_1:100-109") do |pile|
|
325
|
+
pileup_list << pile
|
326
|
+
end
|
327
|
+
assert_equal(10,pileup_list.length)
|
328
|
+
pileup_list.each do |p|
|
329
|
+
assert_kind_of(Bio::DB::Pileup, p)
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
# test whether command line calls to mpileup are correctly escaped
|
334
|
+
def test_mpileup_error_reporting
|
335
|
+
test_dir = File.join('test','samples','pipe_char')
|
336
|
+
sam = Bio::DB::Sam.new(
|
337
|
+
:fasta => File.join(test_dir,'does_not_exist.fasta'),
|
338
|
+
:bam => File.join(test_dir, 'test.bam')
|
339
|
+
)
|
340
|
+
assert_raise Bio::DB::SAMException do
|
341
|
+
pileup_list = []
|
342
|
+
sam.mpileup(:region => "gi|123|chr_1:100-109") do |pile|
|
343
|
+
pileup_list << pile
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
315
347
|
|
316
348
|
#test whether the call to mpileup returns a vcf object if :g => true is used on the command-line
|
317
349
|
# def test_vcf
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-samtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
5
|
-
prerelease:
|
4
|
+
version: 0.6.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ricardo Ramirez-Gonzalez
|
@@ -11,154 +10,164 @@ authors:
|
|
11
10
|
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date:
|
13
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: ffi
|
18
17
|
requirement: !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
18
|
requirements:
|
21
|
-
- -
|
19
|
+
- - ">="
|
22
20
|
- !ruby/object:Gem::Version
|
23
21
|
version: '0'
|
24
22
|
type: :runtime
|
25
23
|
prerelease: false
|
26
24
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
25
|
requirements:
|
29
|
-
- -
|
26
|
+
- - ">="
|
30
27
|
- !ruby/object:Gem::Version
|
31
28
|
version: '0'
|
32
29
|
- !ruby/object:Gem::Dependency
|
33
30
|
name: bio
|
34
31
|
requirement: !ruby/object:Gem::Requirement
|
35
|
-
none: false
|
36
32
|
requirements:
|
37
|
-
- -
|
33
|
+
- - ">="
|
38
34
|
- !ruby/object:Gem::Version
|
39
35
|
version: 1.4.2
|
40
36
|
type: :runtime
|
41
37
|
prerelease: false
|
42
38
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
39
|
requirements:
|
45
|
-
- -
|
40
|
+
- - ">="
|
46
41
|
- !ruby/object:Gem::Version
|
47
42
|
version: 1.4.2
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: systemu
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 2.5.2
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.5.2
|
48
57
|
- !ruby/object:Gem::Dependency
|
49
58
|
name: shoulda
|
50
59
|
requirement: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
60
|
requirements:
|
53
|
-
- -
|
61
|
+
- - ">="
|
54
62
|
- !ruby/object:Gem::Version
|
55
63
|
version: '0'
|
56
64
|
type: :development
|
57
65
|
prerelease: false
|
58
66
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
67
|
requirements:
|
61
|
-
- -
|
68
|
+
- - ">="
|
62
69
|
- !ruby/object:Gem::Version
|
63
70
|
version: '0'
|
64
71
|
- !ruby/object:Gem::Dependency
|
65
|
-
name:
|
72
|
+
name: shoulda-context
|
66
73
|
requirement: !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
74
|
requirements:
|
69
|
-
- -
|
75
|
+
- - ">="
|
70
76
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
77
|
+
version: '0'
|
72
78
|
type: :development
|
73
79
|
prerelease: false
|
74
80
|
version_requirements: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
81
|
requirements:
|
77
|
-
- -
|
82
|
+
- - ">="
|
78
83
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
84
|
+
version: '0'
|
80
85
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
86
|
+
name: shoulda-matchers
|
82
87
|
requirement: !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
88
|
requirements:
|
85
|
-
- -
|
89
|
+
- - ">="
|
86
90
|
- !ruby/object:Gem::Version
|
87
91
|
version: '0'
|
88
92
|
type: :development
|
89
93
|
prerelease: false
|
90
94
|
version_requirements: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
95
|
requirements:
|
93
|
-
- -
|
96
|
+
- - ">="
|
94
97
|
- !ruby/object:Gem::Version
|
95
98
|
version: '0'
|
96
99
|
- !ruby/object:Gem::Dependency
|
97
|
-
name:
|
100
|
+
name: bundler
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.0.21
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.0.21
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: jeweler
|
98
115
|
requirement: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
116
|
requirements:
|
101
|
-
- -
|
117
|
+
- - ">="
|
102
118
|
- !ruby/object:Gem::Version
|
103
119
|
version: '0'
|
104
120
|
type: :development
|
105
121
|
prerelease: false
|
106
122
|
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
123
|
requirements:
|
109
|
-
- -
|
124
|
+
- - ">="
|
110
125
|
- !ruby/object:Gem::Version
|
111
126
|
version: '0'
|
112
127
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
128
|
+
name: rcov
|
114
129
|
requirement: !ruby/object:Gem::Requirement
|
115
|
-
none: false
|
116
130
|
requirements:
|
117
|
-
- -
|
131
|
+
- - ">="
|
118
132
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
133
|
+
version: '0'
|
120
134
|
type: :development
|
121
135
|
prerelease: false
|
122
136
|
version_requirements: !ruby/object:Gem::Requirement
|
123
|
-
none: false
|
124
137
|
requirements:
|
125
|
-
- -
|
138
|
+
- - ">="
|
126
139
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
140
|
+
version: '0'
|
128
141
|
- !ruby/object:Gem::Dependency
|
129
|
-
name:
|
142
|
+
name: simplecov
|
130
143
|
requirement: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
144
|
requirements:
|
133
|
-
- -
|
145
|
+
- - ">="
|
134
146
|
- !ruby/object:Gem::Version
|
135
147
|
version: '0'
|
136
148
|
type: :development
|
137
149
|
prerelease: false
|
138
150
|
version_requirements: !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
151
|
requirements:
|
141
|
-
- -
|
152
|
+
- - ">="
|
142
153
|
- !ruby/object:Gem::Version
|
143
154
|
version: '0'
|
144
155
|
- !ruby/object:Gem::Dependency
|
145
156
|
name: rdoc
|
146
157
|
requirement: !ruby/object:Gem::Requirement
|
147
|
-
none: false
|
148
158
|
requirements:
|
149
|
-
- -
|
159
|
+
- - ">="
|
150
160
|
- !ruby/object:Gem::Version
|
151
161
|
version: '0'
|
152
162
|
type: :development
|
153
163
|
prerelease: false
|
154
164
|
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
none: false
|
156
165
|
requirements:
|
157
|
-
- -
|
166
|
+
- - ">="
|
158
167
|
- !ruby/object:Gem::Version
|
159
168
|
version: '0'
|
160
|
-
description:
|
161
|
-
|
169
|
+
description: "Binder of samtools for ruby, on the top of FFI. \n\n This project was
|
170
|
+
born from the need to add support of BAM files to \n the gee_fu genome browser
|
162
171
|
(http://github.com/danmaclean/gee_fu)."
|
163
172
|
email: ilpuccio.febo@gmail.com
|
164
173
|
executables: []
|
@@ -166,14 +175,13 @@ extensions:
|
|
166
175
|
- ext/mkrf_conf.rb
|
167
176
|
extra_rdoc_files:
|
168
177
|
- LICENSE.txt
|
169
|
-
- README.
|
178
|
+
- README.md
|
170
179
|
files:
|
171
|
-
- .document
|
172
|
-
- .travis.yml
|
180
|
+
- ".document"
|
181
|
+
- ".travis.yml"
|
173
182
|
- Gemfile
|
174
|
-
- Gemfile.lock
|
175
183
|
- LICENSE.txt
|
176
|
-
- README.
|
184
|
+
- README.md
|
177
185
|
- Rakefile
|
178
186
|
- VERSION
|
179
187
|
- bio-samtools.gemspec
|
@@ -304,6 +312,7 @@ files:
|
|
304
312
|
- doc/tutorial.html
|
305
313
|
- doc/tutorial.pdf
|
306
314
|
- ext/Makefile-bioruby.patch
|
315
|
+
- ext/Makefile-suse.patch
|
307
316
|
- ext/mkrf_conf.rb
|
308
317
|
- lib/bio-samtools.rb
|
309
318
|
- lib/bio/.DS_Store
|
@@ -317,6 +326,11 @@ files:
|
|
317
326
|
- lib/bio/db/sam/sam.rb
|
318
327
|
- lib/bio/db/vcf.rb
|
319
328
|
- test/helper.rb
|
329
|
+
- test/samples/pipe_char/test.bam
|
330
|
+
- test/samples/pipe_char/test.bam.bai
|
331
|
+
- test/samples/pipe_char/test.tam
|
332
|
+
- test/samples/pipe_char/test_chr.fasta
|
333
|
+
- test/samples/pipe_char/test_chr.fasta.fai
|
320
334
|
- test/samples/small/ids2.txt
|
321
335
|
- test/samples/small/sorted.bam
|
322
336
|
- test/samples/small/sorted.bam.bai
|
@@ -343,29 +357,25 @@ files:
|
|
343
357
|
homepage: http://github.com/helios/bioruby-samtools
|
344
358
|
licenses:
|
345
359
|
- MIT
|
360
|
+
metadata: {}
|
346
361
|
post_install_message:
|
347
362
|
rdoc_options: []
|
348
363
|
require_paths:
|
349
364
|
- lib
|
350
365
|
required_ruby_version: !ruby/object:Gem::Requirement
|
351
|
-
none: false
|
352
366
|
requirements:
|
353
|
-
- -
|
367
|
+
- - ">="
|
354
368
|
- !ruby/object:Gem::Version
|
355
369
|
version: '0'
|
356
|
-
segments:
|
357
|
-
- 0
|
358
|
-
hash: 2827091236033561121
|
359
370
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
360
|
-
none: false
|
361
371
|
requirements:
|
362
|
-
- -
|
372
|
+
- - ">="
|
363
373
|
- !ruby/object:Gem::Version
|
364
374
|
version: '0'
|
365
375
|
requirements: []
|
366
376
|
rubyforge_project:
|
367
|
-
rubygems_version:
|
377
|
+
rubygems_version: 2.2.1
|
368
378
|
signing_key:
|
369
|
-
specification_version:
|
379
|
+
specification_version: 4
|
370
380
|
summary: Binder of samtools for ruby, on the top of FFI.
|
371
381
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
bio (1.4.2)
|
5
|
-
ffi (1.0.9)
|
6
|
-
ffi (1.0.9-java)
|
7
|
-
git (1.2.5)
|
8
|
-
jeweler (1.6.0)
|
9
|
-
bundler (~> 1.0.0)
|
10
|
-
git (>= 1.2.5)
|
11
|
-
rake
|
12
|
-
json (1.6.1)
|
13
|
-
json (1.6.1-java)
|
14
|
-
rake (0.9.2.2)
|
15
|
-
rcov (0.9.9)
|
16
|
-
rcov (0.9.9-java)
|
17
|
-
rdoc (3.11)
|
18
|
-
json (~> 1.4)
|
19
|
-
shoulda (2.11.3)
|
20
|
-
|
21
|
-
PLATFORMS
|
22
|
-
java
|
23
|
-
ruby
|
24
|
-
|
25
|
-
DEPENDENCIES
|
26
|
-
bio (>= 1.4.2)
|
27
|
-
bundler (~> 1.0.0)
|
28
|
-
ffi
|
29
|
-
jeweler
|
30
|
-
rcov
|
31
|
-
rdoc
|
32
|
-
shoulda
|
data/README.rdoc
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
= bio-samtools
|
2
|
-
|
3
|
-
The original project samtools-ruby belongs to Ricardo H. Ramirez @ https://github.com/homonecloco/samtools-ruby
|
4
|
-
|
5
|
-
== Introduction
|
6
|
-
|
7
|
-
|
8
|
-
Documentation and code come from that project and we'll adapt it for a better integration in BioRuby.
|
9
|
-
|
10
|
-
Binder of samtools for ruby, on the top of FFI.
|
11
|
-
|
12
|
-
This project was born from the need to add support of BAM files to
|
13
|
-
the gee_fu genome browser (http://github.com/danmaclean/gee_fu).
|
14
|
-
|
15
|
-
== Installation
|
16
|
-
'gem install bio-samtools'
|
17
|
-
|
18
|
-
== Usage
|
19
|
-
See doc/tutorial.html or doc/tutorial.pdf for a walkthrough tutorial. The documentation in doc/index.html provides information on individual objects
|
20
|
-
and methods.
|
21
|
-
|
22
|
-
The easiest way to see bio-samtools in action is to try the tests:
|
23
|
-
rake test
|
24
|
-
is all you should need to get the tests to run.
|
25
|
-
|
26
|
-
However on some systems (at least the one belonging to one of our developers on Mac OS X Lion, with the Apple provided Ruby) then you can get
|
27
|
-
a LoadError: no such file to load 'ffi', despite it being installed. This is something to do with RubyGems and rake test that we
|
28
|
-
haven't got to the bottom of yet. The workaround is to run the tests manually.
|
29
|
-
1) change into the directory bio-samtools installed into (you can find this with the command 'gem which bio-samtools')
|
30
|
-
2) run the tests as if they were any other ruby script eg ruby test/test_pileup.rb
|
31
|
-
|
32
|
-
== Dependencies:
|
33
|
-
-FFI (http://github.com/ffi/ffi)
|
34
|
-
|
35
|
-
|
36
|
-
== FAQ.
|
37
|
-
I´m getting a segmentation Fault, what did I do wrong?
|
38
|
-
-There are two known segmentation faults at the moment
|
39
|
-
-When you try to load a text file as binary file
|
40
|
-
-When you try to lad a binary file as a text file
|
41
|
-
|
42
|
-
I keep seeing this "Invalid gemspec in [some ruby gem path...]", what is wrong?
|
43
|
-
- This appears to be a bug in RubyGems that doesn't affect the running of the tools. It will keep happening until someone updates RubyGems. If it really bugs you, downgrade RubyGems.
|
44
|
-
|
45
|
-
|
46
|
-
To whom do I complain?
|
47
|
-
-about bio-samtools? Try
|
48
|
-
Ricardo dot Ramirez-Gonzalez at tgac dot ac dot uk
|
49
|
-
dan.maclean@tsl.ac.uk
|
50
|
-
|
51
|
-
== TODO
|
52
|
-
-Filter to the fetching algorithm (give a condition that has to be satisfied to add the alignment to the list)
|
53
|
-
|
54
|
-
|
55
|
-
== IMPORTANT NOTE
|
56
|
-
-Libraries (libbam) are downloaded, compiled and installed inside the gem at install time on the host system
|
57
|
-
|
58
|
-
$ openssl dgst libbam.so.1
|
59
|
-
MD5(libbam.so.1)= c45cfccfb41ffeb2730ee4b227d244c4
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
== Contributing to bio-samtools
|
64
|
-
|
65
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
66
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
67
|
-
* Fork the project
|
68
|
-
* Start a feature/bugfix branch
|
69
|
-
* Commit and push until you are happy with your contribution
|
70
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
71
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
72
|
-
|
73
|
-
=== Important Notes for developers
|
74
|
-
|
75
|
-
Remember that you must compile and install the right libbam library for you host system. In order to do that there are three possible solutions:
|
76
|
-
* download, compile and install the library in bioruby-samtools-your_clone/lib/bio/db/sam/external/libbam.xxxxx by yourself
|
77
|
-
* install the gem and then grab the compiled library cp `locate libbam.1.dylib` bioruby-samtools-your_clone/lib/bio/db/sam/external (library name is an example)
|
78
|
-
* in your bioruby-samtools-your_clone create the Rakefile typing "cd ext; ruby mkrf_conf.rb; rake -f Rakefile"
|
79
|
-
|
80
|
-
The latest I think is the easiest way, cause you are replicating the automatic process.
|
81
|
-
|
82
|
-
For testing just run `rake test`. Tests must be improved.
|
83
|
-
|
84
|
-
== Copyright
|
85
|
-
|
86
|
-
Copyright (c) 2011 Raoul J.P. Bonnal. See LICENSE.txt for
|
87
|
-
further details.
|
88
|
-
|