Module: ViralSeq::R
- Defined in:
- lib/viral_seq/R.rb
Class Method Summary collapse
-
.check_R ⇒ Object
check if R is installed.
-
.check_R_packages ⇒ Object
check if required R packages is installed.
-
.get_sdrm_rscript ⇒ Object
read sdrm rscript as a string.
Class Method Details
.check_R ⇒ Object
check if R is installed. if R is installed, return the version number of R.
6 7 8 9 10 11 12 13 |
# File 'lib/viral_seq/R.rb', line 6 def self.check_R begin r_version = `R --version`.split("\n")[0] rescue Errno::ENOENT abort '"R" is not installed. Install R at https://www.r-project.org/' + "\n`tcs_sdrm` pipeline aborted." end end |
.check_R_packages ⇒ Object
check if required R packages is installed.
16 17 18 19 20 21 22 |
# File 'lib/viral_seq/R.rb', line 16 def self.check_R_packages if system "Rscript #{File.join( ViralSeq.root, "viral_seq", "util", "check_env.r")}" return 0 else raise "Non-zero exit code. Error happens when checking required R packages." end end |