rbbt-sources 3.0.19 → 3.0.20

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: 09103120ab258ebec5b5229f3af3b8f81b08a09d
4
- data.tar.gz: 859133185352820244010f79dcbff16fb74c8472
3
+ metadata.gz: d10e3a8a64d8a1c63059a3d798f4043381a7a729
4
+ data.tar.gz: 36b6a7794b2c29ff6fc7b29e3d3e6c23370f93e3
5
5
  SHA512:
6
- metadata.gz: 973ad5daac0276bf77ca2d8379415ffb8933dbee131a40795c07316b4f78af6e1776a24c4036b52248f435864264a339d7f3205516094f2d332e5e8a2032f59e
7
- data.tar.gz: 2ff6ccd29f102f4c256a4aa84e151210e6fb51586dc97e1f19ed08b9ab7b0e9afcbc61ed39543b9d0a1be68edcce2627ab92ebc4afc1537f124a6cd4f7306499
6
+ metadata.gz: 5c64b9b8f739a3c1ee5c48ac1d2cb8a17307d2d1831f135133c34406eff1487a973af8c90ee5de504c45481002ec1fa403ee83ac80f1a89c49d6afbe9dbcc0ca
7
+ data.tar.gz: 30e958a1aafabb3e4329341b8b0d268cc2b68799ca9049a7d56779e424fe40f0f85c670811ac6c58e398575a5ea6c08140d2d6079f5324561f06a802de27ea8e
@@ -56,7 +56,7 @@ module BioMart
56
56
  end
57
57
 
58
58
  def self.get(database, main, attrs = nil, filters = nil, data = nil, open_options = {})
59
- open_options = Misc.add_defaults :wget_options => {"--read-timeout=" => 9000, "--tries=" => 1}
59
+ open_options = Misc.add_defaults open_options, :wget_options => {"--read-timeout=" => 9000, "--tries=" => 1}
60
60
  repeats = true
61
61
  attrs ||= []
62
62
  filters ||= ["with_#{main}"]
@@ -82,6 +82,7 @@ module BioMart
82
82
  url = Thread.current['archive_url'] ? Thread.current['archive_url'] + query.gsub(/\n/,' ') : BIOMART_URL + query.gsub(/\n/,' ')
83
83
 
84
84
  begin
85
+ iii open_options
85
86
  response = Open.read(url, open_options.dup)
86
87
  rescue
87
88
  Open.remove_from_cache url, open_options
@@ -137,7 +138,6 @@ module BioMart
137
138
  open_options = Misc.add_defaults open_options, :nocache => false, :filename => nil, :field_names => nil, :by_chr => false
138
139
  filename, field_names, by_chr = Misc.process_options open_options, :filename, :field_names, :by_chr
139
140
  attrs ||= []
140
-
141
141
  open_options = Misc.add_defaults open_options, :keep_empty => false, :merge => true
142
142
 
143
143
  Log.low "BioMart query: '#{main}' [#{(attrs || []) * ', '}] [#{(filters || []) * ', '}] #{open_options.inspect}"
@@ -161,10 +161,10 @@ module BioMart
161
161
  if chunks.any?
162
162
  chunks.each_with_index{|chunk,i|
163
163
  Log.low "Chunk #{ i + 1 } / #{chunks.length}: [#{chunk * ", "}]"
164
- data = get(database, main, chunk, filters, data, open_options)
164
+ data = get(database, main, chunk, filters, data, open_options.dup)
165
165
  }
166
166
  else
167
- data = get(database, main, [], filters, data, open_options)
167
+ data = get(database, main, [], filters, data, open_options.dup)
168
168
  end
169
169
 
170
170
  open_options[:filename] = "BioMart[#{main}+#{attrs.length}]"
@@ -228,3 +228,4 @@ module Organism
228
228
  Misc.total_length(exon_ranges)
229
229
  end
230
230
  end
231
+
@@ -76,6 +76,7 @@ if defined? Entity
76
76
 
77
77
 
