rbbt-dm 1.1.44 → 1.1.45

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/matrix.rb +20 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa73301479755273960bc84aec02ba3684d834ba
4
- data.tar.gz: 5ea346bea9926dda33f3ccdb78651f5987abfb96
3
+ metadata.gz: 3d0fe8cd4d9acfbef39eab9bb2cc6537dc4846b8
4
+ data.tar.gz: 0f373711bbd5c67c072012570b67301336082df3
5
5
  SHA512:
6
- metadata.gz: f7f3774226a153552bf323ed058b21f405767810dce814166b605a87a6c7473ec5b38a4a56df82ba553c7f5d1521e2c04c401ae7a2b4df00281bf3d9d4ddc5dd
7
- data.tar.gz: c48a92abf268fe4acf1a7d405df8e93446fff00a7ccdbca16b4e0e1ffae8607a40eb67f2495e1908dc34dba2ba61d6079c9b2849078712786036d95f06531ca3
6
+ metadata.gz: 03f79f5464f66d147ca1e86fa30a86d911dc84e6a2766e13c7a04be1141405e9f46e545e76f04283a765b168c79b37ecde140bee096c9ce85604ada8cd5176db
7
+ data.tar.gz: 5e3aea0ec0e1c5683ac177e830883c4987dedd524353e14124148edc3c87181374a20a09c7b41c37c1bdb68e89efe0708fb532d3bc90f1403b4eb61bec8c87f4
@@ -176,6 +176,26 @@ class RbbtMatrix
176
176
  matrix
177
177
  end
178
178
 
179
+ def to_name(identifiers = nil)
180
+ require 'rbbt/tsv/change_id'
181
+
182
+ name = data_file =~ /:>/ ? File.basename(data_file) : data_file
183
+
184
+ file = Persist.persist(data_file, :tsv, :prefix => "Name", :check => [data_file], :dir => RbbtMatrix.matrix_dir.values, :no_load => true) do
185
+
186
+ data = data_file.tsv(:cast => :to_f)
187
+
188
+ identifiers = [identifiers, @identifiers, data.identifiers, Organism.identifiers(organism)].flatten.compact.uniq
189
+
190
+ data.change_key("Associated Gene Name", :identifiers => identifiers.reverse) do |v|
191
+ Misc.mean(v.compact)
192
+ end
193
+ end
194
+ subsets = self.subsets
195
+ matrix = RbbtMatrix.new file, labels, value_type, "Associated Gene Name", organism
196
+ matrix.subsets = subsets
197
+ matrix
198
+ end
179
199
  def to_barcode_ruby(factor = 2)
180
200
  name = data_file =~ /:>/ ? File.basename(data_file) : data_file
181
201
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-dm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.44
4
+ version: 1.1.45
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-12-02 00:00:00.000000000 Z
11
+ date: 2019-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util