rbbt-sources 3.0.24 → 3.0.25
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a527bda568cbbed6c8b2d1d97e9898fcd6b8b63c
|
4
|
+
data.tar.gz: 38dbe0d9ea4c5668f6368181c1b64a0790f2fb34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8745c28b10e9b0312c06bbaf14ef42efa80467d3c64092a2440f426cd4139eae4151d93e9c471d66f6ecf2eeb26edd8d15c527369a14ac0908559f6c82f0a12
|
7
|
+
data.tar.gz: aecdcddd4dfd4e7474958aa6bb57ca8eaf06c346cd96e3c6515e8900224375641503976af8c60bb6949163ae53a79d6ede092512377218f0f3a028d556e02b5f
|
data/lib/rbbt/sources/biomart.rb
CHANGED
@@ -190,9 +190,18 @@ module BioMart
|
|
190
190
|
def self.tsv(database, main, attrs = nil, filters = nil, data = nil, open_options = {})
|
191
191
|
attrs ||= []
|
192
192
|
|
193
|
-
if Thread.current['archive']
|
194
|
-
missing = MISSING_IN_ARCHIVE[
|
195
|
-
missing += MISSING_IN_ARCHIVE[
|
193
|
+
if current_archive = Thread.current['archive']
|
194
|
+
missing = MISSING_IN_ARCHIVE['all'] || []
|
195
|
+
missing += MISSING_IN_ARCHIVE[current_archive] || []
|
196
|
+
MISSING_IN_ARCHIVE.each do |k,v|
|
197
|
+
if k =~ /^<(.*)/
|
198
|
+
t = $1.strip
|
199
|
+
missing+=v if Organism.compare_archives(current_archive, t) == -1
|
200
|
+
elsif k=~ /^>(.*)/
|
201
|
+
t = $1.strip
|
202
|
+
missing+=v if Organism.compare_archives(current_archive, t) == 1
|
203
|
+
end
|
204
|
+
end
|
196
205
|
attrs = attrs.uniq.reject{|attr| missing.include? attr[1]}
|
197
206
|
changes = {}
|
198
207
|
missing.select{|m| m.include? "~" }.each do |str|
|
@@ -6,6 +6,21 @@ module Organism
|
|
6
6
|
self.pkgdir = "rbbt"
|
7
7
|
self.subdir = "share/organisms"
|
8
8
|
|
9
|
+
ARCHIVE_MONTH_INDEX = {}
|
10
|
+
%w(jan feb mar apr may jun jul aug sep oct nov dec).each_with_index{|d,i| ARCHIVE_MONTH_INDEX[d] = i }
|
11
|
+
def self.compare_archives(a1, a2)
|
12
|
+
m1,y1 = a1.match(/(...)(\d+)/).values_at 1, 2
|
13
|
+
m2,y2 = a2.match(/(...)(\d+)/).values_at 1, 2
|
14
|
+
|
15
|
+
y1 = y1.to_f
|
16
|
+
y2 = y2.to_f
|
17
|
+
|
18
|
+
ycmp = y1 <=> y2
|
19
|
+
return ycmp unless ycmp == 0
|
20
|
+
|
21
|
+
ARCHIVE_MONTH_INDEX[m1] <=> ARCHIVE_MONTH_INDEX[m2]
|
22
|
+
end
|
23
|
+
|
9
24
|
def self.default_code(organism = "Hsa")
|
10
25
|
organism.split("/").first << "/feb2014"
|
11
26
|
end
|
@@ -199,7 +214,14 @@ module Organism
|
|
199
214
|
@@gene_start_end ||= {}
|
200
215
|
gene_start_end = @@gene_start_end[organism] ||= Organism.gene_positions(organism).tsv(:persist => true, :key_field => "Ensembl Gene ID", :fields => ["Gene Start", "Gene End"], :type => :list, :cast => :to_i, :unmamed => true)
|
201
216
|
|
202
|
-
ranges = genes.collect{|gene|
|
217
|
+
ranges = genes.collect{|gene|
|
218
|
+
start, eend = gene_start_end[gene]
|
219
|
+
if start.nil? or eend.nil?
|
220
|
+
Log.low "Gene #{ gene } does not have range"
|
221
|
+
next
|
222
|
+
end
|
223
|
+
(start..eend)
|
224
|
+
}.compact
|
203
225
|
Misc.total_length(ranges)
|
204
226
|
end
|
205
227
|
|
@@ -220,7 +242,10 @@ module Organism
|
|
220
242
|
exons = gene_exons.values_at(*genes).compact.flatten.uniq
|
221
243
|
|
222
244
|
exon_ranges = exons.collect{|exon|
|
223
|
-
|
245
|
+
if not exon_ranges.include? exon
|
246
|
+
Log.low "Exon #{ exon } does not have range"
|
247
|
+
next
|
248
|
+
end
|
224
249
|
pos = exon_ranges[exon]
|
225
250
|
(pos.first..pos.last)
|
226
251
|
}.compact
|
data/lib/rbbt/sources/uniprot.rb
CHANGED
@@ -117,7 +117,7 @@ module UniProt
|
|
117
117
|
eend = eend.to_i
|
118
118
|
start, eend = eend, start if start > eend
|
119
119
|
rescue
|
120
|
-
Log.warn("Error process Uniprot PDB line: #{
|
120
|
+
Log.warn("Error process Uniprot PDB line: #{l}")
|
121
121
|
next
|
122
122
|
end
|
123
123
|
pdb[id.downcase] = {:method => method, :resolution => resolution, :region => (start..eend), :chains => chains}
|
@@ -566,7 +566,7 @@ file 'transcript_sequence' => ["exons", "transcript_exons"] do |t|
|
|
566
566
|
transcript_sequence = {}
|
567
567
|
chr_transcript_ranges.each do |chr, transcript_ranges|
|
568
568
|
begin
|
569
|
-
raise "LRG, GL, HG, NT, and HSCHR chromosomes not supported: #{chr}" if chr =~
|
569
|
+
raise "LRG, GL, HG, NT, KI, and HSCHR chromosomes not supported: #{chr}" if chr =~ /(?:LRG_|GL0|HG|HSCHR|NT|KI)/
|
570
570
|
p = File.expand_path("./chromosome_#{chr}")
|
571
571
|
Organism.root.annotate p
|
572
572
|
p.sub!(%r{.*/organisms/},'share/organisms/')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-sources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbbt-util
|