Skip to content

Commit c3e4882

Browse files
committed
Finishes the ALStructure R script
1 parent ed01ac4 commit c3e4882

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

structure_threader/wrappers/alstructure_wrapper.R

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,35 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with structure_threader. If not, see <http://www.gnu.org/licenses/>.
1616

17+
## Default repo
18+
local({r <- getOption("repos")
19+
r["CRAN"] <- "http://cran.r-project.org"
20+
options(repos=r)
21+
})
22+
1723
ll = Sys.getenv()[ grep("R_LIBS_USER", names(Sys.getenv())) ]
18-
local_lib = gsub("^.*\t", "", ll)
24+
local_lib = gsub(".*~", path.expand('~'), as.character(ll), perl=T)
25+
26+
if (dir.exists(local_lib) == FALSE) {
27+
dir.create(local_lib, showWarnings = TRUE, recursive = TRUE)
28+
}
29+
30+
.libPaths(c(local_lib))
1931

2032
if(!require("alstructure")){
2133
if(!require("devtools")){
22-
install.packages("devtools", lib=.libPaths()[1])
34+
install.packages("devtools")
2335
}
2436
library("devtools")
25-
install_github("storeylab/alstructure", build_vignettes=FALSE, ref="e355411", lib=.libPaths()[1])
37+
install_github("storeylab/alstructure", build_vignettes=FALSE, ref="e355411")
2638
library(alstructure)
2739
}
2840

2941
if(!require(lfa)){
3042
if (!requireNamespace("BiocManager", quietly = TRUE))
31-
install.packages("BiocManager", lib=.libPaths()[1])
43+
install.packages("BiocManager")
3244

33-
BiocManager::install("lfa", lib=.libPaths()[1])
45+
BiocManager::install("lfa")
3446
library(lfa)
3547
}
3648

0 commit comments

Comments
 (0)