Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Ruby mapping for R/QTL

  • Loading branch information...
commit b35599fc80b7614b486776571d9b6b4d78159871 1 parent 0ce3375
@pjotrp authored
View
2  CMakeLists.txt
@@ -100,7 +100,7 @@ if (RQTL_LIB)
set(BLD_AFFYIO FALSE)
set(BLD_EXAMPLE FALSE)
set(BLD_BIOLIB FALSE)
-endif (STADEN_LIB)
+endif (RQTL_LIB)
message(" Biolib libraries")
message(STATUS "Install Affyio ${BLD_AFFYIO}")
View
8 cmake_modules/FindBioLibModule.cmake
@@ -12,8 +12,14 @@
# MODULE_SOURCE_PATH
# MODULE_LIBRARY
+SET (MODULE_NAME ${M_NAME})
+
+IF(M_VERSION)
+ SET (MODULE_NAME ${M_NAME}-${M_VERSION})
+ENDIF(M_VERSION)
+
# ---- Find the shared library include and lib path
-SET (MODULE_SOURCE_PATH ${BIOLIB_CLIBS_PATH}/${M_NAME}-${M_VERSION})
+SET (MODULE_SOURCE_PATH ${BIOLIB_CLIBS_PATH}/${MODULE_NAME})
message("MODULE_SOURCE_PATH=${MODULE_SOURCE_PATH}")
View
3  configure
@@ -22,6 +22,9 @@ if [ ! -d ./src ]; then
fi
language=$1
+if [ -z $language ]; then
+ language='--with-perl'
+fi
case $language in
'--help')
View
2  src/extra/ruby/test/test_rqtl.rb
@@ -3,6 +3,8 @@
# Run with ./runner.rb
# Documentation with rd2 -r rd/rd2html-lib *.rb
+$: << '../../../mappings/swig/ruby/rqtl/'
+
=begin
Here we load the R/QTL Listeria dataset (from a CSV) and verify the
View
6 src/mappings/swig/rqtl.i
@@ -0,0 +1,6 @@
+
+%{
+ #include <scanone_mr.h>
+%}
+
+%include <scanone_mr.h>
View
4 src/mappings/swig/ruby/CMakeLists.txt
@@ -9,3 +9,7 @@ endif (BLD_AFFYIO)
if (BLD_STADEN)
add_subdirectory (staden_io_lib)
endif (BLD_STADEN)
+
+if (BLD_RQTL)
+ add_subdirectory (rqtl)
+endif (BLD_RQTL)
View
29 src/mappings/swig/ruby/rqtl/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Make biolib_ruby_rqtl module
+
+cmake_minimum_required(VERSION 2.6)
+ENABLE_TESTING()
+
+SET (M_NAME rqtl)
+# SET (M_VERSION 1.11.6)
+SET (INTERFACE ruby_${M_NAME}.i)
+
+IF(NOT BUILD_LIBS)
+ SET (CMAKE_MODULE_PATH ../../../../../cmake_modules)
+ENDIF(NOT BUILD_LIBS)
+
+SET (USE_ZLIB TRUE)
+SET (USE_RLIB TRUE)
+# SET (USE_INCLUDEPATH io_lib)
+
+INCLUDE(CMakeBackwardCompatibilityC)
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY biolib)
+
+FIND_PACKAGE(BioLibRuby)
+
+ADD_TEST(TestRubyRQTLLib ${RUBY_EXECUTABLE} -I../${M_NAME} ./../test/test_${M_NAME}.rb)
+
+INSTALL(TARGETS ${M_MODULE}
+ LIBRARY DESTINATION ${RUBY_LIB_PATH}/biolib
+)
+
+
View
3  src/mappings/swig/ruby/rqtl/ruby_rqtl.i
@@ -0,0 +1,3 @@
+%module rqtl
+
+%include ../../rqtl.i
View
67 src/mappings/swig/ruby/test/test_rqtl.rb
@@ -1,74 +1,9 @@
-$: << '../../../../biolib/ruby'
-# require 'biolib/rqtl'
-require 'qtl/qtl'
-TESTDATADIR = '../../../../test/data/qtl'
-LISTERIAFN = TESTDATADIR+'/listeria.csv'
-
-require 'test/unit/testcase'
-
-class Test_Biolib_RQtl < Test::Unit::TestCase
-
- def setup
- @qtl = QTL.new(LISTERIAFN)
- end
-
- def test_info
- assert_equal('F2 intercross',d.type)
- assert_equal(120,d.individuals.size)
- assert_equal(120,d.nind)
- assert_equal(2,d.nphe)
- assert_equal(133,d.ntotmar)
- assert_equal(20,d.nchr)
- assert_equal({'1'=>13,'2'=>6},d.nmar)
- end
-
- def test_markers
- d = @qtl.data
- assert_equal('D10M44',d.marker(0).name)
- assert_equal('2',d.marker(14).chromosome)
- assert_equal(133,d.markers.size)
- end
-
- def test_chromosomes
- d = @qtl.data
- assert_equal(20,d.chromosomes.size)
- assert_equal(19,d.chromosomes.autosomes.size)
- assert_equal('X',d.chromosomes.x.name)
- assert_equal(13,d.chromosomes[1].markers.size)
- end
-
- def test_phenotypecolumns
- d = @qtl.data
- assert_equal('T264',d.phenotypecolumn(0).name)
- assert_equal(2,d.phenotypecolumns.size)
- end
-
- def test_phenotype
- d = @qtl.data
- assert_equal([96.7, 100],d.perc_phenotyped)
- end
-
- def test_genotype
- d = @qtl.data
- assert_equal(88.5,d.perc_genotyped)
- end
-
-end
+require 'biolib/rqtl'
if $0 == __FILE__
- fn = LISTERIAFN
-
- raise 'File not found error' if !File.exist?(fn)
-
- qtl = QTL.new(fn)
- # These are some simple tests to see if the build system worked...
- raise 'Read test failed' if qtl.data.phenotype(0) != 118.317
- raise 'Read test failed' if qtl.data.marker(0).name != 'D10M44'
- raise 'Read test failed' if qtl.data.marker(13).chromosome != 2
-
print "Success!"
exit 0
end
Please sign in to comment.
Something went wrong with that request. Please try again.