rbbt-sources 3.0.24 → 3.0.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 907dd95d8535034e80e84c5df8194531bd86d1e3
4
- data.tar.gz: 4a67f08de4f4b83da9967d009fd32f29d1f17958
3
+ metadata.gz: a527bda568cbbed6c8b2d1d97e9898fcd6b8b63c
4
+ data.tar.gz: 38dbe0d9ea4c5668f6368181c1b64a0790f2fb34
5
5
  SHA512:
6
- metadata.gz: ca004897b4c92532dc14f4e2bafce4b90919c54598b27d428208b4d5115f4333cafc471596852e0de5cabb6d5ce226f34dbc61d779d38a5d06410a9dc9f346a9
7
- data.tar.gz: 253068f65d0e9cd3733be2d2cac1865321d6ef6cd5272bf71a7ff5b11a4b740a91ed365ab11ceaf50d165489907b1d71aeecd8c06184b49241a828e635e975d0
6
+ metadata.gz: c8745c28b10e9b0312c06bbaf14ef42efa80467d3c64092a2440f426cd4139eae4151d93e9c471d66f6ecf2eeb26edd8d15c527369a14ac0908559f6c82f0a12
7
+ data.tar.gz: aecdcddd4dfd4e7474958aa6bb57ca8eaf06c346cd96e3c6515e8900224375641503976af8c60bb6949163ae53a79d6ede092512377218f0f3a028d556e02b5f
@@ -1,5 +1,6 @@
1
1
  all:
2
2
  - refseq_mrna
3
+ <aug2014:
3
4
  - external_gene_name~external_gene_id
4
5
  may2010:
5
6
  - agilent_wholegenome
@@ -33,5 +34,3 @@ aug2007:
33
34
  - hgnc
34
35
  - hgnc_id
35
36
  - illumina_humanwg_6_v3
36
- dec2014:
37
- - external_gene_id
@@ -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[Thread.current['archive']] || []
195
- missing += MISSING_IN_ARCHIVE['all'] || []
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| start, eend = gene_start_end[gene]; (start..eend) }
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
- Log.low "Exon #{ exon } does not have range" and next if not exon_ranges.include? exon
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
@@ -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: #{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 =~ /^(?:LRG_|GL0|HG|HSCHR|NT)/
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.24
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-13 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util