rbbt-sources 3.1.32 → 3.1.33

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: 0c4f4b556028ce477969e38d0b4a1d8a05b01305
4
- data.tar.gz: 208e92cf212d96dc3333000d350e598ec45f6361
3
+ metadata.gz: 1bc10d05cb25aa6e8c21a838af30f8e910915411
4
+ data.tar.gz: 5c1443c4088a393a33513884813ef3eb9b276ff7
5
5
  SHA512:
6
- metadata.gz: 1f3e8855b0a233a6d97b80193a92fd90c45e1bfefb0f5b074a4aad2ec7151d9de1dd1c1eae842a84a9f15aeb436af4b97330845ec4ee8defe03735e65de1037f
7
- data.tar.gz: a3f529915268806ac18920cfea3786ec2ab906b8492f3f8d6fd7786480a07bf1b17d6b4f5963a6175a1ff231a1697e53099fda66628e5d1fea9f7d525d7cf44e
6
+ metadata.gz: 9c2c009324e163840751e84ec0b2eeaff7ed02588637140f26563814183ef43666c2118b92c560cf5fff56c30d9913160e0a940092b4327259f1b18d66efa7fd
7
+ data.tar.gz: dc09879abc9d3b1f60ff9ecc68f4a2d34da8dfbc19aa6cfcc5640d773d8412b8aa5e3a630dba0b8a8f54c1753dfd88d61c5b50bec8a94694798e0ab376a5804d
@@ -12,18 +12,8 @@ module CASCADE
12
12
  #self.search_paths = {}
13
13
  #self.search_paths[:default] = :lib
14
14
 
15
-
16
- URL = 'https://bitbucket.org/asmundf/cascade'
17
- CASCADE.claim CASCADE.interactions, :proc do
18
- io = nil
19
- TmpFile.with_file do |tmp|
20
- Misc.in_dir tmp do
21
- Log.warn "Please enter bitbucket credentials to access the asmundf/cascade repo"
22
- `git clone #{URL}`
23
- io = Open.open("cascade/cascade.tsv")
24
- end
25
- end
26
-
15
+ def self.process_interactions(file)
16
+ io = Open.open(file)
27
17
  tsv = TSV.open(io, :merge => true, :header_hash => '')
28
18
 
29
19
  new_fields = ["ENTITYB"] + (tsv.fields - ["ENTITYB"])
@@ -36,33 +26,19 @@ module CASCADE
36
26
  values.collect{|v| v.scan(/\d+/) * ";;"}
37
27
  end
38
28
 
39
- tsv.to_s
29
+ tsv
40
30
  end
41
31
 
42
- CASCADE.claim CASCADE.members, :proc do
43
- io = nil
44
- TmpFile.with_file do |tmp|
45
- Misc.in_dir tmp do
46
- Log.warn "Please enter bitbucket credentials to access the asmundf/cascade repo"
47
- `git clone #{URL}`
48
- io = Open.open("cascade/cascade_translation.tsv")
49
- end
50
- end
51
-
52
- tsv = TSV.open(io, :merge => true, :header_hash => '', :type => :flat, :sep2 => /[,.]\s*/)
53
-
32
+ def self.process_members(file)
33
+ TSV.open(file, :merge => true, :header_hash => '', :type => :flat, :sep2 => /[,.]\s*/)
54
34
  end
55
35
 
56
- CASCADE.claim CASCADE.paradigm, :proc do
57
-
58
- tsv = CASCADE.interactions.tsv
59
- members = CASCADE.members.tsv
60
-
36
+ def self.process_paradigm(interactions, members)
61
37
  proteins = Set.new members.values.flatten.uniq
62
38
  outputs = Set.new
63
39
  associations = {}
64
40
 
65
- tsv.through do |source, values|
41
+ interactions.through do |source, values|
66
42
  values.zip_fields.each do |target,typea,ida,databasea,typeb,idb,databaseb,effect|
67
43
  next if typea == 'gene'
68
44
 
@@ -129,24 +105,35 @@ module CASCADE
129
105
  str
130
106
  end
131
107
 
132
- CASCADE.claim CASCADE["topology.sif"], :proc do
133
-
134
- tsv = CASCADE.interactions.tsv
135
-
136
- str = StringIO.new
137
108
 
