bio-samtools 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -0
- data/README.md +5 -8
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bio-samtools.gemspec +5 -5
- data/lib/bio/db/fastadb.rb +4 -4
- data/lib/bio/db/sam.rb +21 -21
- data/tutorial/tutorial.md +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c7c1107bfac77e9b61fd5e5c42858b1f9a47343
|
4
|
+
data.tar.gz: be0b06c0820422ccd2b3247a44a49dfef42d6168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a9636f6d2434202934d920aa2ac32538791d07c16fc5d8d50577ee7912efc334774868f6bf0f01de340a3a2c6257c774cd5f5fe7a188222c9970a0ca9d6f073
|
7
|
+
data.tar.gz: cea72a5135c6c0a65b5cee2ba5017d76da7e165131add923a23a79125525a0ec419d48bc345a69619386e0c19e99cdc31ce1228a0b866728fb9718cea290a04e
|
data/.travis.yml
CHANGED
@@ -6,13 +6,22 @@ addons:
|
|
6
6
|
- zlib1g-dev
|
7
7
|
- libncurses5-dev
|
8
8
|
- libtinfo-dev
|
9
|
+
before_install:
|
10
|
+
- gem update --system
|
11
|
+
- if [ $TRAVIS_OS_NAME = osx ]; then brew update; brew install xz ; fi
|
9
12
|
before_script:
|
10
13
|
- cd ext
|
11
14
|
- ruby mkrf_conf.rb
|
12
15
|
- rake -f Rakefile
|
13
16
|
- cd ../
|
17
|
+
os:
|
18
|
+
- linux
|
19
|
+
- osx
|
14
20
|
rvm:
|
15
21
|
- 2.1.10
|
16
22
|
- 2.2.5
|
17
23
|
- 2.3.5
|
18
24
|
- 2.4.2
|
25
|
+
- 2.5.0
|
26
|
+
|
27
|
+
|
data/README.md
CHANGED
@@ -438,17 +438,14 @@ Each test file tests different aspects of the code.
|
|
438
438
|
|
439
439
|
## Dependencies
|
440
440
|
|
441
|
-
* BioRuby >= 1.
|
442
|
-
* Ruby 1.
|
441
|
+
* BioRuby >= 1.5 [https://github.com/bioruby/bioruby](https://github.com/bioruby/bioruby)
|
442
|
+
* Ruby 2.1.10 and above.
|
443
|
+
|
443
444
|
|
444
445
|
## FAQ
|
445
|
-
* I
|
446
|
-
|
447
|
-
[Answer] You are using an old version of bio-samtools, the current version doesn't link directly to the library.
|
446
|
+
* I want to use Ruby 1.x, what can I do?
|
448
447
|
|
449
|
-
|
450
|
-
|
451
|
-
[Answer] 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.
|
448
|
+
We try to ensure backwards compatibility with old rubies. However we only officially support current versions of [https://www.ruby-lang.org/en/downloads/](Ruby). The code should work however the testing suites used in earlier versions are not currently supported and don't work in modern rubies. This decision ensures compatibility with maintained versions of Ruby.
|
452
449
|
|
453
450
|
|
454
451
|
## Contributing to bio-samtools
|
data/Rakefile
CHANGED
@@ -27,7 +27,7 @@ end
|
|
27
27
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
28
28
|
gem.name = "bio-samtools"
|
29
29
|
gem.homepage = "http://github.com/helios/bioruby-samtools"
|
30
|
-
gem.license = "
|
30
|
+
gem.license = "GPL-3.0"
|
31
31
|
gem.summary = %Q{Binder of samtools for ruby, on the top of FFI.}
|
32
32
|
gem.description = %Q{Binder of samtools for ruby, on the top of FFI.
|
33
33
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.2
|
data/bio-samtools.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bio-samtools 2.6.
|
5
|
+
# stub: bio-samtools 2.6.2 ruby lib
|
6
6
|
# stub: ext/mkrf_conf.rb
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "bio-samtools".freeze
|
10
|
-
s.version = "2.6.
|
10
|
+
s.version = "2.6.2"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib".freeze]
|
14
14
|
s.authors = ["Ricardo Ramirez-Gonzalez".freeze, "Dan MacLean".freeze, "Raoul J.P. Bonnal".freeze]
|
15
|
-
s.date = "
|
15
|
+
s.date = "2018-01-11"
|
16
16
|
s.description = "Binder of samtools for ruby, on the top of FFI. \n\n This project was born from the need to add support of BAM files to \n the gee_fu genome browser (http://github.com/danmaclean/gee_fu).".freeze
|
17
17
|
s.email = "Ricardo.Ramirez-Gonzalez@tgac.ac.uk".freeze
|
18
18
|
s.executables = ["bam_consensus.rb".freeze]
|
@@ -147,8 +147,8 @@ Gem::Specification.new do |s|
|
|
147
147
|
"tutorial/tutorial.pdf"
|
148
148
|
]
|
149
149
|
s.homepage = "http://github.com/helios/bioruby-samtools".freeze
|
150
|
-
s.licenses = ["
|
151
|
-
s.rubygems_version = "2.6.
|
150
|
+
s.licenses = ["GPL-3.0".freeze]
|
151
|
+
s.rubygems_version = "2.6.14".freeze
|
152
152
|
s.summary = "Binder of samtools for ruby, on the top of FFI.".freeze
|
153
153
|
|
154
154
|
if s.respond_to? :specification_version then
|
data/lib/bio/db/fastadb.rb
CHANGED
@@ -13,7 +13,7 @@ module Bio::DB::Fasta
|
|
13
13
|
|
14
14
|
#This doesnt validate if you are adding the same entry twice. I may add
|
15
15
|
#a validation for that.
|
16
|
-
def <<
|
16
|
+
def <<(entry)
|
17
17
|
@entries << entry
|
18
18
|
@entries_map[entry.id] = entry
|
19
19
|
end
|
@@ -252,7 +252,7 @@ module Bio::DB::Fasta
|
|
252
252
|
query = region.to_s
|
253
253
|
query = region.to_region.to_s if region.respond_to?(:to_region)
|
254
254
|
command = "#{@samtools} faidx #{@fasta_path} '#{query}'"
|
255
|
-
puts "Running: #{command}" if $
|
255
|
+
puts "Running: #{command}" if $DEBUG
|
256
256
|
@last_command = command
|
257
257
|
seq = ""
|
258
258
|
yield_from_pipe(command, String, :text ) {|line| seq = seq + line unless line =~ /^>/}
|
@@ -294,7 +294,7 @@ module Bio::DB::Fasta
|
|
294
294
|
end
|
295
295
|
|
296
296
|
private
|
297
|
-
#Returns Process::Status with the execution status. If run in a $
|
297
|
+
#Returns Process::Status with the execution status. If run in a $DEBUG environment, stderr of the process
|
298
298
|
#is forwarded to the default stdout
|
299
299
|
def yield_from_pipe(command, klass, type=:text, skip_comments=true, comment_char="#", &block)
|
300
300
|
stdin, pipe, stderr, wait_thr = Open3.popen3(command)
|
@@ -310,7 +310,7 @@ module Bio::DB::Fasta
|
|
310
310
|
end
|
311
311
|
end
|
312
312
|
exit_status = wait_thr.value # Process::Status object returned.
|
313
|
-
puts stderr.read if $
|
313
|
+
puts stderr.read if $DEBUG
|
314
314
|
stdin.close
|
315
315
|
pipe.close
|
316
316
|
stderr.close
|
data/lib/bio/db/sam.rb
CHANGED
@@ -276,7 +276,7 @@ module Bio
|
|
276
276
|
end
|
277
277
|
|
278
278
|
command = form_opt_string(@samtools, "mpileup", opts, [:R, :B, :E, "6", :A, :g, :u, :I] )
|
279
|
-
puts "Running: #{command}" if $
|
279
|
+
puts "Running: #{command}" if $DEBUG
|
280
280
|
if opts[:u]
|
281
281
|
command = command + " | #{@bcftools} view -cg -"
|
282
282
|
end
|
@@ -299,7 +299,7 @@ module Bio
|
|
299
299
|
seq = "n" * (stop-start)
|
300
300
|
else
|
301
301
|
command = "#{@samtools} faidx \"#{@fasta}\" '#{chr}:#{start}-#{stop}'"
|
302
|
-
puts "Running: #{command}" if $
|
302
|
+
puts "Running: #{command}" if $DEBUG
|
303
303
|
@last_command = command
|
304
304
|
seq = ""
|
305
305
|
yield_from_pipe(command, String, :text ) {|line| seq = seq + line unless line =~ /^>/}
|
@@ -331,7 +331,7 @@ module Bio
|
|
331
331
|
#* out_index - [STRING] name of index
|
332
332
|
def index(opts={})
|
333
333
|
command = "#{@samtools} index \"#{@bam}\" #{opts[:out_index]}"
|
334
|
-
puts "Running: #{command}" if $
|
334
|
+
puts "Running: #{command}" if $DEBUG
|
335
335
|
@last_command = command
|
336
336
|
system(command)
|
337
337
|
end
|
@@ -346,7 +346,7 @@ module Bio
|
|
346
346
|
remove_reads = "-r"
|
347
347
|
end
|
348
348
|
command = "#{@samtools} fixmate #{remove_reads} \"#{@bam}\" #{opts[:out_bam]}"
|
349
|
-
puts "Running: #{command}" if $
|
349
|
+
puts "Running: #{command}" if $DEBUG
|
350
350
|
@last_command = command
|
351
351
|
system(command)
|
352
352
|
end
|
@@ -356,7 +356,7 @@ module Bio
|
|
356
356
|
#generate simple stats with regard to the number and pairing of reads mapped to a reference
|
357
357
|
def flag_stats(opts={})
|
358
358
|
command = form_opt_string(@samtools, "flagstat", opts, [])
|
359
|
-
puts "Running: #{command}" if $
|
359
|
+
puts "Running: #{command}" if $DEBUG
|
360
360
|
@last_command = command
|
361
361
|
strings = []
|
362
362
|
yield_from_pipe(command,String) {|line| strings << line.chomp}
|
@@ -371,7 +371,7 @@ module Bio
|
|
371
371
|
stats = {}
|
372
372
|
command = form_opt_string(@samtools, "idxstats", {}, [])
|
373
373
|
@last_command = command
|
374
|
-
puts "Running: #{command}" if $
|
374
|
+
#puts "Running: #{command}" if $DEBUG
|
375
375
|
yield_from_pipe(command, String, :text, true, "#") do |line|
|
376
376
|
info = line.chomp.split(/\t/)
|
377
377
|
stats[ info[0] ] = {:length => info[1].to_i, :mapped_reads => info[2].to_i, :unmapped_reads => info[3].to_i }
|
@@ -452,7 +452,7 @@ module Bio
|
|
452
452
|
command = "#{@samtools} merge #{options} #{out} #{bam_list}"
|
453
453
|
|
454
454
|
@last_command = command
|
455
|
-
puts "Running: #{command}" if $
|
455
|
+
puts "Running: #{command}" if $DEBUG
|
456
456
|
system(command)
|
457
457
|
|
458
458
|
end
|
@@ -468,7 +468,7 @@ module Bio
|
|
468
468
|
opts.delete(:bams)
|
469
469
|
options = commandify(opts, [:h] )
|
470
470
|
command = "#{@samtools} cat #{options} -o #{out} #{bam_list}"
|
471
|
-
puts command if $
|
471
|
+
puts command if $DEBUG
|
472
472
|
@last_command = command
|
473
473
|
system(command)
|
474
474
|
|
@@ -515,7 +515,7 @@ module Bio
|
|
515
515
|
command = form_opt_string(@samtools, "sort", opts, [:n, :f])
|
516
516
|
command = command + " "
|
517
517
|
@last_command = command
|
518
|
-
puts "Running: #{command}" if $
|
518
|
+
puts "Running: #{command}" if $DEBUG
|
519
519
|
#if opts[:o]
|
520
520
|
# yield_from_pipe(command, Bio::DB::Alignment)
|
521
521
|
#else
|
@@ -541,7 +541,7 @@ module Bio
|
|
541
541
|
opts.delete(:s)
|
542
542
|
end
|
543
543
|
command = "#{form_opt_string(@samtools, "tview", opts)}"
|
544
|
-
puts "Running: #{command}" if $
|
544
|
+
puts "Running: #{command}" if $DEBUG
|
545
545
|
@last_command = command
|
546
546
|
system(command)
|
547
547
|
end
|
@@ -556,7 +556,7 @@ module Bio
|
|
556
556
|
else
|
557
557
|
command = "#{@samtools} reheader #{header_sam} \"#{@bam}\""
|
558
558
|
end
|
559
|
-
puts "Running: #{command}" if $
|
559
|
+
puts "Running: #{command}" if $DEBUG
|
560
560
|
@last_command = command
|
561
561
|
system(command)
|
562
562
|
end
|
@@ -572,7 +572,7 @@ module Bio
|
|
572
572
|
#* E - Extended BAQ calculation. This option trades specificity for sensitivity, though the effect is minor.
|
573
573
|
def calmd(opts={}, &block)
|
574
574
|
command = form_opt_string(@samtools, "calmd", opts, [:E, :e, :u, :b, :S, :r] )+ " " + @fasta
|
575
|
-
puts "Running: #{command}" if $
|
575
|
+
puts "Running: #{command}" if $DEBUG
|
576
576
|
@last_command = command
|
577
577
|
type = :text
|
578
578
|
klass = Bio::DB::Alignment
|
@@ -593,7 +593,7 @@ module Bio
|
|
593
593
|
end
|
594
594
|
|
595
595
|
command = "#{form_opt_string(@samtools, "targetcut", opts, [] )}"
|
596
|
-
puts "Running: #{command}" if $
|
596
|
+
puts "Running: #{command}" if $DEBUG
|
597
597
|
@last_command = command
|
598
598
|
system(command)
|
599
599
|
end
|
@@ -607,7 +607,7 @@ module Bio
|
|
607
607
|
#* Q - [INT] Minimum base quality to be used in het calling. [13]
|
608
608
|
def phase(opts={})
|
609
609
|
command = "#{form_opt_string(@samtools, "phase", opts, [:A, :F] )}"
|
610
|
-
puts "Running: #{command}" if $
|
610
|
+
puts "Running: #{command}" if $DEBUG
|
611
611
|
@last_command = command
|
612
612
|
system(command)
|
613
613
|
end
|
@@ -651,7 +651,7 @@ module Bio
|
|
651
651
|
#We asume that the options (other than the region) are constant. If they are not, the cache mechanism may not be consistent.
|
652
652
|
#
|
653
653
|
#TODO: It may be good to load partially the pileup
|
654
|
-
def mpileup_cached
|
654
|
+
def mpileup_cached(opts={})
|
655
655
|
raise SamException.new(), "A region must be provided" unless opts[:r] or opts[:region]
|
656
656
|
@cached_regions = Hash.new unless @cached_regions
|
657
657
|
region = opts[:r] ? opts[:r] : opts[:region]
|
@@ -667,7 +667,7 @@ module Bio
|
|
667
667
|
|
668
668
|
#Clears the pileup cache. If a region is passed as argument, just the specified region is removed
|
669
669
|
#If no region is passed, the hash is emptied
|
670
|
-
def mpileup_clear_cache
|
670
|
+
def mpileup_clear_cache(region)
|
671
671
|
return unless @cached_regions
|
672
672
|
if region
|
673
673
|
@cached_regions[region.to_s] = nil
|
@@ -685,7 +685,7 @@ module Bio
|
|
685
685
|
else
|
686
686
|
command = "#{@samtools} bedcov \"#{bed}\" \"#{@bam}\""
|
687
687
|
end
|
688
|
-
puts "Running: #{command}" if $
|
688
|
+
puts "Running: #{command}" if $DEBUG
|
689
689
|
#puts command
|
690
690
|
@last_command = command
|
691
691
|
system(command)
|
@@ -724,14 +724,14 @@ module Bio
|
|
724
724
|
|
725
725
|
#Returns true if the .bai exists. It doesn't validate if it is valid.
|
726
726
|
def indexed?
|
727
|
-
File.
|
727
|
+
File.exist? @bam and File.exist? "#{@bam}.bai"
|
728
728
|
end
|
729
729
|
|
730
730
|
private
|
731
|
-
#Returns Process::Status with the execution status. If run in a $
|
731
|
+
#Returns Process::Status with the execution status. If run in a $DEBUG environment, stderr of the process
|
732
732
|
#is forwarded to the default stdout
|
733
733
|
def yield_from_pipe(command, klass, type=:text, skip_comments=true, comment_char="#", &block)
|
734
|
-
puts "[yield_from_pipe] #{command}" if $
|
734
|
+
puts "[yield_from_pipe] #{command}" if $DEBUG
|
735
735
|
stdin, pipe, stderr, wait_thr = Open3.popen3(command)
|
736
736
|
#pid = wait_thr[:pid] # pid of the started process.
|
737
737
|
if type == :text
|
@@ -745,7 +745,7 @@ module Bio
|
|
745
745
|
end
|
746
746
|
end
|
747
747
|
exit_status = wait_thr.value # Process::Status object returned.
|
748
|
-
puts "Running: #{command}" if $
|
748
|
+
puts "Running: #{command}" if $DEBUG
|
749
749
|
stdin.close
|
750
750
|
pipe.close
|
751
751
|
stderr.close
|
data/tutorial/tutorial.md
CHANGED
@@ -18,7 +18,7 @@ connection.
|
|
18
18
|
|
19
19
|
bio-samtools relies on the following other rubygems:
|
20
20
|
|
21
|
-
- [bio \>= 1.
|
21
|
+
- [bio \>= 1.5](http://rubygems.org/gems/bio)
|
22
22
|
- [bio-svgenes >= 0.4.1](https://rubygems.org/gems/bio-svgenes)
|
23
23
|
|
24
24
|
Once these are installed, bio-samtools can be installed with
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-samtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Ramirez-Gonzalez
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-01-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bio-svgenes
|
@@ -233,7 +233,7 @@ files:
|
|
233
233
|
- tutorial/tutorial.pdf
|
234
234
|
homepage: http://github.com/helios/bioruby-samtools
|
235
235
|
licenses:
|
236
|
-
-
|
236
|
+
- GPL-3.0
|
237
237
|
metadata: {}
|
238
238
|
post_install_message:
|
239
239
|
rdoc_options: []
|
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
253
|
rubyforge_project:
|
254
|
-
rubygems_version: 2.6.
|
254
|
+
rubygems_version: 2.6.14
|
255
255
|
signing_key:
|
256
256
|
specification_version: 4
|
257
257
|
summary: Binder of samtools for ruby, on the top of FFI.
|