rbbt-marq 1.0.0 → 1.0.1
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.
- data/R/CustomDS.R +10 -2
- data/install_scripts/GEO/Rakefile +1 -1
- data/lib/MARQ/CustomDS.rb +12 -4
- metadata +1 -1
data/R/CustomDS.R
CHANGED
@@ -4,17 +4,26 @@ CustomDS.process <- function(prefix, cross_platform, conditions, description, tw
|
|
4
4
|
# Read data
|
5
5
|
genes = scan(file=paste(prefix,'codes',sep = "/"), what=character(),sep="\n",quiet=T);
|
6
6
|
m = matrix(scan(file=paste(prefix,'values',sep = "/"), sep="\t",quiet=T),length(genes),byrow=T);
|
7
|
+
str(m);
|
8
|
+
str(genes);
|
7
9
|
rownames(m) <- genes
|
8
10
|
|
11
|
+
|
9
12
|
# Read conditions
|
10
13
|
conditions.list = vector();
|
11
14
|
names = vector();
|
15
|
+
str(conditions)
|
12
16
|
for (file in conditions){
|
13
|
-
|
17
|
+
str(paste(prefix,file,sep="/"));
|
18
|
+
values = scan(paste(prefix,file,sep="/"),what=character(), sep = "\n")
|
14
19
|
names = c(names, file)
|
20
|
+
str(values)
|
15
21
|
conditions.list = cbind(conditions.list, values)
|
16
22
|
}
|
17
23
|
|
24
|
+
colnames(conditions.list) <- names;
|
25
|
+
str(conditions.list)
|
26
|
+
|
18
27
|
|
19
28
|
|
20
29
|
|
@@ -39,7 +48,6 @@ CustomDS.process <- function(prefix, cross_platform, conditions, description, tw
|
|
39
48
|
if (cross_platform){
|
40
49
|
prefix = paste(prefix,'cross_platform', sep="_")
|
41
50
|
}
|
42
|
-
colnames(conditions.list) <- names;
|
43
51
|
|
44
52
|
values <- MA.process(m, conditions.list, two.channel);
|
45
53
|
|
data/lib/MARQ/CustomDS.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rbbt/util/open'
|
2
2
|
require 'MARQ'
|
3
3
|
require 'MARQ/ID'
|
4
|
+
|
4
5
|
module CustomDS
|
5
6
|
@@r = nil
|
6
7
|
|
@@ -9,6 +10,7 @@ module CustomDS
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def self.r
|
13
|
+
require 'rsruby'
|
12
14
|
if @@r.nil?
|
13
15
|
RSRuby.instance.source(MARQ.rootdir + '/R/MA.R')
|
14
16
|
RSRuby.instance.source(MARQ.rootdir + '/R/CustomDS.R')
|
@@ -62,10 +64,7 @@ module CustomDS
|
|
62
64
|
Dir.glob(File.join(customdir, org) + '/*.orders').collect{|f| clean(File.basename(f.sub(/.orders/,'')))}.uniq
|
63
65
|
end
|
64
66
|
|
65
|
-
def self.
|
66
|
-
puts "Processing #{ name }"
|
67
|
-
org = organism(name)
|
68
|
-
prefix = File.join(customdir, org, name)
|
67
|
+
def self.process_matrix(prefix, org)
|
69
68
|
conditions = Dir.glob(prefix + '/*').collect{|f| File.basename(f)} - %w(values codes info description cross_platform)
|
70
69
|
description = Open.read(File.join(prefix, 'description'))
|
71
70
|
|
@@ -82,6 +81,14 @@ module CustomDS
|
|
82
81
|
end
|
83
82
|
end
|
84
83
|
|
84
|
+
def self.process(name)
|
85
|
+
puts "Processing #{ name }"
|
86
|
+
org = organism(name)
|
87
|
+
prefix = File.join(customdir, org, name)
|
88
|
+
|
89
|
+
CustomDS::process_matrix(prefix, org)
|
90
|
+
end
|
91
|
+
|
85
92
|
end
|
86
93
|
|
87
94
|
|
@@ -89,6 +96,7 @@ if __FILE__ == $0
|
|
89
96
|
p CustomDS::datasets('sgd')
|
90
97
|
p CustomDS::path('HaploidData')
|
91
98
|
p CustomDS::path('HaploidData_cross_platform')
|
99
|
+
|
92
100
|
exit
|
93
101
|
|
94
102
|
org = 'sgd'
|