Unverified Commit f2a3d82b authored by Konrad Stawiski's avatar Konrad Stawiski Committed by GitHub

Merge branch 'master' into dev

parents c3beac6f c321f84c
......@@ -5,7 +5,7 @@ ENV PUBLIC=0
ENV DEBIAN_FRONTEND noninteractive
ENV CRAN_URL https://cloud.r-project.org/
ENV TZ=Europe/Warsaw
RUN chsh -s /bin/bash root && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt update && apt dist-upgrade -y && apt-get install -y mc apt-transport-https libfontconfig1-dev screen build-essential libxml2-dev xorg ca-certificates cmake curl git libatlas-base-dev libcurl4-openssl-dev libjemalloc-dev liblapack-dev libopenblas-dev libopencv-dev libzmq3-dev software-properties-common sudo unzip wget && add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt update && apt install -y build-essential libmagick++-dev libbz2-dev libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev fort77 xorg-dev liblzma-dev libblas-dev gfortran gcc-multilib gobjc++ libreadline-dev && apt install -y pandoc texinfo texlive-fonts-extra texlive libcairo2-dev freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev libopenblas-dev liblapack-dev libopencv-dev build-essential git gcc cmake libcairo2-dev libxml2-dev texlive-full texlive-xetex ttf-mscorefonts-installer build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev default-jre default-jdk && echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
RUN chsh -s /bin/bash root && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt update && apt dist-upgrade -y && apt-get install -y mc r-cran-rgl apt-transport-https libfontconfig1-dev screen build-essential libxml2-dev xorg ca-certificates cmake curl git libatlas-base-dev libcurl4-openssl-dev libjemalloc-dev liblapack-dev libopenblas-dev libopencv-dev libzmq3-dev software-properties-common sudo unzip wget && add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt update && apt install -y build-essential libmagick++-dev libbz2-dev libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev fort77 xorg-dev liblzma-dev libblas-dev gfortran gcc-multilib gobjc++ libreadline-dev && apt install -y pandoc texinfo texlive-fonts-extra texlive libcairo2-dev freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev libopenblas-dev liblapack-dev libopencv-dev build-essential git gcc cmake libcairo2-dev libxml2-dev texlive-full texlive-xetex ttf-mscorefonts-installer build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev default-jre default-jdk && echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# Install Anaconda
......@@ -18,8 +18,8 @@ RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
# Keras, tensorflow, jupyter
RUN apt-get update --fix-missing && \
apt-get install -y apt-utils sshfs libxml2-dev cifs-utils libffi-dev libssl-dev libx11-dev mesa-common-dev libfreetype6-dev libglu1-mesa-dev wget bzip2 ca-certificates build-essential cmake git unzip pkg-config libopenblas-dev liblapack-dev libhdf5-serial-dev libglib2.0-0 libxext6 libsm6 libxrender1 gfortran-7 gcc-7 && apt-get clean && \
conda update --all && conda install --channel "conda-forge" --channel "anaconda" --channel "r" tensorflow-mkl gxx_linux-64 gcc_linux-64 keras jupyter fontconfig jupytext numpy pandas r-base=4.0.2 r-pkgdown r-rlang r-biocmanager r-brio r-magick r-devtools r-rgl r-rjava r-mnormt r-purrrogress r-xml libxml2 pandoc r-rjava libmagic opencv pkgconfig gfortran_linux-64 && echo "options(repos=structure(c(CRAN='http://cran.r-project.org')))" >> ~/.Rprofile
apt-get install -y apt-utils sshfs libxml2-dev cifs-utils libffi-dev libssl-dev libftgl2 libcgal-dev libglu1-mesa-dev libglu1-mesa-dev libx11-dev libfreetype6-dev libx11-dev mesa-common-dev libfreetype6-dev libglu1-mesa-dev wget bzip2 ca-certificates build-essential cmake git unzip pkg-config libopenblas-dev liblapack-dev libhdf5-serial-dev libglib2.0-0 libxext6 libsm6 libxrender1 gfortran-7 gcc-7 && apt-get clean && \
conda update --all && conda install --channel "conda-forge" --channel "anaconda" --channel "r" tensorflow-mkl gxx_linux-64 gcc_linux-64 keras jupyter fontconfig jupytext numpy pandas r-base r-pkgdown r-rlang r-biocmanager r-brio r-magick r-devtools r-rgl r-rjava r-mnormt r-purrrogress r-xml libxml2 pandoc r-rjava libmagic opencv pkgconfig gfortran_linux-64 && echo "options(repos=structure(c(CRAN='http://cran.r-project.org')))" >> ~/.Rprofile
# R:
# RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -sc)-cran40/" && apt update && apt -y dist-upgrade && apt install -y r-base-dev texlive-full texlive-xetex ttf-mscorefonts-installer r-recommended build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev default-jre default-jdk && Rscript -e "install.packages(c('remotes','devtools','BiocManager','keras'))"
......@@ -58,4 +58,4 @@ EXPOSE 8888
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["/entrypoint.sh"]
\ No newline at end of file
ENTRYPOINT ["/entrypoint.sh"]
This diff is collapsed.
......@@ -818,7 +818,7 @@ OmicSelector_deep_learning = function(selected_miRNAs = ".", wd = getwd(),
#' @return Results of uncalibrated and recalibrated models.
#'
#' @export
OmicSelector_transfer_learning_neural_network = function(selected_miRNAs = ".", new_scaling = TRUE, model_path = "tcga_models/pancreatic_tcga_165592-1601307872.zip", save_scaling = TRUE,
OmicSelector_transfer_learning_neural_network = function(selected_miRNAs = ".", new_scaling = TRUE, model_path = "tcga_models/pancreatic_tcga_165592-1601307872.zip", save_scaling = TRUE,
old_train_csv_to_restore_scaling = "../tcga/mixed_train.csv" # used if save_scaling is F and no scaling properties were saved in the model; this regenerates scaling based on previous training set.
, freeze_from = 1
, freeze_to = 2,
......@@ -880,17 +880,17 @@ pre_conf = data.table::fread(wyniki_path_unzipped)
if(as.logical(pre_conf[1,"scaled"])) {
if(new_scaling) {
x_train_scale = x_train %>% scale()
col_mean_train <- attr(x_train_scale, "scaled:center")
col_sd_train <- attr(x_train_scale, "scaled:scale")
saveRDS(col_mean_train, "transfer_col_mean_train.RDS")
saveRDS(col_sd_train, "transfer_col_sd_train.RDS")
x_test_scale <- x_test %>%
scale(center = col_mean_train,
scale = col_sd_train)
x_valid_scale <- x_valid %>%
scale(center = col_mean_train,
scale = col_sd_train)
......@@ -901,27 +901,27 @@ if(as.logical(pre_conf[1,"scaled"])) {
as.matrix() %>% scale()
col_mean_train <- attr(tcga_train, "scaled:center")
col_sd_train <- attr(tcga_train, "scaled:scale")
saveRDS(col_mean_train, "transfer_col_mean_train.RDS")
saveRDS(col_sd_train, "transfer_col_sd_train.RDS")
x_train_scale <- x_train %>%
scale(center = col_mean_train,
scale = col_sd_train)
x_test_scale <- x_test %>%
scale(center = col_mean_train,
scale = col_sd_train)
x_valid_scale <- x_valid %>%
scale(center = col_mean_train,
scale = col_sd_train)
}
}
} else {
x_train_scale <- x_train
x_test_scale <- x_test
x_valid_scale <- x_valid
x_test_scale <- x_test
x_valid_scale <- x_valid
}
......@@ -1432,4 +1432,4 @@ OmicSelector_deep_learning_predict_transfered = function(model_path = "our_model
`roc` = roc,
`roc_auc` = roc_auc)
final_return
}
\ No newline at end of file
}
......@@ -16,7 +16,7 @@ OmicSelector_OmicSelector(
conda_path = "/home/konrad/anaconda3/bin/conda",
debug = F,
timeout_sec = 172800,
type = "deltact"
type = "auto"
)
}
\arguments{
......
......@@ -18,7 +18,8 @@ OmicSelector_benchmark(
algorithms = c("mlp", "mlpML", "svmRadial", "svmLinear", "rf", "C5.0", "rpart",
"rpart2", "ctree"),
holdout = T,
stamp = as.character(as.numeric(Sys.time()))
stamp = as.character(as.numeric(Sys.time())),
OmicSelector_docker = F
)
}
\arguments{
......@@ -44,6 +45,8 @@ OmicSelector_benchmark(
\item{stamp}{Character vector or timestamp to make the benchmark unique.}
\item{OmicSelector_docker}{Adding features used by OmicSelector GUI. Almost always you should set it to FALSE (default).}
\item{input_fomulas}{List of formulas as created by `OmicSelector_OmicSelector` or `OmicSelector_merge_formulas`. Those formulas will be check in benchmark.}
\item{keras_threds}{This package supports training of keras networks in parallel. Here you can set the number of threads used. (e.g. "mlpKerasDropout", "mlpKerasDecay")}
......
......@@ -56,8 +56,8 @@ To present the package functionality, we will use the pan-cancer data from TCGA
Please note, that this process may take some time (depending on your network connection), but has to be performed only once.
```{r, eval = F}
OmicSelector_download_tissue_miRNA_data_from_TCGA()
OmicSelector_process_tissue_miRNA_TCGA(remove_miRNAs_with_null_var = T)
# OmicSelector_download_tissue_miRNA_data_from_TCGA() # do not run it if you do not need to... You can use already downloaded files via data("orginal_TCGA_data") provided with the package.
# OmicSelector_process_tissue_miRNA_TCGA(remove_miRNAs_with_null_var = T)
```
Both of those function produce 2 files: `tissue_miRNA_counts.csv` and `tissue_miRNA_logtpm.csv`.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment