rbbt-GE 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTllMWY4NTJjOWU3MzBjZmI4ZDdiYjAwMmFhOWNhZWNlZTg2MmQyOA==
5
+ data.tar.gz: !binary |-
6
+ ZTA2YzQ0ZWE1NjVhM2E2NTQyMjY4NTYxMTQ1NjkxNjUwNDBiYzhkNQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NzQ3MzNlNTAzM2IwMTYzNjJkMDI3MTBlYjU5ZDUzZGZlODc4YjZmMDUwYWNk
10
+ NTdjNjlhZjI2NWYzYjRjODdjNzY3Zjg0MjAwNWYwMTNlNjVkMzM5ZjcxZDYz
11
+ Yzg1NGZkNWI5MTkwN2MxMzNjYTM0NDYwOTBmN2RiNjE4YjJjZjE=
12
+ data.tar.gz: !binary |-
13
+ MzlhZjhjMjM5N2MwZGYyODVjMTc0N2FkZTdiN2IyMWJlNzQyYmU3MjgxYzg5
14
+ NjU4ZmM4ZGE0ZTYzZTMwZmZjNGEyZWRmNjQ4ZDZlNGNlMjA1ODVjNmY0ZGIw
15
+ MTczOTk4NzQ3ODU5OWE3MTdlNDRlMDIzYzdkMjU3N2Y5OWY0YWU=
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2011 Miguel Vázquez García
1
+ Copyright (c) 2010-2013 Miguel Vázquez García
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/lib/rbbt/GE.rb CHANGED
@@ -5,8 +5,8 @@ module GE
5
5
  MA = File.join(LIB_DIR, 'MA.R')
6
6
 
7
7
  def self.run_R(command)
8
- cmd = "source('#{MA}');" << command
9
- R.run(cmd)
8
+ cmd = "\nsource('#{MA}');\n" << command
9
+ R.run(cmd, :monitor => true)
10
10
  end
11
11
 
12
12
  def self.r_format(list, options = {})
@@ -35,5 +35,11 @@ module GE
35
35
  FileUtils.mkdir_p File.dirname(outfile) unless outfile.nil? or File.exists? File.dirname(outfile)
36
36
  GE.run_R("rbbt.GE.process(#{ r_format datafile }, main = #{r_format(main, :strings => true)}, contrast = #{r_format(contrast, :strings => true)}, log2=#{ r_format log2 }, outfile = #{r_format outfile}, key.field = #{r_format key_field}, two.channel = #{r_format two_channel})")
37
37
  end
38
+
39
+ def self.barcode(datafile, outfile, factor = 2)
40
+ FileUtils.mkdir_p File.dirname(outfile) unless outfile.nil? or File.exists? File.dirname(outfile)
41
+ GE.run_R("rbbt.GE.barcode(#{ r_format datafile }, #{ r_format outfile }, #{ r_format factor })")
42
+ end
43
+
38
44
  end
39
45
 
data/lib/rbbt/GE/GEO.rb CHANGED
@@ -142,6 +142,7 @@ module GEO
142
142
  def self.parse_header(stream, info)
143
143
  header = ""
144
144
  while line = stream.readline
145
+ line = Misc.fixutf8 line
145
146
  header << line
146
147
  break if line =~ /^#{info[:DELIMITER]}/i
147
148
  raise "Delimiter not found" if stream.eof?
data/share/lib/R/MA.R CHANGED
@@ -1,5 +1,35 @@
1
1
  library(limma)
2
2
 
3
+ #########################################################################
4
+ # BARCODE
5
+
6
+ rbbt.GE.barcode <- function(matrix_file, output_file, sd.factor = 2){
7
+ data = rbbt.tsv(matrix_file)
8
+ data.mean = rowMeans(data, na.rm=T)
9
+ data.sd = apply(data, 1, sd, na.rm=T)
10
+ data.threshold = as.matrix(data.mean) + sd.factor * as.matrix(data.sd)
11
+ names(data.threshold) = names(data.mean)
12
+ rm(data.mean)
13
+ rm(data.sd)
14
+
15
+ file.barcode = file(output_file, 'w')
16
+
17
+ cat("#Ensembl Gene ID", file = file.barcode)
18
+ cat("\t", file = file.barcode)
19
+ cat(colnames(data), file = file.barcode, sep="\t")
20
+ cat("\n", file = file.barcode)
21
+
22
+ for (gene in rownames(data)){
23
+ barcode = (data[gene,] - data.threshold[gene]) > 0
24
+
25
+ cat(gene, file = file.barcode)
26
+ cat("\t", file = file.barcode)
27
+ cat(barcode, file = file.barcode, sep = "\t")
28
+ cat("\n", file = file.barcode)
29
+ }
30
+ close(file.barcode)
31
+ }
32
+
3
33
  #########################################################################
4
34
  # Model processing
5
35
 
@@ -529,6 +559,4 @@ MA.load <- function(prefix, orders = TRUE, logratios = TRUE, t = TRUE, p.values
529
559
 
530
560
 
531
561
  return(data);
532
-
533
-
534
562
  }
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-GE
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Miguel Vazquez
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-21 00:00:00.000000000 Z
11
+ date: 2013-10-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rbbt-util
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -39,32 +36,31 @@ files:
39
36
  - lib/rbbt/GE/GEO.rb
40
37
  - share/install/GEO/Rakefile
41
38
  - share/lib/R/MA.R
42
- - test/test_helper.rb
43
39
  - test/rbbt/GE/test_GEO.rb
40
+ - test/test_helper.rb
44
41
  homepage: http://github.com/mikisvaz/rbbt-GE
45
42
  licenses: []
43
+ metadata: {}
46
44
  post_install_message:
47
45
  rdoc_options: []
48
46
  require_paths:
49
47
  - lib
50
48
  required_ruby_version: !ruby/object:Gem::Requirement
51
- none: false
52
49
  requirements:
53
50
  - - ! '>='
54
51
  - !ruby/object:Gem::Version
55
52
  version: '0'
56
53
  required_rubygems_version: !ruby/object:Gem::Requirement
57
- none: false
58
54
  requirements:
59
55
  - - ! '>='
60
56
  - !ruby/object:Gem::Version
61
57
  version: '0'
62
58
  requirements: []
63
59
  rubyforge_project:
64
- rubygems_version: 1.8.24
60
+ rubygems_version: 2.0.3
65
61
  signing_key:
66
- specification_version: 3
62
+ specification_version: 4
67
63
  summary: Gene Expression in RBBT
68
64
  test_files:
69
- - test/test_helper.rb
70
65
  - test/rbbt/GE/test_GEO.rb
66
+ - test/test_helper.rb