rbbt-sources 3.1.14 → 3.1.15
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/etc/allowed_biomart_archives +1 -0
- data/lib/rbbt/sources/pubmed.rb +3 -2
- data/lib/rbbt/sources/tfacts.rb +75 -0
- metadata +11 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 968b6c9ab9794fa92209ba2c8f36537bfc942711
|
|
4
|
+
data.tar.gz: 6a5501945048ef2a52872d54e35a85d8637b25a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ded417d4f6a04e6ff5ba21da1e454d54a0cf73aab95783a1a60ada25ea39faad2f8d4edcae462ae44f03de0ff488ea99737dc235d4472493d309342debe3391
|
|
7
|
+
data.tar.gz: 91b3fbe0852496b15cae6b512f150e5cf86c1742d57d41104b2247df3e75661dc5dce5aa4bae6e3eb86a3bd427addb842f97617a32a6f977a31fc0385daded3a
|
data/lib/rbbt/sources/pubmed.rb
CHANGED
|
@@ -227,14 +227,15 @@ module PubMed
|
|
|
227
227
|
result_files = FileCache.cache_online_elements(pmids, 'pubmed-{ID}.xml') do |ids|
|
|
228
228
|
result = {}
|
|
229
229
|
values = []
|
|
230
|
-
Misc.divide(ids, (ids.length /
|
|
230
|
+
Misc.divide(ids, (ids.length / 20) + 1).each do |list|
|
|
231
231
|
begin
|
|
232
232
|
Misc.try3times do
|
|
233
233
|
url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi"
|
|
234
234
|
|
|
235
235
|
postdata = "db=pubmed&retmode=xml&id=#{list* ","}"
|
|
236
236
|
xml = TmpFile.with_file(postdata) do |postfile|
|
|
237
|
-
Open.read(url, :quiet => true, :nocache => true, :nice => @@pubmed_lag, :nice_key => "PubMed", "--post-file=" => postfile)
|
|
237
|
+
#Open.read(url, :quiet => true, :nocache => true, :nice => @@pubmed_lag, :nice_key => "PubMed", "--post-file=" => postfile)
|
|
238
|
+
Open.read(url+'?'+postdata, :quiet => true, :nocache => true, :nice => @@pubmed_lag, :nice_key => "PubMed", "--__post-file=" => postfile)
|
|
238
239
|
end
|
|
239
240
|
|
|
240
241
|
values += xml.scan(/(<PubmedArticle>.*?<\/PubmedArticle>)/smu).flatten
|
data/lib/rbbt/sources/tfacts.rb
CHANGED
|
@@ -47,6 +47,81 @@ module TFacts
|
|
|
47
47
|
TFacts.targets.tsv.reorder("Transcription Factor (Associated Gene Name)").to_s
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
TFacts.claim TFacts.tf_tg, :proc do
|
|
51
|
+
require 'spreadsheet'
|
|
52
|
+
book = Spreadsheet.open TFacts[".source"]["Catalogues.xls"].produce.find
|
|
53
|
+
|
|
54
|
+
tsv = TSV.setup({}, :key_field => "Transcription Factor (Associated Gene Name)", :fields => ["Target Gene (Associated Gene Name)", "Sign", "Species", "Source", "PMID"], :namespace => "Hsa", :type => :double)
|
|
55
|
+
|
|
56
|
+
sheet = book.worksheet 1
|
|
57
|
+
sheet.each do |row|
|
|
58
|
+
target, tf, sign, source, species, pmids = row.values_at(0, 1, 2, 3, 4, 5).collect{|v| v.to_s.gsub(/\s/, ' ') }
|
|
59
|
+
pmids = "" if pmids.nil? or pmids == "0"
|
|
60
|
+
next if tf =~ /OFFICIAL_/
|
|
61
|
+
|
|
62
|
+
species = species.split(";").compact.reject{|s| s.empty?}.collect{|s|
|
|
63
|
+
case s
|
|
64
|
+
when /Homo sap/i
|
|
65
|
+
"Homo sapiens"
|
|
66
|
+
when /muscul/i
|
|
67
|
+
"Mus musculus"
|
|
68
|
+
else
|
|
69
|
+
s
|
|
70
|
+
end
|
|
71
|
+
}*";"
|
|
72
|
+
source = source.split(";").compact.reject{|s| s.empty?}*";"
|
|
73
|
+
pmids = pmids.split(";").compact.reject{|s| s.empty?}.collect{|s| s.sub(/\s*pmid:\s*/,'').strip}*";"
|
|
74
|
+
|
|
75
|
+
values = [target, sign, species, source, pmids]
|
|
76
|
+
values = values.collect{|v| [v]}
|
|
77
|
+
tsv.zip_new(tf, values)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
sheet = book.worksheet 0
|
|
81
|
+
sheet.each do |row|
|
|
82
|
+
target, tf, source, species, pmids = row.values_at(0, 1, 2, 3, 4, 5).collect{|v| v.to_s.gsub(/\s/, ' ') }
|
|
83
|
+
next if tf =~ /OFFICIAL_/
|
|
84
|
+
|
|
85
|
+
species = species.split(";").compact.reject{|s| s.empty?}.collect{|s|
|
|
86
|
+
case s
|
|
87
|
+
when /Homo sap/i
|
|
88
|
+
"Homo sapiens"
|
|
89
|
+
when /muscul/i
|
|
90
|
+
"Mus musculus"
|
|
91
|
+
else
|
|
92
|
+
s
|
|
93
|
+
end
|
|
94
|
+
}*";"
|
|
95
|
+
source = source.split(";").compact.reject{|s| s.empty?}*";"
|
|
96
|
+
pmids = "" if pmids.nil? or pmids == "0"
|
|
97
|
+
pmids = pmids.split(";").compact.reject{|s| s.empty?}.collect{|s| s.sub(/\s*pmid:\s*/,'').strip}*";"
|
|
98
|
+
|
|
99
|
+
current = tsv[tf]
|
|
100
|
+
if current and current[0].include? target
|
|
101
|
+
new = []
|
|
102
|
+
Misc.zip_fields(current).each do |ntarget,nsign,nspecies,nsource,npmids|
|
|
103
|
+
if target == ntarget
|
|
104
|
+
if species != nspecies
|
|
105
|
+
nspecies = (nspecies.split(";") + species.split(";")).uniq * ";"
|
|
106
|
+
end
|
|
107
|
+
npmids = (npmids.split(";") + pmids.split(";")).uniq * ";"
|
|
108
|
+
end
|
|
109
|
+
new << [ntarget, nsign, nspecies, nsource, npmids]
|
|
110
|
+
end
|
|
111
|
+
values = Misc.zip_fields(new)
|
|
112
|
+
tsv[tf] = values
|
|
113
|
+
else
|
|
114
|
+
pmids = "" if pmids.nil?
|
|
115
|
+
|
|
116
|
+
values = [target, "", species, source, pmids]
|
|
117
|
+
tsv.zip_new(tf, values)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
tsv.to_s
|
|
123
|
+
end
|
|
124
|
+
|
|
50
125
|
end
|
|
51
126
|
|
|
52
127
|
if defined? Entity and defined? Gene and Entity === Gene
|
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.1.
|
|
4
|
+
version: 3.1.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-04-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rbbt-util
|
|
@@ -181,19 +181,19 @@ signing_key:
|
|
|
181
181
|
specification_version: 4
|
|
182
182
|
summary: Data sources for the Ruby Bioinformatics Toolkit (rbbt)
|
|
183
183
|
test_files:
|
|
184
|
-
- test/test_helper.rb
|
|
185
184
|
- test/rbbt/sources/test_pubmed.rb
|
|
186
|
-
- test/rbbt/sources/
|
|
187
|
-
- test/rbbt/sources/test_gscholar.rb
|
|
185
|
+
- test/rbbt/sources/test_pharmagkb.rb
|
|
188
186
|
- test/rbbt/sources/test_biomart.rb
|
|
189
|
-
- test/rbbt/sources/
|
|
187
|
+
- test/rbbt/sources/test_gscholar.rb
|
|
188
|
+
- test/rbbt/sources/test_kegg.rb
|
|
190
189
|
- test/rbbt/sources/test_pina.rb
|
|
191
190
|
- test/rbbt/sources/test_entrez.rb
|
|
192
|
-
- test/rbbt/sources/test_pharmagkb.rb
|
|
193
|
-
- test/rbbt/sources/test_organism.rb
|
|
194
191
|
- test/rbbt/sources/test_matador.rb
|
|
195
|
-
- test/rbbt/sources/
|
|
196
|
-
- test/rbbt/sources/test_kegg.rb
|
|
192
|
+
- test/rbbt/sources/test_HPRD.rb
|
|
197
193
|
- test/rbbt/sources/test_synapse.rb
|
|
194
|
+
- test/rbbt/sources/test_go.rb
|
|
198
195
|
- test/rbbt/sources/test_stitch.rb
|
|
199
|
-
- test/rbbt/sources/
|
|
196
|
+
- test/rbbt/sources/test_organism.rb
|
|
197
|
+
- test/rbbt/sources/test_string.rb
|
|
198
|
+
- test/rbbt/sources/test_tfacts.rb
|
|
199
|
+
- test/test_helper.rb
|