78
78
  module InterProDomain
79
+ extend Entity
79
80
  property :pfam => :array2single do
80
81
  InterPro.pfam_index.values_at(*self).
81
82
  each{|domain| domain.organism = organism if domain.respond_to? :organism }
@@ -6,6 +6,8 @@ module NCI
6
6
  doc = Nokogiri::XML(xml)
7
7
  pathways = {}
8
8
 
9
+ #{{{ Molecules
10
+
9
11
  molecules = {}
10
12
  doc.xpath("//Molecule").each do |molecule|
11
13
  id = molecule.attribute('id').value
@@ -15,6 +17,8 @@ module NCI
15
17
  end
16
18
 
17
19
 
20
+ #{{{ Interactions
21
+
18
22
  interactions = {}
19
23
  doc.xpath("//Interaction").each do |interaction|
20
24
  id = interaction.attribute('id').value
@@ -25,6 +29,8 @@ module NCI
25
29
  interactions[id] = {:xml => interaction, :molecule_ids => molecule_ids, :pathway_ids => pathway_ids}
26
30
  end
27
31
 
32
+ #{{{ Pathways
33
+
28
34
  doc.xpath("//Pathway").each do |pathway|
29
35
  id = pathway.attribute('id').value
30
36
  subnet = pathway.attribute('subnet').value
@@ -32,8 +38,8 @@ module NCI
32
38
  short_name = pathway.xpath('ShortName').first.content if get_short_name
33
39
 
34
40
  interaction_ids = pathway.xpath("PathwayComponentList/PathwayComponent").collect{|component| component.attribute("interaction_idref").value}
35
-
36
41
  pathway_interactions = interaction_ids.collect{|i| interactions[i]}
42
+
37
43
  pathway_molecule_ids = pathway_interactions.collect{|info| info[:molecule_ids]}.compact.flatten
38
44
 
39
45
  pathway_uniprot_ids = pathway_molecule_ids.collect do |i|
@@ -47,20 +53,22 @@ module NCI
47
53
  end
48
54
  end
49
55
 
56
+ #{{{ Sub-pathways ???
57
+
50
58
  doc.xpath("//Pathway").each do |pathway|
51
59
  id = pathway.attribute('id').value
52
60
  subnet = pathway.attribute('subnet').value
53
61
  name = pathway.xpath('LongName').first.content
54
62
 
55
63
  interaction_ids = pathway.xpath("PathwayComponentList/PathwayComponent").collect{|component| component.attribute("interaction_idref").value}
56
-
57
64
  pathway_interactions = interaction_ids.collect{|i| interactions[i]}
65
+
58
66
  pathway_subnet_ids = pathway_interactions.collect{|info| info[:pathway_ids]}.compact.flatten
59
67
 
60
68
  pathway_subnet_ids.collect do |nid|
61
69
  next unless pathways.include? nid
62
- new_genes = pathways[id].last
63
- pathways[nid][1] = (pathways[nid][1] + new_genes).uniq
70
+ new_genes = pathways[nid].last
71
+ pathways[id][1] = (pathways[id][1] + new_genes).uniq
64
72
  end
65
73
  end
66
74
 
@@ -353,6 +353,7 @@ file 'exon_offsets' => %w(exons transcript_exons gene_transcripts transcripts tr
353
353
  end
354
354
 
355
355
  file 'gene_go' do |t|
356
+ iii 1
356
357
  if File.basename(FileUtils.pwd) =~ /^[a-z]{3}([0-9]{4})$/i and $1.to_i <= 2009
357
358
  goterms = BioMart.tsv($biomart_db, $biomart_ensembl_gene, $biomart_go_2009, [], nil, :type => :double, :namespace => Thread.current['namespace'])
358
359
 
@@ -70,5 +70,3 @@ class TestBioMart < Test::Unit::TestCase
70
70
  end
71
71
  end
72
72
  end
73
-
74
-
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.19
4
+ version: 3.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-17 00:00:00.000000000 Z
11
+ date: 2015-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util