rbbt-dm 1.1.23 → 1.1.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e243ce5032fd1fecaa9cec716678f8882c50a54e
4
- data.tar.gz: d2b58265604a3933eb4b6528cbb57faf424c9aea
3
+ metadata.gz: 6d11d8ef4665bf67cfb366e8d4d09cf4c15ab071
4
+ data.tar.gz: 0fcbe23b5740ff83c7f82982720e836628bd0634
5
5
  SHA512:
6
- metadata.gz: 450a0de2320972c6848b1d88af2faf11743c48fdf0c5013232df25d7bb1686487cae7e1cd97c7ceb9863d7e7b66d2e969b9b27631569efde3aa78d6bb68dc69a
7
- data.tar.gz: 215e2140ba429f94d1dd452c867e4ce611efa520c309a2c5003a45ea9dc463bf55d8f0272ce8111c6dc518519d539b78653eecb6680cf94df3b6b5eae5599aaa
6
+ metadata.gz: ff7cd428d4e85a6e52f84343932e42dbab7621cd6197d38a0166e90e3bbd791877a436122970d12d884158edccda287e5a34765f96688df1a644d3eb4164fd90
7
+ data.tar.gz: d538ed4a9b3f7b1a6d4b791c52c273a084f7ef697dcbd56d6b7905f8071fa3339a89cb53f99f08c86bc385d168efcd45c06f17b1e76f6d28927d73c836130179
data/lib/rbbt/matrix.rb CHANGED
@@ -147,4 +147,14 @@ class Matrix
147
147
  matrix.subsets = subsets
148
148
  matrix
149
149
  end
150
+
151
+ def tsv(to_gene=true, identifiers = nil)
152
+ if to_gene
153
+ file = self.to_gene(identifiers).data_file
154
+ file.tsv :persist => true, :persist_dir => Matrix.matrix_dir.persist, :type => :double, :merge => true, :cast => nil
155
+ else
156
+ self.data_file.tsv :persist => true, :persist_dir => Matrix.matrix_dir.persist, :type => :double, :merge => true, :cast => nil
157
+ end
158
+ end
159
+
150
160
  end
@@ -46,7 +46,7 @@ module TSV
46
46
  if block_given?
47
47
  scores = fields.collect{|field| tsv.sort_by(field, true, &block)}
48
48
  else
49
- scores = fields.collect{|field| tsv.sort_by(field, true){|gene,values| tsv.type == :single ? values.to_f : values.flatten.first.to_f}}
49
+ scores = fields.collect{|field| tsv.sort_by(field, true){|gene,values| (tsv.type == :single or tsv.type == :list) ? values.to_f : values.flatten.first.to_f}}
50
50
  end
51
51
  positions = {}
52
52
 
data/share/R/MA.R CHANGED
@@ -79,6 +79,10 @@ rbbt.dm.matrix.differential <- function(file, main, contrast = NULL, log2 = FALS
79
79
  main <- make.names(main);
80
80
  contrast <- make.names(contrast);
81
81
 
82
+ data[data == 0] = NA
83
+ good.rows = apply(is.na(data),1,sum) != dim(data)[2]
84
+ data = data[good.rows,]
85
+
82
86
  ids = rownames(data);
83
87
  if (is.null(key.field)){ key.field = "ID" }
84
88
 
@@ -137,7 +141,7 @@ rbbt.dm.matrix.differential <- function(file, main, contrast = NULL, log2 = FALS
137
141
  result = data.frame(ratio = ratio)
138
142
  }
139
143
 
140
- rownames(result) <- original.dimnames[[1]]
144
+ rownames(result) <- original.dimnames[[1]][good.rows]
141
145
 
142
146
  if (is.null(outfile)){
143
147
  return(result);
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.23
4
+ version: 1.1.24
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-14 00:00:00.000000000 Z
11
+ date: 2016-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util