rbbt-sources 3.0.12 → 3.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +2 -3
- data/lib/rbbt/sources/InterPro.rb +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e02b0afc9999bf09316fdf670616018c6901ea4a
|
4
|
+
data.tar.gz: d2f69f47d90ee82bbe93a0ed296fc02d2039b12f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 529580fa92fe6641913436758a10d429d2be6343686abfa823c6e1078a18f691feba85b245e9256f1ea3cbaf604865edc0fb1cf5ba4635d8c74f6bc60f77c3e6
|
7
|
+
data.tar.gz: adb3c36787f15ac5910b7f3fcfb890b6e4a6200a59c49a3d7f3062970ab94ba6fc83d979ea79e5163626ff92ca69eb008e1530991cbcdaa372af5cc6bcd4eb0e
|
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.13
|
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-08-
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbbt-util
|
@@ -92,7 +92,6 @@ files:
|
|
92
92
|
- lib/rbbt/sources/COSTART.rb
|
93
93
|
- lib/rbbt/sources/CTCAE.rb
|
94
94
|
- lib/rbbt/sources/HPRD.rb
|
95
|
-
- lib/rbbt/sources/InterPro.rb
|
96
95
|
- lib/rbbt/sources/NCI.rb
|
97
96
|
- lib/rbbt/sources/PSI_MI.rb
|
98
97
|
- lib/rbbt/sources/STITCH.rb
|
@@ -1,105 +0,0 @@
|
|
1
|
-
require 'rbbt-util'
|
2
|
-
require 'rbbt/sources/organism'
|
3
|
-
|
4
|
-
module InterPro
|
5
|
-
extend Resource
|
6
|
-
self.subdir = "share/databases/InterPro"
|
7
|
-
|
8
|
-
InterPro.claim InterPro.source.protein2ipr, :url, "ftp://ftp.ebi.ac.uk/pub/databases/interpro/protein2ipr.dat.gz"
|
9
|
-
|
10
|
-
InterPro.claim InterPro.protein_domains, :proc do
|
11
|
-
organism = "Hsa"
|
12
|
-
uniprot_colum = TSV::Parser.new(Organism.protein_identifiers(organism).open).all_fields.index("UniProt/SwissProt Accession")
|
13
|
-
uniprots = CMD.cmd("grep -v '^#'|cut -f #{uniprot_colum+1}", :in => Organism.protein_identifiers(organism).open).read.split("\n").collect{|l| l.split("|")}.flatten.uniq.reject{|l| l.empty?}
|
14
|
-
|
15
|
-
tsv = nil
|
16
|
-
TmpFile.with_file(uniprots * "\n") do |tmpfile|
|
17
|
-
tsv = TSV.open(CMD.cmd("cut -f 1,2,5,6 | sort -u |grep -w -F -f #{ tmpfile }", :in => InterPro.source.protein2ipr.open, :pipe => true), :merge => true, :type => :double)
|
18
|
-
end
|
19
|
-
|
20
|
-
tsv.key_field = "UniProt/SwissProt Accession"
|
21
|
-
tsv.fields = ["InterPro ID", "Domain Start AA", "Domain End AA"]
|
22
|
-
tsv.to_s
|
23
|
-
end
|
24
|
-
|
25
|
-
InterPro.claim InterPro.domain_names, :proc do
|
26
|
-
#tsv = InterPro.source.protein2ipr.tsv :key_field => 1, :fields => [2], :type => :single
|
27
|
-
tsv = TSV.open(CMD.cmd("cut -f 2,3 | sort -u", :in => InterPro.source.protein2ipr.open, :pipe => true), :merge => true, :type => :single)
|
28
|
-
|
29
|
-
tsv.key_field = "InterPro ID"
|
30
|
-
tsv.fields = ["Domain Name"]
|
31
|
-
tsv.to_s
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.name_index
|
35
|
-
@@name_index ||= InterPro.domain_names.tsv(:persist => true, :unnamed => true)
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.gene_index
|
39
|
-
@@gene_index ||= InterPro.protein_domains.tsv(:persist => true, :key_field => "InterPro ID", :fields => ["UniProt/SwissProt Accession"], :type => :flat, :merge => true, :unnamed => true)
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.domain_index
|
43
|
-
@@domain_index ||= InterPro.protein_domains.tsv(:persist => true, :unnamed => true, :key_field => "UniProt/SwissProt Accession", :fields => ["InterPro ID"], :merge => true)
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.domain_position_index
|
47
|
-
@@domain_position_index ||= InterPro.protein_domains.tsv(:persist => true, :unnamed => true, :key_field => "UniProt/SwissProt Accession", :fields => ["InterPro ID", "Domain Start AA", "Domain End AA"], :type => :double, :merge => true)
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.ens2uniprot(organism)
|
51
|
-
@@ens2uniprot_index ||= {}
|
52
|
-
@@ens2uniprot_index[organism] ||= Organism.protein_identifiers(organism).tsv(:persist => true, :unnamed => true, :fields => ["UniProt/SwissProt Accession"], :key_field => "Ensembl Protein ID", :type => :double, :merge => true)
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
if defined? Entity
|
58
|
-
module InterProDomain
|
59
|
-
extend Entity
|
60
|
-
self.format = "InterPro ID"
|
61
|
-
|
62
|
-
self.annotation :organism
|
63
|
-
property :description => :array2single do
|
64
|
-
InterPro.name_index.values_at *self
|
65
|
-
end
|
66
|
-
|
67
|
-
property :name => :array2single do
|
68
|
-
InterPro.name_index.values_at *self
|
69
|
-
end
|
70
|
-
|
71
|
-
property :proteins => :array2single do
|
72
|
-
InterPro.gene_index.values_at(*self).
|
73
|
-
collect{|genes| genes = genes.uniq; genes.organism = organism if genes.respond_to? :organism; genes }.tap{|o| Protein.setup(o, "UniProt/SwissProt Accession", organism)}
|
74
|
-
end
|
75
|
-
|
76
|
-
property :genes => :array2single do
|
77
|
-
InterPro.gene_index.values_at(*self).
|
78
|
-
collect{|genes| genes = [] if genes.nil?; genes = genes.uniq; genes.organism = organism if genes.respond_to? :organism; genes }.tap{|o| Gene.setup(o, "UniProt/SwissProt Accession", organism)}
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
if defined? Protein and Entity === Protein
|
83
|
-
module Protein
|
84
|
-
property :interpro_domains => :array2single do
|
85
|
-
self.collect do |protein|
|
86
|
-
uniprot = (InterPro.ens2uniprot(protein.organism)[protein] || []).flatten
|
87
|
-
uniprot.empty? ? nil :
|
88
|
-
InterPro.domain_index.values_at(*uniprot).compact.flatten. each{|pth| pth.organism = organism if pth.respond_to? :organism }.uniq.tap{|o| InterProDomain.setup(o, organism)}
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
property :interpro_domain_positions => :array2single do
|
93
|
-
self.collect do |protein|
|
94
|
-
if protein.nil?
|
95
|
-
[].tap{|o| InterProDomain.setup(o, organism)}
|
96
|
-
else
|
97
|
-
uniprot = (InterPro.ens2uniprot(protein.organism)[protein] || []).flatten
|
98
|
-
uniprot.empty? ? nil :
|
99
|
-
InterPro.domain_position_index.values_at(*uniprot).compact.flatten(1).tap{|o| InterProDomain.setup(o, organism)}
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|