rbbt-dm 1.1.24 → 1.1.25

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 +11 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d11d8ef4665bf67cfb366e8d4d09cf4c15ab071
4
- data.tar.gz: 0fcbe23b5740ff83c7f82982720e836628bd0634
3
+ metadata.gz: 94d4fbd7b7ffddd81c3c6dd24485a15b1e420134
4
+ data.tar.gz: 94f9901bce9948cb345674a4a49241b6d33a5254
5
5
  SHA512:
6
- metadata.gz: ff7cd428d4e85a6e52f84343932e42dbab7621cd6197d38a0166e90e3bbd791877a436122970d12d884158edccda287e5a34765f96688df1a644d3eb4164fd90
7
- data.tar.gz: d538ed4a9b3f7b1a6d4b791c52c273a084f7ef697dcbd56d6b7905f8071fa3339a89cb53f99f08c86bc385d168efcd45c06f17b1e76f6d28927d73c836130179
6
+ metadata.gz: fa1a981b51c442d4e6a48dcd492ed6130edf2d69a10dac97a02d43ce5986751c37a5b116c0a64bc9697439650d7ec39b474daf4e11ea8fdd5ca78aa03bdacee1
7
+ data.tar.gz: a5eb5605c22a764824ead1cc5c591b7f039790778ec623d6901db4d0293aeb5cb2c8c8b045f712917be62c98a1377193e6594ddbba659880a395711996fa7195
@@ -42,14 +42,16 @@ class Matrix
42
42
  subsets = {}
43
43
  case @labels
44
44
  when Path
45
- labels = @labels.tsv
46
- factors = labels.fields
47
- labels.through do |sample,values|
48
- factors.zip(values).each do |factor,value|
49
- subsets[factor] ||= {}
50
- subsets[factor][value] ||= []
51
- subsets[factor][value] << sample
52
- end
45
+ if @labels.exists?
46
+ labels = @labels.tsv
47
+ factors = labels.fields
48
+ labels.through do |sample,values|
49
+ factors.zip(values).each do |factor,value|
50
+ subsets[factor] ||= {}
51
+ subsets[factor][value] ||= []
52
+ subsets[factor][value] << sample
53
+ end
54
+ end
53
55
  end
54
56
 
55
57
  when TSV
@@ -149,7 +151,7 @@ class Matrix
149
151
  end
150
152
 
151
153
  def tsv(to_gene=true, identifiers = nil)
152
- if to_gene
154
+ if to_gene and TSV.parse_header(self.data_file).key_field != "Ensembl Gene ID"
153
155
  file = self.to_gene(identifiers).data_file
154
156
  file.tsv :persist => true, :persist_dir => Matrix.matrix_dir.persist, :type => :double, :merge => true, :cast => nil
155
157
  else
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.24
4
+ version: 1.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-21 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util