138
- tsv.through do |source, values|
139
- values.zip_fields.each do |target,typea,ida,databasea,typeb,idb,databaseb,effect|
140
-
141
- effect_symbol = '->'
142
- effect_symbol = '-|' if effect.include? 'inhibit'
109
+ URL = 'https://bitbucket.org/asmundf/cascade'
110
+ CASCADE.claim CASCADE.interactions, :proc do
111
+ io = nil
112
+ TmpFile.with_file do |tmp|
113
+ Misc.in_dir tmp do
114
+ Log.warn "Please enter bitbucket credentials to access the asmundf/cascade repo"
115
+ `git clone #{URL}`
116
+ process_interactions("cascade/cascade.tsv")
117
+ end
118
+ end
119
+ end
143
120
 
144
- str.puts [source, effect_symbol, target] * " "
121
+ CASCADE.claim CASCADE.members, :proc do
122
+ TmpFile.with_file do |tmp|
123
+ Misc.in_dir tmp do
124
+ Log.warn "Please enter bitbucket credentials to access the asmundf/cascade repo"
125
+ `git clone #{URL}`
126
+ process_members("cascade/cascade_translation.tsv")
145
127
  end
146
128
  end
129
+ end
147
130
 
148
- str.rewind
149
- str
131
+ CASCADE.claim CASCADE.paradigm, :proc do
132
+
133
+ interactions = CASCADE.interactions.tsv
134
+ members = CASCADE.members.tsv
135
+
136
+ process_paradigm(interactions, members)
150
137
  end
151
138
 
152
139
  CASCADE.claim CASCADE.output_nodes, :proc do
@@ -173,5 +160,5 @@ iif CASCADE.interactions.produce.find if __FILE__ == $0
173
160
  iif CASCADE.members.produce.find if __FILE__ == $0
174
161
  iif CASCADE.paradigm.produce.find if __FILE__ == $0
175
162
  iif CASCADE["topology.sif"].produce.find if __FILE__ == $0
176
- iif CASCADE.output_nodes.produce(true).find if __FILE__ == $0
163
+ iif CASCADE.output_nodes.produce.find if __FILE__ == $0
177
164
 
@@ -21,5 +21,5 @@ module MCLP
21
21
  end
22
22
  end
23
23
 
24
- iif MCLP.RPPA.produce(true).find if __FILE__ == $0
24
+ iif MCLP.RPPA.produce.find if __FILE__ == $0
25
25
 
@@ -6,7 +6,6 @@ require 'rbbt/persist/tsv'
6
6
  # now all it does is provide a translation form id to the actual names.
7
7
  module GO
8
8
 
9
- extend Resource
10
9
 
11
10
  extend Resource
12
11
  self.subdir = 'share/databases/GO'
@@ -270,4 +269,3 @@ if defined? Entity
270
269
  end
271
270
  end
272
271
 
273
-
@@ -32,6 +32,10 @@ $biomart_transcript = [
32
32
  $biomart_ensembl_gene
33
33
  ]
34
34
 
35
+ $biomart_transcript_cds = [
36
+ ['CDS Start','cdna_coding_start'],
37
+ ]
38
+
35
39
  $biomart_transcript_sequence = [
36
40
  ['cDNA','cdna'],
37
41
  ]
@@ -209,6 +213,12 @@ file 'transcripts' => 'gene_positions' do |t|
209
213
  Misc.sensiblewrite(t.name, transcripts.to_s)
210
214
  end
211
215
 
216
+ file 'transcript_cds' do |t|
217
+ cds = BioMart.tsv($biomart_db, $biomart_ensembl_transcript, $biomart_transcript_cds, [], nil, :type => :single, :namespace => Thread.current['namespace'], :cast => :to_i)
218
+
219
+ Misc.sensiblewrite(t.name, cds.to_s)
220
+ end
221
+
212
222
  file 'gene_positions' do |t|
213
223
  sequences = BioMart.tsv($biomart_db, $biomart_ensembl_gene, $biomart_gene_positions, [])
214
224
 
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.32
4
+ version: 3.1.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-03 00:00:00.000000000 Z
11
+ date: 2019-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util