rbbt-marq 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/R/GEO.R +0 -2
  2. data/README.rdoc +5 -4
  3. data/bin/marq_config +6 -6
  4. data/lib/MARQ/GEO.rb +12 -6
  5. metadata +2 -2
data/R/GEO.R CHANGED
@@ -169,8 +169,6 @@ GEO.GDS.data <- function(name, id.field = NULL, translation.file = NULL, cachedi
169
169
  m <- MA.translate(m, trans);
170
170
  }
171
171
 
172
-
173
-
174
172
  return (list(conditions = conditions, m = m, two.channel = two.channel, description = description))
175
173
  }
176
174
 
data/README.rdoc CHANGED
@@ -15,10 +15,10 @@ MARQ. To install MARQ follow this recipie:
15
15
  * Install Rbbt
16
16
 
17
17
  rbbt_config configure
18
- rbbt_config install identifiers
18
+ rbbt_config prepare identifiers
19
19
  rbbt_config organisms
20
20
  # Choose the organisms you are interested in, and take the keyword. Like sgd for yeast
21
- rbbt_config update organisms -o sgd
21
+ rbbt_config install organisms -o sgd
22
22
 
23
23
  * Install R
24
24
  * Install bioconductor and GEOquery
@@ -34,8 +34,9 @@ MARQ. To install MARQ follow this recipie:
34
34
 
35
35
  * Install MARQ
36
36
  marq_config config
37
- marq_config install identifiers
38
- marq_config update GEO
37
+ marq_config prepare identifiers
38
+ marq_config prepare GEO
39
+ marq_config install GEO
39
40
 
40
41
  * MARQ depends on many gems. Some may be problematic to install, in particular
41
42
  rsruby. You may need to get the source and build it yourself instead
data/bin/marq_config CHANGED
@@ -69,12 +69,12 @@ $USAGE =<<EOT
69
69
  actions:
70
70
  * config: Set paths for data, cache, and tmp directories
71
71
 
72
- * install:
72
+ * prepare:
73
73
  * GEO: Install management files to process GEO datasets and series
74
74
  * CustomDS: Install management files to process data from other sources
75
75
  * identifiers: Load the identifier equivalences in the database
76
76
 
77
- * update:
77
+ * install:
78
78
  * GEO: Process datasets and series from GEO
79
79
  * CustomDS: Process datasets from other sources
80
80
 
@@ -91,12 +91,12 @@ class Controller < SimpleConsole::Controller
91
91
  params :string => {:p => :platform, :s => :series, :o => :organism}, :boolean => {:d => :update_db, :f => :force}, :integer => {:p => :port}
92
92
 
93
93
 
94
- def install
94
+ def prepare
95
95
  $organism = params[:organism] unless params[:organism].nil?
96
96
  @actions = params[:id] || %w(GEO)
97
97
  end
98
98
 
99
- def update
99
+ def install
100
100
  $platform = params[:platform] unless params[:platform].nil?
101
101
  $series = params[:series] unless params[:series].nil?
102
102
  $organism = params[:organism] unless params[:organism].nil?
@@ -166,7 +166,7 @@ class View < SimpleConsole::View
166
166
  configure
167
167
  end
168
168
 
169
- def install
169
+ def prepare
170
170
  require 'rbbt/sources/organism'
171
171
  require 'MARQ/ID'
172
172
  case
@@ -191,7 +191,7 @@ class View < SimpleConsole::View
191
191
  end
192
192
  end
193
193
 
194
- def update
194
+ def install
195
195
 
196
196
  require 'rake'
197
197
  @actions = [@actions] if @actions === String
data/lib/MARQ/GEO.rb CHANGED
@@ -350,23 +350,26 @@ module GEO
350
350
  end
351
351
  end
352
352
 
353
- # Rearange the lines of a file with the given order
353
+ # Rearange the lines of a file with the given order. The order specifies, for
354
+ # each position in the original file, where it should en in the final file
354
355
  def self.rearange(order, file, missing = "NA")
355
- orig_lines = File.open(file).collect
356
+ orig_lines = []
357
+ File.open(file).each_line{|l| orig_lines << l}
358
+
356
359
  return if orig_lines.empty?
357
360
  columns = orig_lines.first.split(/\t/).length
358
361
 
359
362
  lines = Array.new(order.length)
360
363
 
361
364
  orig_lines.each_with_index{|l,i|
362
- next if l.nil? || order[i].nil?
365
+ next if order[i].nil?
363
366
  lines[order[i]] = l.chomp
364
367
  }
365
368
 
366
369
  lines = lines.collect{|l| l || [missing]*columns*"\t"}
367
370
 
368
371
  fout = File.open(file, 'w')
369
- fout.write(lines.join("\n"))
372
+ fout.puts(lines.join("\n"))
370
373
  fout.close
371
374
  end
372
375
 
@@ -384,9 +387,9 @@ module GEO
384
387
  platform_positions = platform_order.values_at(*series_codes)
385
388
 
386
389
  # Fill with nil for missing positions
387
- platform_positions[platform_codes.length] ||= nil
390
+ platform_positions[platform_codes.length - 1] ||= nil
388
391
 
389
- %w(codes t logratios orders pvalues).each{|ext|
392
+ %w(t logratios orders pvalues).each{|ext|
390
393
  rearange(platform_positions, prefix + '.' + ext)
391
394
  }
392
395
 
@@ -435,6 +438,8 @@ module GEO
435
438
  # Are the codes of the series equivalent to the ones in the platform?
436
439
  if File.open(File.join(platform_path(platform),'codes')).collect{|l| l.chomp} != File.open(prefix + '.codes').collect{|l| l.chomp}
437
440
  fix_GSE_ids(File.join(platform_path(platform), 'codes'),prefix);
441
+ FileUtils.cp(File.join(platform_path(platform), 'codes'),prefix + '.codes')
442
+
438
443
  end
439
444
  end
440
445
 
@@ -453,6 +458,7 @@ module GEO
453
458
  puts "-- Translated to cross_platform format"
454
459
  GEO.get_GSE(gsms, conditions, do_log, prefix + '_cross_platform', prefix + '.translations',fields, info[:title], info[:description])
455
460
  fix_GSE_ids(File.join(platform_path(platform), 'cross_platform'),prefix + '_cross_platform');
461
+ FileUtils.cp(File.join(platform_path(platform), 'cross_platform'),prefix + '_cross_platform.codes')
456
462
  FileUtils.rm(prefix + '.translations') if File.exist?(prefix + '.translations')
457
463
  end
458
464
  FileUtils.rm(prefix + '.swap') if File.exist?(prefix + '.swap')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-marq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-13 00:00:00 +01:00
12
+ date: 2009-12-03 00:00:00 +01:00
13
13
  default_executable: marq_config
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency