Movatterモバイル変換


[0]ホーム

URL:


R-CMD-checkCRAN status

Racmacs

The Racmacs package provides a toolkit for making antigenic maps fromassay data such as HI assays, as described inSmith etal. 2004.

For an introduction to antigenic cartography, see the articleanintroduction to antigenic cartography. For a general introduction tousing Racmacs to make an antigenic map from titer data see the articlemakingan antigenic map from titer data. For documentation of the functionsavailable see thereferencessection.

Installation instructions

Installing the latest CRANrelease

Pre-compiled version of Racmacs can now be installed directly fromCRAN with:

install.packages("Racmacs")

Installing the latestdevelopment release

The latest developmental release of Racmacs can be installed fromgithub but may require some setting up of your compiler toolchain asdescribed below.

Install the devtools package

If not already installed, install thedevtools package,this provides functions to help with installation.

install.packages("devtools")

Install Racmacs

Now you can install Racmacs directly from the latest developmentsource code. In future pre-built binary versions will also beincluded.

# To build from github sourcedevtools::install_github("acorg/Racmacs")

Problems compiling on MacOS

When installing Racmacs on a mac os, compilation will most likelyfail under the default setup since the necessary libraries that arelinked to cannot be found. The recommended solution, which should bothsolve this problem and speed up the code, is for mac users to follow theinstructions below for setting up your environment to use the gcc andassociated fortran compiler.

Building Racmacs torun code in parallel

Racmacs usesOpenMP instructionsto specify when code can be run in parallel to increase performance. Theresulting speed-up can be significant, but you need to check whether thecompiler you use supports OpenMP.

The default compiler on mac systems for example isclangwhich does not support OpenMP and will fail anyway by default because itdoes not include a fortran compiler by default.

Installing gcc and a fortran compiler
The solution for both OpenMP support and provision of a fortran compileron a mac system is to follow the guidance from theR project page for mac andinstall the official GNU Fortran binaries from F.X.Coudert foundhere.

Note that you have to install the correct version according to yourhardware e.g. an intel or M1 mac, and for your correct OS. Also if youhave an M1 mac, make sure that you have installed the M1 version of theR installer and not the intel one, otherwise loading the package willfail since R will have been compiled for an intel system and Racmacs foran M1 system.

The easiest method of installation is through finding the appropriate.dmg file which will contain an automatic installer for you rather thanthe .tar.xz source versions where you will have to deal withinstallation yourself.

Changing the default compiler in R
Once you have installed your fortran compiler and the packaged gcccompiler you need to change the default compiler in R. To do this youspecify it in your localMakevars file. This exists in the.R folder in your home folder,i.e. ~/.R/Makevars. It is possible you will have to createthe.R folder and theMakevars text file.

Once done, add the following lines to theMakevars fileand update the paths to the appropriate path for each of the respectiveexecutables, for example:

CC=/usr/local/gfortran/bin/gccCXX=/usr/local/gfortran/bin/g++CXX1X=/usr/local/gfortran/bin/g++CXX11=/usr/local/gfortran/bin/g++SHLIB_CXXLD=/usr/local/gfortran/bin/g++FC=/usr/local/gfortran/bin/gfortranF77=/usr/local/gfortran/bin/gfortranMAKE=make -j8SHLIB_OPENMP_CFLAGS=-fopenmpSHLIB_OPENMP_CXXFLAGS=-fopenmpSHLIB_OPENMP_FCFLAGS=-fopenmpSHLIB_OPENMP_FFLAGS=-fopenmp

Now when you try and install and build the package from source thingsshould be setup to use g++, with support for OpenMP parallelization nowincluded.

Finally, to check whether your version of Racmacs has been compiledto work in parallel or not you can run the commandRacmacs:::parallel_mode(), which should returnTRUE. It’s not a problem if it returnsFALSE,optimization code just won’t run in parallel so will take a bitlonger.


[8]ページ先頭

©2009-2025 Movatter.jp