rbbt-sources 3.0.17 → 3.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/sources/PSI_MI.rb +3 -1
- data/lib/rbbt/sources/pina.rb +31 -5
- 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: 2bffa0f27abdce0727b9aa6a95a2538c275cac02
|
4
|
+
data.tar.gz: 014e18755856b61315c6e1566f3fb2a7b4470892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b78601699a107f0a8565efa66068ee2b85185d4c55868cb813186fc0969140f11763666bf6e14b73f9e4c797d4a21b1dcee5a253a41d15275627e802be3a2da9
|
7
|
+
data.tar.gz: 181eab2593ad778f945632522802b5992b9f28718a6ec91f1fd56cc1112cf52261f572d195878919846ee4e661f69c56117473281a2ac275584e87d280cc6bf0
|
data/lib/rbbt/sources/PSI_MI.rb
CHANGED
@@ -12,6 +12,8 @@ module PSI_MI
|
|
12
12
|
tsv = TSV.setup({}, :type => :list, :key_field => "PSI-MI Term", :fields => ["Name", "Description"])
|
13
13
|
Open.open(URL).read.split("[Term]").each do |chunk|
|
14
14
|
id = chunk.scan(/id: ([^\n]*)/)[0]
|
15
|
+
next if id.nil?
|
16
|
+
id = id.first
|
15
17
|
name = chunk.scan(/name: ([^\n]*)/)[0]
|
16
18
|
description = chunk.scan(/def: "([^\n]*)"/)[0]
|
17
19
|
tsv[id] = [name, description]
|
@@ -29,7 +31,7 @@ if defined? Entity
|
|
29
31
|
module PSI_MITerm
|
30
32
|
extend Entity
|
31
33
|
|
32
|
-
self.format = "PSI-MI Term"
|
34
|
+
self.format = "PSI-MI Term", "Method"
|
33
35
|
|
34
36
|
property :name => :array2single do
|
35
37
|
@@index ||= PSI_MI.identifiers.tsv(:persist => true, :fields => ["Name"], :type => :single)
|
data/lib/rbbt/sources/pina.rb
CHANGED
@@ -1,11 +1,38 @@
|
|
1
|
-
require 'rbbt'
|
2
|
-
require 'rbbt/resource'
|
1
|
+
require 'rbbt-util'
|
3
2
|
|
4
3
|
module Pina
|
5
4
|
extend Resource
|
6
5
|
self.subdir = "share/databases/pina"
|
7
6
|
|
8
|
-
Pina.claim Pina.
|
7
|
+
Pina.claim Pina.protein_protein, :proc do
|
8
|
+
require 'rbbt/sources/organism'
|
9
|
+
|
10
|
+
url = "http://cbg.garvan.unsw.edu.au/pina/download/Homo%20sapiens-20121210.txt"
|
11
|
+
|
12
|
+
dumper = TSV::Dumper.new :type => :list, :type => :double,
|
13
|
+
:key_field => 'UniProt/SwissProt Accession', :namespace => Organism.default_code("Hsa"),
|
14
|
+
:fields => ['Interactor UniProt/SwissProt Accession', 'Method', 'Publication']
|
15
|
+
|
16
|
+
|
17
|
+
dumper.init
|
18
|
+
|
19
|
+
TSV.traverse Open.open(url), :type => :array, :into => dumper do |line|
|
20
|
+
next if line =~ /Publication/
|
21
|
+
|
22
|
+
parts = line.split("\t")
|
23
|
+
uni1, uni2 = parts.values_at(0,1).collect{|v| v.partition(":").last}
|
24
|
+
|
25
|
+
mi = parts[6].split("|").collect{|v| v.sub(/\(.*/,'').strip }
|
26
|
+
|
27
|
+
pubmed = parts[8].split("|").collect{|v| v.partition(":").last}
|
28
|
+
|
29
|
+
mi, pubmed = Misc.zip_fields(mi.zip(pubmed).uniq)
|
30
|
+
|
31
|
+
[uni1, [[uni2], [mi * ";;"], [pubmed * ";;"]]]
|
32
|
+
end
|
33
|
+
|
34
|
+
Misc.collapse_stream(Misc.sort_stream(dumper.stream))
|
35
|
+
end
|
9
36
|
end
|
10
37
|
|
11
38
|
if defined? Entity and defined? Gene and Entity === Gene
|
@@ -15,7 +42,7 @@ if defined? Entity and defined? Gene and Entity === Gene
|
|
15
42
|
module Gene
|
16
43
|
property :pina_interactors => :array2single do
|
17
44
|
ens2uniprot = Organism.identifiers(organism).tsv :key_field => "Ensembl Gene ID", :fields => ["UniProt/SwissProt Accession"], :type => :flat, :persist => true, :unnamed => true
|
18
|
-
pina = Pina.protein_protein.tsv(:persist => true, :fields => ["Interactor UniProt/SwissProt Accession", "Method", "
|
45
|
+
pina = Pina.protein_protein.tsv(:persist => true, :fields => ["Interactor UniProt/SwissProt Accession", "Method", "Publication"], :type => :double, :merge => true, :unnamed => true)
|
19
46
|
|
20
47
|
int = self.ensembl.collect do |ens|
|
21
48
|
uniprot = ens2uniprot[ens]
|
@@ -31,4 +58,3 @@ if defined? Entity and defined? Gene and Entity === Gene
|
|
31
58
|
end
|
32
59
|
end
|
33
60
|
end
|
34
|
-
|
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.18
|
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-09-
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbbt-util
|