bio-affy 0.1.0.alpha.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +16 -0
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bio-affy.gemspec +8 -31
- data/ext/src/Rakefile +1 -1
- data/ext/src/biolib_R_map.c +37 -0
- data/ext/src/biolib_R_map.h +13 -0
- data/ext/src/biolib_error.c +61 -0
- data/ext/src/biolib_error.h +22 -0
- data/ext/src/mkrf_conf.rb +2 -0
- data/lib/bio/affyext.rb +17 -4
- data/spec/bio-affy_spec.rb +31 -9
- metadata +22 -45
- data/ext/R/check.cdf.type.R +0 -18
- data/ext/R/read.cdffile.list.R +0 -23
- data/ext/R/read.celfile.R +0 -11
- data/ext/R/read.celfile.header.R +0 -37
- data/ext/R/read.probematrices.R +0 -29
- data/ext/man/check.cdf.type.Rd +0 -22
- data/ext/man/read.cdffile.list.Rd +0 -20
- data/ext/man/read.celfile.Rd +0 -23
- data/ext/man/read.celfile.header.Rd +0 -22
- data/ext/man/read.celfile.probeintensity.matrices.Rd +0 -31
- data/ext/src/biolib_affyio.o +0 -0
- data/ext/src/fread_functions.o +0 -0
- data/ext/src/libaffyext.so +0 -0
- data/ext/src/mkrf.log +0 -11
- data/ext/src/read_abatch.o +0 -0
- data/ext/src/read_bpmap.o +0 -0
- data/ext/src/read_cdf_xda.o +0 -0
- data/ext/src/read_cdffile2.o +0 -0
- data/ext/src/read_celfile_generic.o +0 -0
- data/ext/src/read_clf.o +0 -0
- data/ext/src/read_generic.o +0 -0
- data/ext/src/read_pgf.o +0 -0
- data/lib/bio/libaffyext.so +0 -0
- data/test/data/affy/GSM103328.CEL.gz +0 -0
- data/test/data/affy/GSM103329.CEL.gz +0 -0
- data/test/data/affy/GSM103330.CEL.gz +0 -0
- data/test/data/affy/MG_U74Av2.CDF.gz +0 -0
data/README.rdoc
CHANGED
@@ -25,6 +25,22 @@ Next run the tool with
|
|
25
25
|
|
26
26
|
bio-affy --help
|
27
27
|
|
28
|
+
This module was written with
|
29
|
+
|
30
|
+
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
|
31
|
+
Using rake (0.9.2.2)
|
32
|
+
Using bundler (1.0.21)
|
33
|
+
Using diff-lcs (1.1.3)
|
34
|
+
Using ffi (1.0.11)
|
35
|
+
Using git (1.2.5)
|
36
|
+
Using jeweler (1.6.4)
|
37
|
+
Using mkrf (0.2.3)
|
38
|
+
Using rcov (0.9.11)
|
39
|
+
Using rspec-core (2.7.1)
|
40
|
+
Using rspec-expectations (2.7.0)
|
41
|
+
Using rspec-mocks (2.7.0)
|
42
|
+
Using rspec (2.7.0)
|
43
|
+
|
28
44
|
== Copyright
|
29
45
|
|
30
46
|
Copyright (C) 2011 Pjotr Prins <pjotr.prins@thebird.nl>
|
data/Rakefile
CHANGED
@@ -27,6 +27,7 @@ Jeweler::Tasks.new do |gem|
|
|
27
27
|
gem.authors = ["Pjotr Prins"]
|
28
28
|
gem.extensions = "ext/src/mkrf_conf.rb"
|
29
29
|
gem.files += Dir['lib/**/*'] + Dir['ext/**/*']
|
30
|
+
gem.files.reject! { | n | n =~ /\.(o|so|gz|CDF|R|Rd|log)$/ }
|
30
31
|
gem.rubyforge_project = "nowarning"
|
31
32
|
|
32
33
|
# dependencies defined in Gemfile
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/bio-affy.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bio-affy"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Pjotr Prins"]
|
12
|
-
s.date = "2011-12-
|
12
|
+
s.date = "2011-12-05"
|
13
13
|
s.description = "Affymetrix microarray file format parser\n (CEL/CDF) for Ruby. FFI binding to Biolib port of R/Affyio by Benjamin Milo Bolstad"
|
14
14
|
s.email = "pjotr.public01@thebird.nl"
|
15
15
|
s.executables = ["bio-affy"]
|
@@ -33,63 +33,40 @@ Gem::Specification.new do |s|
|
|
33
33
|
"ext/HISTORY",
|
34
34
|
"ext/LICENSE",
|
35
35
|
"ext/NAMESPACE",
|
36
|
-
"ext/R/check.cdf.type.R",
|
37
|
-
"ext/R/read.cdffile.list.R",
|
38
|
-
"ext/R/read.celfile.R",
|
39
|
-
"ext/R/read.celfile.header.R",
|
40
|
-
"ext/R/read.probematrices.R",
|
41
36
|
"ext/README_BIOLIB",
|
42
37
|
"ext/aclocal.m4",
|
43
38
|
"ext/configure",
|
44
39
|
"ext/configure.in",
|
45
|
-
"ext/man/check.cdf.type.Rd",
|
46
|
-
"ext/man/read.cdffile.list.Rd",
|
47
|
-
"ext/man/read.celfile.Rd",
|
48
|
-
"ext/man/read.celfile.header.Rd",
|
49
|
-
"ext/man/read.celfile.probeintensity.matrices.Rd",
|
50
40
|
"ext/src/CMakeLists.txt",
|
51
41
|
"ext/src/Makevars.in",
|
52
42
|
"ext/src/Makevars.win",
|
53
43
|
"ext/src/Rakefile",
|
44
|
+
"ext/src/biolib_R_map.c",
|
45
|
+
"ext/src/biolib_R_map.h",
|
54
46
|
"ext/src/biolib_affyio.c",
|
55
47
|
"ext/src/biolib_affyio.h",
|
56
|
-
"ext/src/
|
48
|
+
"ext/src/biolib_error.c",
|
49
|
+
"ext/src/biolib_error.h",
|
57
50
|
"ext/src/fread_functions.c",
|
58
51
|
"ext/src/fread_functions.h",
|
59
|
-
"ext/src/fread_functions.o",
|
60
|
-
"ext/src/libaffyext.so",
|
61
|
-
"ext/src/mkrf.log",
|
62
52
|
"ext/src/mkrf_conf.rb",
|
63
53
|
"ext/src/read_abatch.c",
|
64
54
|
"ext/src/read_abatch.h",
|
65
|
-
"ext/src/read_abatch.o",
|
66
55
|
"ext/src/read_bpmap.c",
|
67
|
-
"ext/src/read_bpmap.o",
|
68
56
|
"ext/src/read_cdf.h",
|
69
57
|
"ext/src/read_cdf_xda.c",
|
70
|
-
"ext/src/read_cdf_xda.o",
|
71
58
|
"ext/src/read_cdffile2.c",
|
72
|
-
"ext/src/read_cdffile2.o",
|
73
59
|
"ext/src/read_celfile_generic.c",
|
74
60
|
"ext/src/read_celfile_generic.h",
|
75
|
-
"ext/src/read_celfile_generic.o",
|
76
61
|
"ext/src/read_clf.c",
|
77
|
-
"ext/src/read_clf.o",
|
78
62
|
"ext/src/read_generic.c",
|
79
63
|
"ext/src/read_generic.h",
|
80
|
-
"ext/src/read_generic.o",
|
81
64
|
"ext/src/read_pgf.c",
|
82
|
-
"ext/src/read_pgf.o",
|
83
65
|
"lib/bio-affy.rb",
|
84
66
|
"lib/bio/affy.rb",
|
85
67
|
"lib/bio/affyext.rb",
|
86
|
-
"lib/bio/libaffyext.so",
|
87
68
|
"spec/bio-affy_spec.rb",
|
88
|
-
"spec/spec_helper.rb"
|
89
|
-
"test/data/affy/GSM103328.CEL.gz",
|
90
|
-
"test/data/affy/GSM103329.CEL.gz",
|
91
|
-
"test/data/affy/GSM103330.CEL.gz",
|
92
|
-
"test/data/affy/MG_U74Av2.CDF.gz"
|
69
|
+
"spec/spec_helper.rb"
|
93
70
|
]
|
94
71
|
s.homepage = "http://github.com/pjotrp/bioruby-affy"
|
95
72
|
s.licenses = ["MIT"]
|
data/ext/src/Rakefile
CHANGED
@@ -18,7 +18,7 @@ INCLUDES = "-I/home/wrk/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I/home/wrk
|
|
18
18
|
|
19
19
|
LIBS = "-lpthread -lrt -ldl -lcrypt -lm"
|
20
20
|
|
21
|
-
CFLAGS = "-fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings
|
21
|
+
CFLAGS = "-fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -fPIC -I/usr/share/R/include "
|
22
22
|
|
23
23
|
RUBYARCHDIR = "#{ENV["RUBYARCHDIR"]}"
|
24
24
|
LIBRUBYARG_SHARED = "-Wl,-R -Wl,/home/wrk/.rvm/rubies/ruby-1.9.3-p0/lib -L/home/wrk/.rvm/rubies/ruby-1.9.3-p0/lib -lruby"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
// #include <stdio.h>
|
3
|
+
#include <stdlib.h>
|
4
|
+
#include <stdbool.h>
|
5
|
+
#include <biolib_error.h>
|
6
|
+
#include <biolib_R_map.h>
|
7
|
+
|
8
|
+
int R_running = false;
|
9
|
+
|
10
|
+
/*
|
11
|
+
* Initialize the R environment so we can use Rlib.so.
|
12
|
+
* FIXME: R_HOME is hard coded here.
|
13
|
+
*/
|
14
|
+
|
15
|
+
void BioLib_R_Init() {
|
16
|
+
char *argv[] = {"BiolibEmbeddedR", "--gui=none", "--silent", "--no-environ" };
|
17
|
+
int argc = sizeof(argv)/sizeof(argv[0]);
|
18
|
+
|
19
|
+
if (!R_running) {
|
20
|
+
biolib_log(LOG_INFO,"Initialize embedded R (library)");
|
21
|
+
setenv("R_HOME","/usr/lib/R",1);
|
22
|
+
Rf_initEmbeddedR(argc, argv);
|
23
|
+
R_running = true;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
/*
|
28
|
+
* Close down R environment
|
29
|
+
*/
|
30
|
+
|
31
|
+
void BioLib_R_Close() {
|
32
|
+
if (R_running) {
|
33
|
+
Rf_endEmbeddedR(0);
|
34
|
+
R_running = false;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/* Error and logger functions */
|
2
|
+
|
3
|
+
#include <stdio.h>
|
4
|
+
#include <stdarg.h>
|
5
|
+
#include <biolib_error.h>
|
6
|
+
|
7
|
+
static int loglevel = LOG_WARNING;
|
8
|
+
static FILE *stdlog = NULL;
|
9
|
+
static char *lognames[] = {
|
10
|
+
"LOG_EMERG",
|
11
|
+
"LOG_ALERT",
|
12
|
+
"LOG_CRIT",
|
13
|
+
"LOG_ERR",
|
14
|
+
"LOG_WARNING",
|
15
|
+
"LOG_NOTICE",
|
16
|
+
"LOG_INFO",
|
17
|
+
"LOG_DEBUG" };
|
18
|
+
|
19
|
+
|
20
|
+
void biolib_fatal(const char *template, ...)
|
21
|
+
{
|
22
|
+
|
23
|
+
va_list ap;
|
24
|
+
fprintf (stderr, "BIOLIB FATAL ERROR: ");
|
25
|
+
va_start (ap, template);
|
26
|
+
vfprintf (stderr, template, ap);
|
27
|
+
va_end (ap);
|
28
|
+
fprintf (stderr,"\n");
|
29
|
+
|
30
|
+
exit(4);
|
31
|
+
}
|
32
|
+
|
33
|
+
/*
|
34
|
+
* Set the loglevel (defined in biolib_error.h) for the simple logger
|
35
|
+
*/
|
36
|
+
|
37
|
+
void biolib_setloglevel(int level)
|
38
|
+
{
|
39
|
+
loglevel = level;
|
40
|
+
char buf[256];
|
41
|
+
sprintf(buf,"Setting log level to %d",level);
|
42
|
+
biolib_log(LOG_ALERT,buf);
|
43
|
+
}
|
44
|
+
|
45
|
+
/*
|
46
|
+
* Simple logger for biolib
|
47
|
+
*/
|
48
|
+
|
49
|
+
void biolib_log(int level, const char *s)
|
50
|
+
{
|
51
|
+
if (level <= loglevel) {
|
52
|
+
if (stdlog==NULL)
|
53
|
+
stdlog = stderr;
|
54
|
+
fprintf(stdlog,"biolib_log (level %d): ",level);
|
55
|
+
fprintf(stdlog,lognames[level]);
|
56
|
+
fprintf(stdlog,": ");
|
57
|
+
fprintf(stdlog,s);
|
58
|
+
fprintf(stdlog,"\n");
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
#ifdef __cplusplus
|
3
|
+
extern "C" {
|
4
|
+
#endif
|
5
|
+
|
6
|
+
#define LOG_EMERG 1
|
7
|
+
#define LOG_ALERT 2
|
8
|
+
#define LOG_CRIT 3
|
9
|
+
#define LOG_ERR 4
|
10
|
+
#define LOG_WARNING 5
|
11
|
+
#define LOG_NOTICE 6
|
12
|
+
#define LOG_INFO 7
|
13
|
+
#define LOG_DEBUG 8
|
14
|
+
|
15
|
+
void biolib_fatal(const char *e_template, ...);
|
16
|
+
void biolib_setloglevel(int level);
|
17
|
+
void biolib_log(int level, const char *s);
|
18
|
+
|
19
|
+
#ifdef __cplusplus
|
20
|
+
}
|
21
|
+
#endif
|
22
|
+
|
data/ext/src/mkrf_conf.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'mkrf'
|
2
2
|
Mkrf::Generator.new('libaffyext') do | mkrf |
|
3
3
|
mkrf.cflags << `R CMD config --cppflags`.strip
|
4
|
+
# disable these chechs for Ruby 1.9.3
|
4
5
|
mkrf.cflags.gsub!(/-Werror=declaration-after-statement/,'')
|
6
|
+
mkrf.cflags.gsub!(/-Werror=implicit-function-declaration/,'')
|
5
7
|
mkrf.ldshared << `R CMD config --ldflags`.strip
|
6
8
|
end
|
data/lib/bio/affyext.rb
CHANGED
@@ -3,6 +3,15 @@ module Bio
|
|
3
3
|
|
4
4
|
module Affy
|
5
5
|
|
6
|
+
class CDFProbeSet < FFI::Struct
|
7
|
+
layout :isQC, :int,
|
8
|
+
:pm_num, :int,
|
9
|
+
:mm_num, :int,
|
10
|
+
:pm, :pointer,
|
11
|
+
:mm, :pointer,
|
12
|
+
:name, [:uint8, 64]
|
13
|
+
end
|
14
|
+
|
6
15
|
module Ext
|
7
16
|
|
8
17
|
extend FFI::Library
|
@@ -12,10 +21,14 @@ module Bio
|
|
12
21
|
ffi_convention :stdcall
|
13
22
|
|
14
23
|
attach_function :has_affyext, [ :int ], :int
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
24
|
+
attach_function :BioLib_R_Init, [], :void
|
25
|
+
attach_function :BioLib_R_Close, [], :void
|
26
|
+
attach_function :open_cdffile, [ :string ], :pointer
|
27
|
+
attach_function :open_celfile, [ :string ], :pointer
|
28
|
+
attach_function :cel_intensity, [ :pointer, :int ], :double
|
29
|
+
attach_function :cel_num_intensities, [ :pointer ], :uint64
|
30
|
+
attach_function :cdf_num_probesets, [ :pointer ], :uint64
|
31
|
+
attach_function :cdf_probeset_info, [ :pointer, :int ], :pointer
|
19
32
|
end
|
20
33
|
|
21
34
|
end
|
data/spec/bio-affy_spec.rb
CHANGED
@@ -1,22 +1,44 @@
|
|
1
|
-
ROOT = File.dirname(__FILE__)
|
2
|
-
$: << File.join([ROOT, "
|
1
|
+
ROOT = File.dirname(File.dirname(__FILE__))
|
2
|
+
$: << File.join([ROOT, "lib"])
|
3
3
|
# ENV['LD_LIBRARY_PATH'] = File.join([ROOT, "..","lib"])
|
4
4
|
|
5
5
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
6
6
|
require 'bio-affy'
|
7
7
|
|
8
|
-
DATADIR =
|
9
|
-
CDF = DATADIR
|
10
|
-
|
8
|
+
DATADIR = File.join([ROOT,'test','data','affy'])
|
9
|
+
CDF = File.join(DATADIR,"MG_U74Av2.CDF")
|
10
|
+
CDF2 = File.join(DATADIR,"ATH1-121501.CDF")
|
11
|
+
CEL1 = File.join(DATADIR,"GSM103328.CEL.gz")
|
11
12
|
|
12
13
|
describe "BioAffy" do
|
13
14
|
it "should find the shared library" do
|
14
15
|
Bio::Affy::Ext.has_affyext(5).should == 60
|
15
16
|
end
|
16
17
|
it "should open a CDF file" do
|
17
|
-
|
18
|
+
Bio::Affy::Ext.BioLib_R_Init()
|
19
|
+
cdf = Bio::Affy::Ext.open_cdffile(CDF)
|
20
|
+
cdf.null?.should == false
|
21
|
+
num_probesets = Bio::Affy::Ext.cdf_num_probesets(cdf)
|
22
|
+
num_probesets.should == 12501
|
23
|
+
end
|
24
|
+
it "should open a CEL file" do
|
25
|
+
cel1 = Bio::Affy::Ext.open_celfile(CEL1)
|
26
|
+
num = Bio::Affy::Ext.cel_num_intensities(cel1)
|
27
|
+
num.should == 409600
|
28
|
+
end
|
29
|
+
it "should find the probe value for 1511" do
|
30
|
+
cel = Bio::Affy::Ext.open_celfile(CEL1)
|
31
|
+
probe_value = Bio::Affy::Ext.cel_intensity(cel,1510)
|
32
|
+
probe_value.should == 10850.8
|
33
|
+
end
|
34
|
+
it "should name the probes for 1511" do
|
35
|
+
cdf = Bio::Affy::Ext.open_cdffile(CDF)
|
36
|
+
# memptr = MemoryPointer.new :pointer
|
37
|
+
probeset_ptr = Bio::Affy::Ext.cdf_probeset_info(cdf,1510)
|
38
|
+
probeset = Bio::Affy::CDFProbeSet.new(probeset_ptr)
|
39
|
+
probeset[:isQC].should == 0
|
40
|
+
probeset[:pm_num].should == 16
|
41
|
+
probeset[:mm_num].should == 16
|
42
|
+
probeset[:name].to_ptr.read_string.should == "98910_at"
|
18
43
|
end
|
19
|
-
it "should open a CEL file"
|
20
|
-
it "should find the probe values"
|
21
|
-
it "should name the probes"
|
22
44
|
end
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-affy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Pjotr Prins
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &21542960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.7.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *21542960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &21541680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.12
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *21541680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &21557520 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *21557520
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rcov
|
49
|
-
requirement: &
|
49
|
+
requirement: &21557000 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *21557000
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: ffi
|
60
|
-
requirement: &
|
60
|
+
requirement: &21556440 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.0.11
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *21556440
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mkrf
|
71
|
-
requirement: &
|
71
|
+
requirement: &21555820 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.2.3
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *21555820
|
80
80
|
description: ! "Affymetrix microarray file format parser\n (CEL/CDF) for Ruby. FFI
|
81
81
|
binding to Biolib port of R/Affyio by Benjamin Milo Bolstad"
|
82
82
|
email: pjotr.public01@thebird.nl
|
@@ -102,63 +102,40 @@ files:
|
|
102
102
|
- ext/HISTORY
|
103
103
|
- ext/LICENSE
|
104
104
|
- ext/NAMESPACE
|
105
|
-
- ext/R/check.cdf.type.R
|
106
|
-
- ext/R/read.cdffile.list.R
|
107
|
-
- ext/R/read.celfile.R
|
108
|
-
- ext/R/read.celfile.header.R
|
109
|
-
- ext/R/read.probematrices.R
|
110
105
|
- ext/README_BIOLIB
|
111
106
|
- ext/aclocal.m4
|
112
107
|
- ext/configure
|
113
108
|
- ext/configure.in
|
114
|
-
- ext/man/check.cdf.type.Rd
|
115
|
-
- ext/man/read.cdffile.list.Rd
|
116
|
-
- ext/man/read.celfile.Rd
|
117
|
-
- ext/man/read.celfile.header.Rd
|
118
|
-
- ext/man/read.celfile.probeintensity.matrices.Rd
|
119
109
|
- ext/src/CMakeLists.txt
|
120
110
|
- ext/src/Makevars.in
|
121
111
|
- ext/src/Makevars.win
|
122
112
|
- ext/src/Rakefile
|
113
|
+
- ext/src/biolib_R_map.c
|
114
|
+
- ext/src/biolib_R_map.h
|
123
115
|
- ext/src/biolib_affyio.c
|
124
116
|
- ext/src/biolib_affyio.h
|
125
|
-
- ext/src/
|
117
|
+
- ext/src/biolib_error.c
|
118
|
+
- ext/src/biolib_error.h
|
126
119
|
- ext/src/fread_functions.c
|
127
120
|
- ext/src/fread_functions.h
|
128
|
-
- ext/src/fread_functions.o
|
129
|
-
- ext/src/libaffyext.so
|
130
|
-
- ext/src/mkrf.log
|
131
121
|
- ext/src/mkrf_conf.rb
|
132
122
|
- ext/src/read_abatch.c
|
133
123
|
- ext/src/read_abatch.h
|
134
|
-
- ext/src/read_abatch.o
|
135
124
|
- ext/src/read_bpmap.c
|
136
|
-
- ext/src/read_bpmap.o
|
137
125
|
- ext/src/read_cdf.h
|
138
126
|
- ext/src/read_cdf_xda.c
|
139
|
-
- ext/src/read_cdf_xda.o
|
140
127
|
- ext/src/read_cdffile2.c
|
141
|
-
- ext/src/read_cdffile2.o
|
142
128
|
- ext/src/read_celfile_generic.c
|
143
129
|
- ext/src/read_celfile_generic.h
|
144
|
-
- ext/src/read_celfile_generic.o
|
145
130
|
- ext/src/read_clf.c
|
146
|
-
- ext/src/read_clf.o
|
147
131
|
- ext/src/read_generic.c
|
148
132
|
- ext/src/read_generic.h
|
149
|
-
- ext/src/read_generic.o
|
150
133
|
- ext/src/read_pgf.c
|
151
|
-
- ext/src/read_pgf.o
|
152
134
|
- lib/bio-affy.rb
|
153
135
|
- lib/bio/affy.rb
|
154
136
|
- lib/bio/affyext.rb
|
155
|
-
- lib/bio/libaffyext.so
|
156
137
|
- spec/bio-affy_spec.rb
|
157
138
|
- spec/spec_helper.rb
|
158
|
-
- test/data/affy/GSM103328.CEL.gz
|
159
|
-
- test/data/affy/GSM103329.CEL.gz
|
160
|
-
- test/data/affy/GSM103330.CEL.gz
|
161
|
-
- test/data/affy/MG_U74Av2.CDF.gz
|
162
139
|
homepage: http://github.com/pjotrp/bioruby-affy
|
163
140
|
licenses:
|
164
141
|
- MIT
|
@@ -174,13 +151,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
151
|
version: '0'
|
175
152
|
segments:
|
176
153
|
- 0
|
177
|
-
hash:
|
154
|
+
hash: -420869817303685437
|
178
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
156
|
none: false
|
180
157
|
requirements:
|
181
|
-
- - ! '
|
158
|
+
- - ! '>='
|
182
159
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
160
|
+
version: '0'
|
184
161
|
requirements: []
|
185
162
|
rubyforge_project: nowarning
|
186
163
|
rubygems_version: 1.8.10
|
data/ext/R/check.cdf.type.R
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### File: check.cdf.type.R
|
3
|
-
###
|
4
|
-
### Aim: return a string giving the file format. Either text, xda or unknown
|
5
|
-
### in the case that file format is not known.
|
6
|
-
###
|
7
|
-
|
8
|
-
|
9
|
-
check.cdf.type <- function(filename){
|
10
|
-
|
11
|
-
if (.Call("CheckCDFtext",filename,PACKAGE="affyio")){
|
12
|
-
return("text")
|
13
|
-
} else if (.Call("CheckCDFXDA",filename,PACKAGE="affyio")){
|
14
|
-
return("xda")
|
15
|
-
} else {
|
16
|
-
return("unknown")
|
17
|
-
}
|
18
|
-
}
|
data/ext/R/read.cdffile.list.R
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### File: read.cdffile.list.R
|
3
|
-
###
|
4
|
-
### Aim: reads full CDF file into R list structure.
|
5
|
-
###
|
6
|
-
### History
|
7
|
-
### Dec 1, 2005 - Initial version
|
8
|
-
###
|
9
|
-
|
10
|
-
|
11
|
-
read.cdffile.list <- function (filename, cdf.path = getwd()){
|
12
|
-
|
13
|
-
cdf.type <- check.cdf.type(file.path(path.expand(cdf.path),filename))
|
14
|
-
if (cdf.type == "xda"){
|
15
|
-
.Call("ReadCDFFileIntoRList", file.path(path.expand(cdf.path),
|
16
|
-
filename), TRUE, PACKAGE = "affyio")
|
17
|
-
} else if (cdf.type =="text"){
|
18
|
-
.Call("ReadtextCDFFileIntoRList", file.path(path.expand(cdf.path),
|
19
|
-
filename), TRUE, PACKAGE = "affyio")
|
20
|
-
} else {
|
21
|
-
stop(paste("File format for",filename,"not recognized."))
|
22
|
-
}
|
23
|
-
}
|
data/ext/R/read.celfile.R
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### File: read.celfile.R
|
3
|
-
###
|
4
|
-
### Aim: read entire contents of a single given specified CEL file into
|
5
|
-
### an R data structure.
|
6
|
-
###
|
7
|
-
|
8
|
-
|
9
|
-
read.celfile <- function(filename,intensity.means.only=FALSE){
|
10
|
-
return(.Call("R_read_cel_file",filename,intensity.means.only,PACKAGE="affyio"))
|
11
|
-
}
|
data/ext/R/read.celfile.header.R
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### File: read.celfile.header.R
|
3
|
-
###
|
4
|
-
### Aim: read header contents of a given specified CEL file into
|
5
|
-
### an R data structure.
|
6
|
-
###
|
7
|
-
|
8
|
-
|
9
|
-
read.celfile.header <- function(filename,info=c("basic","full"),verbose=FALSE){
|
10
|
-
compress <- FALSE
|
11
|
-
|
12
|
-
info <- match.arg(info)
|
13
|
-
|
14
|
-
if (info == "basic"){
|
15
|
-
if (verbose)
|
16
|
-
cat("Reading", filename, "to get header information.\n")
|
17
|
-
headdetails <- .Call("ReadHeader", filename, PACKAGE="affyio")
|
18
|
-
names(headdetails) <- c("cdfName","CEL dimensions")
|
19
|
-
} else {
|
20
|
-
if (verbose)
|
21
|
-
cat("Reading", filename, "to get full header information.\n")
|
22
|
-
### full returns greater detailed information from the header. Exact details differ depending on the file format.
|
23
|
-
headdetails <- try(.Call("ReadHeaderDetailed", filename, PACKAGE="affyio"))
|
24
|
-
if (is(headdetails, "try-error"))
|
25
|
-
stop("Failed to get full header information for ", filename)
|
26
|
-
names(headdetails) <- c("cdfName","CEL dimensions","GridCornerUL","GridCornerUR","GridCornerLR","GridCornerLL","DatHeader","Algorithm","AlgorithmParameters","ScanDate")
|
27
|
-
|
28
|
-
if (nchar(headdetails$ScanDate) == 0){
|
29
|
-
# try to extract it from the DatHeader
|
30
|
-
DatHeaderSplit <- strsplit(headdetails$DatHeader," ")
|
31
|
-
Which.Date <- grep("[0-9]*/[0-9]*/[0-9]*",DatHeaderSplit[[1]])
|
32
|
-
Which.Time <- grep("[0-9]*:[0-9]*:[0-9]*",DatHeaderSplit[[1]])
|
33
|
-
headdetails$ScanDate <- paste(DatHeaderSplit[[1]][Which.Date],DatHeaderSplit[[1]][Which.Time])
|
34
|
-
}
|
35
|
-
}
|
36
|
-
return(headdetails)
|
37
|
-
}
|
data/ext/R/read.probematrices.R
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
###
|
2
|
-
### File: read.probematrices.R
|
3
|
-
###
|
4
|
-
### Aim: read in PM or MM or both probe intensities into a list of
|
5
|
-
### of matrices where the probes for particular probesets are
|
6
|
-
### contiguous in the returned matrix
|
7
|
-
### Each Matrix has probes in rows and arrays in columns
|
8
|
-
###
|
9
|
-
### Copyright (C) 2005 B. M. Bolstad
|
10
|
-
###
|
11
|
-
### History
|
12
|
-
### Nov 30, 2005 - Initial version
|
13
|
-
###
|
14
|
-
|
15
|
-
|
16
|
-
read.celfile.probeintensity.matrices <- function(filenames, cdfInfo, rm.mask=FALSE, rm.outliers=FALSE, rm.extra=FALSE, verbose=FALSE, which= c("pm","mm","both")){
|
17
|
-
which <- match.arg(which)
|
18
|
-
|
19
|
-
filenames <- as.character(filenames)
|
20
|
-
if (verbose)
|
21
|
-
cat("Reading", filenames[1], "to get header information.\n")
|
22
|
-
headdetails <- .Call("ReadHeader", filenames[1], PACKAGE="affyio")
|
23
|
-
dim.intensity <- headdetails[[2]]
|
24
|
-
ref.cdfName <- headdetails[[1]]
|
25
|
-
|
26
|
-
.Call("read_probeintensities", filenames,
|
27
|
-
rm.mask, rm.outliers, rm.extra, ref.cdfName,
|
28
|
-
dim.intensity, verbose, cdfInfo,which, PACKAGE="affyio")
|
29
|
-
}
|
data/ext/man/check.cdf.type.Rd
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
\name{check.cdf.type}
|
2
|
-
\alias{check.cdf.type}
|
3
|
-
\title{CDF file format function}
|
4
|
-
\description{This function returns a text string giving the file format
|
5
|
-
for the supplied filename
|
6
|
-
}
|
7
|
-
\usage{check.cdf.type(filename)
|
8
|
-
}
|
9
|
-
\arguments{
|
10
|
-
\item{filename}{fullpath to a cdf file}
|
11
|
-
}
|
12
|
-
\value{Returns a string which is currently one of:
|
13
|
-
|
14
|
-
\item{text}{the cdf file is of the text format}
|
15
|
-
\item{xda}{the cdf file is of the binary format used in GCOS}
|
16
|
-
\item{unknown}{the parser can not handle this format or does not
|
17
|
-
recognize this file as a CDF file}
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
\author{B. M. Bolstad <bmb@bmbolstad.com>}
|
22
|
-
\keyword{IO}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
\name{read.cdffile.list}
|
2
|
-
\alias{read.cdffile.list}
|
3
|
-
\title{Read CDF file into an R list}
|
4
|
-
\description{This function reads the entire contents of a cdf file into
|
5
|
-
an R list structure
|
6
|
-
}
|
7
|
-
\usage{read.cdffile.list(filename, cdf.path = getwd())
|
8
|
-
}
|
9
|
-
\arguments{
|
10
|
-
\item{filename}{name of CDF file}
|
11
|
-
\item{cdf.path}{path to cdf file}
|
12
|
-
}
|
13
|
-
\value{returns a \code{list} structure. The exact contents may vary
|
14
|
-
depending on the file format of the cdf file (see \code{\link{check.cdf.type}})
|
15
|
-
}
|
16
|
-
\details{
|
17
|
-
Note that this function can be very memory intensive with large CDF files.
|
18
|
-
}
|
19
|
-
\author{B. M. Bolstad <bmb@bmbolstad.com>}
|
20
|
-
\keyword{IO}
|
data/ext/man/read.celfile.Rd
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
\name{read.celfile}
|
2
|
-
\alias{read.celfile}
|
3
|
-
\title{Read a CEL file into an R list}
|
4
|
-
\description{This function reads the entire contents of a CEL file into
|
5
|
-
an R list structure
|
6
|
-
}
|
7
|
-
\usage{read.celfile(filename,intensity.means.only=FALSE)
|
8
|
-
}
|
9
|
-
\arguments{
|
10
|
-
\item{filename}{name of CEL file}
|
11
|
-
\item{intensity.means.only}{If \code{TRUE} then read on only the MEAN section in INTENSITY}
|
12
|
-
}
|
13
|
-
\value{returns a \code{list} structure. The exact contents may vary
|
14
|
-
depending on the file format of the CEL file
|
15
|
-
}
|
16
|
-
\details{
|
17
|
-
The list has four main items. HEADER, INTENSITY, MASKS, OUTLIERS. Note
|
18
|
-
that INTENSITY is a list of three vectors MEAN, STDEV, NPIXELS. HEADER
|
19
|
-
is also a list. Both of MASKS and OUTLIERS are matrices.
|
20
|
-
|
21
|
-
}
|
22
|
-
\author{B. M. Bolstad <bmb@bmbolstad.com>}
|
23
|
-
\keyword{IO}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
\name{read.celfile.header}
|
2
|
-
\alias{read.celfile.header}
|
3
|
-
\title{Read header information from cel file}
|
4
|
-
\description{
|
5
|
-
This function reads some of the header information (appears before probe
|
6
|
-
intensity data) from the supplied cel file.
|
7
|
-
}
|
8
|
-
\usage{read.celfile.header(filename,info=c("basic","full"),verbose=FALSE)
|
9
|
-
}
|
10
|
-
\arguments{
|
11
|
-
\item{filename}{name of CEL file. May be fully pathed}
|
12
|
-
\item{info}{A string. \code{basic} returns the dimensions of the chip
|
13
|
-
and the name of the CDF file used when the CEL file was
|
14
|
-
produced. \code{full} returns more information in greater detail.}
|
15
|
-
\item{verbose}{a \code{\link{logical}}. When true the parsing routine
|
16
|
-
prints more information, typically useful for debugging.}
|
17
|
-
}
|
18
|
-
\value{
|
19
|
-
A \code{list} data structure.
|
20
|
-
}
|
21
|
-
\author{B. M. Bolstad <bmb@bmbolstad.com>}
|
22
|
-
\keyword{IO}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
\name{read.celfile.probeintensity.matrices}
|
2
|
-
\alias{read.celfile.probeintensity.matrices}
|
3
|
-
\title{Read PM or MM from CEL file into matrices}
|
4
|
-
\description{This function reads PM, MM or both types of intensities
|
5
|
-
into matrices. These matrices have all the probes for a probeset in
|
6
|
-
adjacent rows
|
7
|
-
}
|
8
|
-
\usage{read.celfile.probeintensity.matrices(filenames, cdfInfo, rm.mask=FALSE, rm.outliers=FALSE, rm.extra=FALSE, verbose=FALSE, which= c("pm","mm","both"))
|
9
|
-
}
|
10
|
-
\arguments{
|
11
|
-
\item{filenames}{a character vector of filenames}
|
12
|
-
\item{cdfInfo}{a list with items giving PM and MM locations for
|
13
|
-
desired probesets. In same structure as returned by \code{\link[makecdfenv]{make.cdf.package}}}
|
14
|
-
\item{rm.mask}{a \code{\link{logical}}. Return these probes as NA if
|
15
|
-
there are in the [MASK] section of the CEL file}
|
16
|
-
\item{rm.outliers}{a \code{\link{logical}}. Return these probes as NA if
|
17
|
-
there are in the [OUTLIERS] section of the CEL file}.
|
18
|
-
\item{rm.extra}{a \code{\link{logical}}. Return these probes as NA if
|
19
|
-
there are in the [OUTLIERS] section of the CEL file}.
|
20
|
-
\item{verbose}{a \code{\link{logical}}. When true the parsing routine
|
21
|
-
prints more information, typically useful for debugging.}
|
22
|
-
|
23
|
-
\item{which}{a string specifing which probe type to return}
|
24
|
-
|
25
|
-
}
|
26
|
-
\value{returns a \code{\link{list}} of \code{\link{matrix}} items. One
|
27
|
-
matrix contains PM probe intensities, with probes in rows and arrays
|
28
|
-
in columns
|
29
|
-
}
|
30
|
-
\author{B. M. Bolstad <bmb@bmbolstad.com>}
|
31
|
-
\keyword{IO}
|
data/ext/src/biolib_affyio.o
DELETED
Binary file
|
data/ext/src/fread_functions.o
DELETED
Binary file
|
data/ext/src/libaffyext.so
DELETED
Binary file
|
data/ext/src/mkrf.log
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Logfile created on 2011-12-03 11:33:02 +0100 by logger.rb/31641
|
2
|
-
I, [2011-12-03T11:33:02.903130 #3787] INFO -- : Rakefile written
|
3
|
-
I, [2011-12-03T11:34:13.165687 #3885] INFO -- : Rakefile written
|
4
|
-
I, [2011-12-03T11:34:52.961635 #3934] INFO -- : Rakefile written
|
5
|
-
I, [2011-12-03T11:35:50.664883 #3983] INFO -- : Rakefile written
|
6
|
-
I, [2011-12-03T11:36:17.924126 #4032] INFO -- : Rakefile written
|
7
|
-
I, [2011-12-03T11:37:44.903101 #4091] INFO -- : Rakefile written
|
8
|
-
I, [2011-12-03T11:37:56.891896 #4140] INFO -- : Rakefile written
|
9
|
-
I, [2011-12-03T11:42:01.780667 #4246] INFO -- : Rakefile written
|
10
|
-
I, [2011-12-03T11:43:22.916832 #4374] INFO -- : Rakefile written
|
11
|
-
I, [2011-12-03T12:17:14.892390 #24167] INFO -- : Rakefile written
|
data/ext/src/read_abatch.o
DELETED
Binary file
|
data/ext/src/read_bpmap.o
DELETED
Binary file
|
data/ext/src/read_cdf_xda.o
DELETED
Binary file
|
data/ext/src/read_cdffile2.o
DELETED
Binary file
|
Binary file
|
data/ext/src/read_clf.o
DELETED
Binary file
|
data/ext/src/read_generic.o
DELETED
Binary file
|
data/ext/src/read_pgf.o
DELETED
Binary file
|
data/lib/bio/libaffyext.so
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|