rbbt-dm 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/matrix/differential.rb +22 -3
- data/lib/rbbt/matrix.rb +4 -1
- data/lib/rbbt/statistics/random_walk.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a64441aa1cd02aa113a218e75d8a45e8679404d
|
4
|
+
data.tar.gz: 3d8ec7e4202bdb5ec1f79baa95e534ad84270369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79dde04bbfa4955f595c6bc702c9c5791029ed0a52e5720cf8e453036cfa6279ac1aea49fd5eba399fc68e1a8fcdc2db7428beba21cf5fec68bb3f93653b5533
|
7
|
+
data.tar.gz: f43dc00fa73c817da58a807163feba66b3ce2275ff4b1c51f42ba458f3c8448047cc013da82c8be6aadd3cd57111dbe376a39166985497328867e34c0c0880ab
|
@@ -6,9 +6,28 @@ class Matrix
|
|
6
6
|
main_samples, contrast_samples = comparison main, contrast
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
name = data_file =~ /:>/ ? File.basename(data_file) : data_file
|
10
|
+
Persist.persist(name, :tsv, :update => true,
|
11
|
+
:other => {:main => main_samples, :contrast => contrast_samples},
|
12
|
+
:prefix => "Diff", :dir => Matrix.matrix_dir.differential, :no_load => true) do |file|
|
13
|
+
|
14
|
+
log2 = value_type.nil? or value_type == "count"
|
15
|
+
log2 = false
|
16
|
+
two_channel = false
|
17
|
+
FileUtils.mkdir_p File.dirname(file) unless file.nil? or File.exists? File.dirname(file)
|
18
|
+
cmd = "source('#{Rbbt.share.R["MA.R"].find}'); rbbt.dm.matrix.differential(#{ R.ruby2R data_file }, main = #{R.ruby2R(main_samples)}, contrast = #{R.ruby2R(contrast_samples)}, log2=#{ R.ruby2R log2 }, outfile = #{R.ruby2R path}, key.field = #{R.ruby2R format}, two.channel = #{R.ruby2R two_channel})"
|
19
|
+
R.run(cmd)
|
20
|
+
nil
|
12
21
|
end
|
13
22
|
end
|
14
23
|
end
|
24
|
+
|
25
|
+
|
26
|
+
#def self.analyze(datafile, main, contrast = nil, log2 = false, outfile = nil, key_field = nil, two_channel = nil)
|
27
|
+
# FileUtils.mkdir_p File.dirname(outfile) unless outfile.nil? or File.exists? File.dirname(outfile)
|
28
|
+
# GE.run_R("rbbt.GE.process(#{ R.ruby2R datafile }, main = #{R.ruby2R(main, :strings => true)}, contrast = #{R.ruby2R(contrast, :strings => true)}, log2=#{ R.ruby2R log2 }, outfile = #{R.ruby2R outfile}, key.field = #{R.ruby2R key_field}, two.channel = #{R.ruby2R two_channel})")
|
29
|
+
#end
|
30
|
+
#def self.barcode(datafile, outfile, factor = 2)
|
31
|
+
# FileUtils.mkdir_p File.dirname(outfile) unless outfile.nil? or File.exists? File.dirname(outfile)
|
32
|
+
# GE.run_R("rbbt.GE.barcode(#{ R.ruby2R datafile }, #{ R.ruby2R outfile }, #{ R.ruby2R factor })")
|
33
|
+
#end
|
data/lib/rbbt/matrix.rb
CHANGED
@@ -92,7 +92,10 @@ class Matrix
|
|
92
92
|
|
93
93
|
def to_gene(identifiers = nil)
|
94
94
|
require 'rbbt/tsv/change_id'
|
95
|
-
|
95
|
+
|
96
|
+
name = data_file =~ /:>/ ? File.basename(data_file) : data_file
|
97
|
+
|
98
|
+
file = Persist.persist(data_file, :tsv, :prefix => "Gene", :dir => Matrix.matrix_dir.values, :no_load => true) do
|
96
99
|
identifiers = [Organism.identifiers(organism), @identifiers, identifiers].compact.uniq
|
97
100
|
|
98
101
|
data_file.tsv(:cast => :to_f).change_key("Ensembl Gene ID", :identifiers => identifiers) do |v|
|
@@ -257,17 +257,18 @@ module RandomWalk
|
|
257
257
|
end
|
258
258
|
|
259
259
|
def self.persisted_permutations(size, total, missing = 0, times = 10_000)
|
260
|
-
repo_file = "/tmp/
|
260
|
+
repo_file = "/tmp/rw_repo7"
|
261
261
|
repo = Persist.open_tokyocabinet(repo_file, false, :float_array)
|
262
262
|
key = Misc.digest([size, total, missing, times, scoring_method].inspect)
|
263
|
+
repo.read
|
263
264
|
if repo[key]
|
264
265
|
repo[key]
|
265
266
|
else
|
266
267
|
p = permutations(size, total, missing, times)
|
267
|
-
repo.
|
268
|
-
|
269
|
-
|
270
|
-
|
268
|
+
repo.write_and_close do
|
269
|
+
repo[key] = p
|
270
|
+
end
|
271
|
+
p
|
271
272
|
end
|
272
273
|
end
|
273
274
|
|
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.
|
4
|
+
version: 1.1.7
|
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-
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbbt-util
|