bio-samtools 2.0.3 → 2.0.4
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/VERSION +1 -1
- data/bio-samtools.gemspec +3 -3
- data/lib/bio-samtools.rb +1 -1
- data/lib/bio/db/alignment.rb +2 -1
- data/lib/bio/db/fastadb.rb +1 -1
- data/lib/bio/db/sam.rb +20 -0
- 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: f871729e2c0ab8ac18082913e4d6897620e87c32
|
4
|
+
data.tar.gz: 8080e5cb42c5fe72a75ca6d884c5751a25225d26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a03afb21028e6fdd1b0f1ef3693d4cf6695be8f490c06a93e2dea3983a9c110fa6a3f128cfdf7d2aff29ababbf0ad0e57f4469d9a9cc67aee218582bc2aa6f4
|
7
|
+
data.tar.gz: dd42a06d8c8d3ac22de82ece17ee25a7c663475b5fb3283a35f190953f67eafb2ae2ba1390f1de6cfc042b7b05b30675d26a2953985363184a48dc24faf11027
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.4
|
data/bio-samtools.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bio-samtools 2.0.
|
5
|
+
# stub: bio-samtools 2.0.4 ruby lib
|
6
6
|
# stub: ext/mkrf_conf.rb
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "bio-samtools"
|
10
|
-
s.version = "2.0.
|
10
|
+
s.version = "2.0.4"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
s.authors = ["Ricardo Ramirez-Gonzalez", "Dan MacLean", "Raoul J.P. Bonnal"]
|
15
|
-
s.date = "2014-04-
|
15
|
+
s.date = "2014-04-28"
|
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)."
|
17
17
|
s.email = "ilpuccio.febo@gmail.com"
|
18
18
|
s.extensions = ["ext/mkrf_conf.rb"]
|
data/lib/bio-samtools.rb
CHANGED
data/lib/bio/db/alignment.rb
CHANGED
@@ -18,11 +18,12 @@ module Bio
|
|
18
18
|
class Alignment
|
19
19
|
attr_accessor :qname, :flag, :rname,:pos,:mapq,:cigar, :mrnm, :mpos, :isize, :seq, :qual, :tags, :al, :samstr, :calend, :qlen
|
20
20
|
|
21
|
-
attr_accessor :is_paired, :is_mapped, :query_unmapped, :mate_unmapped, :query_strand, :mate_strand, :first_in_pair,:second_in_pair, :primary, :failed_quality, :is_duplicate
|
21
|
+
attr_accessor :sam_string, :is_paired, :is_mapped, :query_unmapped, :mate_unmapped, :query_strand, :mate_strand, :first_in_pair,:second_in_pair, :primary, :failed_quality, :is_duplicate
|
22
22
|
|
23
23
|
#parses the SAM string into its constituents and set its attributes
|
24
24
|
def initialize(sam_string)
|
25
25
|
s = sam_string.chomp.split("\t")
|
26
|
+
@sam_string = sam_string
|
26
27
|
@qname = s[0]
|
27
28
|
@flag = s[1].to_i
|
28
29
|
@rname = s[2]
|
data/lib/bio/db/fastadb.rb
CHANGED
@@ -214,7 +214,7 @@ module Bio::DB::Fasta
|
|
214
214
|
query = region.to_s
|
215
215
|
query = region.to_region.to_s if region.respond_to?(:to_region)
|
216
216
|
command = "#{@samtools} faidx #{@fasta_path} '#{query}'"
|
217
|
-
puts command
|
217
|
+
puts command if $VERBOSE
|
218
218
|
@last_command = command
|
219
219
|
seq = ""
|
220
220
|
yield_from_pipe(command, String, :text ) {|line| seq = seq + line unless line =~ /^>/}
|
data/lib/bio/db/sam.rb
CHANGED
@@ -356,6 +356,26 @@ module Bio
|
|
356
356
|
end
|
357
357
|
|
358
358
|
alias_method :idxstats, :index_stats
|
359
|
+
|
360
|
+
#Retrive a hash with all the regions, with the region id as index or runs the function on each region
|
361
|
+
def each_region
|
362
|
+
stats=index_stats unless @stats
|
363
|
+
if @regions
|
364
|
+
return @regionss unless block_given?
|
365
|
+
else
|
366
|
+
@regions = Hash.new
|
367
|
+
end
|
368
|
+
stats.each do |k,v|
|
369
|
+
reg = Bio::DB::Fasta::Region
|
370
|
+
reg.entry = k
|
371
|
+
reg.start = 1
|
372
|
+
reg.end = v[:length]
|
373
|
+
reg.orientation = :forward
|
374
|
+
|
375
|
+
yield reg if block_given?
|
376
|
+
end
|
377
|
+
@regions
|
378
|
+
end
|
359
379
|
|
360
380
|
#Merge multiple sorted alignments
|
361
381
|
#* n - sort by read names
|
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.0.
|
4
|
+
version: 2.0.4
|
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: 2014-04-
|
13
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bio-svgenes
|