Skip to content

Commit

Permalink
installation of limma for higher R versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mirimia committed Jan 23, 2025
1 parent 7ab9196 commit fc8cf74
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions bin/CompareEXPR.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
### General script to get differentially spliced events based on dPSI differences

## LOG:
Expand Down Expand Up @@ -235,9 +235,30 @@ sub time {
close TEMP;
close GE_2;

### added for installation
my $install_method;

if (defined $install_limma){
my $Rcall = `R --version`;
my $Rversion;
if (defined $Rcall){
($Rversion) = $Rcall =~ /R version (.+?\..+?)\..+? /;
}

if ($Rversion !~ /\d/){print "R version not identified: $Rversion\n";}
elsif ($Rversion >= 3.5){
print "R version $Rversion identified\n";
$install_method = "if (!require(\"BiocManager\", quietly = TRUE))\n install.packages(\"BiocManager\", repos = \"http://cran.us.r-project.org\")\n".
" BiocManager::install(\"limma\")\n";
}
else {
print "R version $Rversion identified\n";
$install_method = "source(\"https://bioconductor.org/biocLite.R\")\n biocLite(\"limma\")\n";
}
}

open (Temp_R, ">$input_path/temp.R");
print Temp_R "source(\"https://bioconductor.org/biocLite.R\")
biocLite(\"limma\")\n" if (defined $install_limma);
print Temp_R "$install_method" if (defined $install_limma);

print Temp_R "
library(limma)
Expand Down

0 comments on commit fc8cf74

Please sign in to comment.