rbbt-sources 3.0.17 → 3.0.18

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: 07c7bfe556c862a0f646ad990d58e1eb15ded317
4
- data.tar.gz: 3b476b46b4b06980d0ea076030886bf93070ec01
3
+ metadata.gz: 2bffa0f27abdce0727b9aa6a95a2538c275cac02
4
+ data.tar.gz: 014e18755856b61315c6e1566f3fb2a7b4470892
5
5
  SHA512:
6
- metadata.gz: 6bdbdcd6427b78ba806f6b0708096f820bd077fbd63239dcf103523bd1195b9c7657cce3285910759ae45ef1a6377f031130f0fbea3ebb1b29daf5b8c2f838fb
7
- data.tar.gz: 4fa894ee97dc750995fda86d145c6fa40fa1c21d4f394e1bd48d104fae4e5bef861f4d7c2df610fe894f1f608fc3023b4b309fa7a9281644d43168cd61fb5d85
6
+ metadata.gz: b78601699a107f0a8565efa66068ee2b85185d4c55868cb813186fc0969140f11763666bf6e14b73f9e4c797d4a21b1dcee5a253a41d15275627e802be3a2da9
7
+ data.tar.gz: 181eab2593ad778f945632522802b5992b9f28718a6ec91f1fd56cc1112cf52261f572d195878919846ee4e661f69c56117473281a2ac275584e87d280cc6bf0
@@ -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)
@@ -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.root, :rake, Rbbt.share.install.Pina.Rakefile.find(:lib)
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", "PMID"], :type => :double, :merge => true, :unnamed => true)
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.17
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-19 00:00:00.000000000 Z
11
+ date: 2014-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util