##########################################################################################################
# Dockerfile
#
# Software:         set of R scripts for single-cell data analysis
# Software Version: v0.0.42
# Description:      Dockerized version of the set of R scripts for
#                   single-cell data analysis
# Website:          https://github.com/Barski-lab/workflows
# Provides:         set of R scripts for single-cell data analysis
# Base Image:       satijalab/seurat:latest
# Build Cmd:        docker build --platform linux/amd64 --no-cache --rm -t biowardrobe2/sc-tools:v0.0.42 -f sc-tools-Dockerfile .
# Pull Cmd:         docker pull --platform linux/amd64 biowardrobe2/sc-tools:v0.0.42
# Run Cmd:          docker run --platform linux/amd64 --rm -ti biowardrobe2/sc-tools:v0.0.42 /bin/bash
##########################################################################################################
#
# Notes:
# - if you have problems compiling Harmony
#   https://github.com/immunogenomics/harmony/pull/165
# - fix bug in cell cycle genes removal
# - Quick "smoke" test
#     sc_rna_filter.R --help && \
#     sc_rna_reduce.R --help && \
#     sc_rna_cluster.R --help && \
#     sc_rna_de_pseudobulk.R --help && \
#     sc_rna_da_cells.R --help && \
#     sc_rna_trajectory.R --help && \
#     sc_atac_filter.R --help && \
#     sc_atac_reduce.R --help && \
#     sc_atac_cluster.R --help && \
#     sc_atac_dbinding.R --help && \
#     sc_atac_coverage.R --help && \
#     sc_multiome_filter.R --help && \
#     sc_wnn_cluster.R --help && \
#     sc_ctype_assign.R --help && \
#     sc_triangulate.R --help && \
#     sc_vdj_profile.R --help && \
#     sc_cb_utils_atac_search.R --help && \
#     sc_cb_utils_split_mex.R --help && \
#     sc_rna_azimuth.R --help && \
#     sc_rna_load_rhapsody.R --help
#
# v0.0.42 -- based on biowardrobe2/sc-tools:v0.0.41
# - Updated sc_atac_dbinding.R and sc_atac_coverage.R
#   scripts to normalize bigWig files properly (using
#   the same approach as in the CoveragePlot function
#   from Signac)
# - Removed first_tn5ct.bigWig and second_tn5ct.bigWig
#   outputs from sc_atac_dbinding.R (they are redundant).
#   Also, renamed pct.1 and pct.2 columns to have the
#   names from --first and --second parameters.
#   The gene_name column (the nearest gene) is also
#   removed from the output file. The nearest gene
#   should be asigned by iaintersect tool.
# v0.0.41 -- based on biowardrobe2/sc-tools:v0.0.40
# - Updated UCSC Cellbrowser to 1.2.8.
# - Save gene and peak markers in the same rds file
#   as the main Seurat object.
# - Export multiple resolutions with the correspondent
#   gene and peaks markers into the UCSC Cellbrowser.
# - Fixed a bug in the heatmaps when exporting gene
#   markers from the multiple resolutions.
# - Added NA color for not assigned cell cycle phase,
#   otherwise fails to output some of the plots.
# - Added sc_rna_azimuth.R to run reference mapping.
#   We had to install seurat-data from the commit
#   b198ed523b1fd773c09356d30d9dfcebd62f22cf because we
#   didn't want to update the version of SeuratObject.
#   We installed Azimuth from the custom repo made of the
#   v0.4.6 version to prevent if from downloading
#   the homologs.rds file on every execution. We can
#   install Azimuth from the main repo after we switch
#   to Seurat 5 base image.
# - Added sc_rna_load_rhapsody.R to load RDS files
#   produced by the BD Rhapsody Sequence Analysis Pipeline
# - Installed ggdensity package for showing rug plots
#   in the geom_point_plot
# - Updated sc_ctype_assign.R to export results into
#   the Azimuth reference model. PCA now always has
#   at least 50 dimensions, and WNN integration
#   creates SPCA reduction with minimum 50 dimensions
#   too. Both of them are needed for Azimuth reference
#   mapping. When processing ATAC assay, we backup RNA
#   related assays completely, otherwise some data is
#   lost and we can't use them for Azimuth reference
#   creation on the later steps. Similarly, we backup
#   ATAC related reductions, when processing RNA data,
#   however we don't actually use ATAC reference mapping
#   yet.
# - Updated sc_ctype_assign.R, sc_rna_cluster.R,
#   sc_wnn_cluster.R, and sc_rna_azimuth.R scripts to
#   calculate module scores for the --genesets GMT file.
#   GSEABase is used for loading data from GMT file.
# - Updated sc_rna_da_cells.R to support dim reductions
#   for rna, atac, and wnn results. Fixed bugs.
# - Added --barcodes parameter to the sc_ctype_assign.R
#   Cells not present in the provided barcodes file will
#   have "NA"
#
# v0.0.40 -- based on biowardrobe2/sc-tools:v0.0.39
# - Added sc_report_wrapper.R script to export HTML report
# - Updated all the scripts to be runnable through the
#   sc_report_wrapper.R wrapper
#
# v0.0.39 -- based on biowardrobe2/sc-tools:v0.0.38_as_base
# - Install Nebulosa from the GitHub because of this bug 
#   https://github.com/powellgenomicslab/Nebulosa/issues/22
# - Replace gene expression violin plot to show all genes
#   on the same plot. Show not log-normalized scale on y-axis
#   so the plot better correspond to the information show on
#   the dot plot. Refactore vln_plot function to automatically
#   adjust columns number, width, height depending on the data.
# - Updated geom_point_plot to show densities in the better way.
# - Added sc_cb_utils_atac_search.R script to create a file
#   required by the UCSC Cellbrowser for searching peaks by the
#   nearest genes. We need it when generating UCSC Cellbrowser
#   from the CellRanger ARC/ATAC outputs.
# - Intall DropletUtils to export results into Cell Ranger
#   compatible MEX format
# - Added sc_cb_utils_split_mex.R script to split feature-barcode
#   matrix produced by Cell Ranger ARC into RNA and ATAC counts
# - Added extra 32 colors to D40_COLORS to not fail when there are
#   to many clusters
#
# v0.0.38 -- based on satijalab/seurat:latest
# - Fixed bug with contours ploting for the groups
#   with only one cell
# - Added searching nearest peaks by genes in the USCS
#   Cell Browser generated from ATAC
# - Need to update patchwork package, because when used
#   from the base image, it causes a bug explained here
#   https://github.com/Watts-College/paf-515-spr-2024/issues/9
# - need to install libgit2-dev, otherwise devtools fails to
#   install
#
# v0.0.37 -- based on biowardrobe2/sc-tools:v0.0.36
# - Updated sc_vdj_profile.R (uses scRepertoire v2.0.0)
# - load_cell_identity_data now support default identity
# - assign_identities now assigns donor if it wasn't present
# - --identity parameters is now optional in sc_atac_filter.R,
#   sc_multiome_filter.R, and sc_rna_filter.R scripts
# - Updated UCSC CellBrowser version to 1.2.5 (need to rename
#   the file chosen-sprite@2x.png, because it can't be
#   returned by cwltool as output)
# - Added QC-plots for all clustering pipelines
#
# v0.0.36 -- based on biowardrobe2/sc-tools:v0.0.35
# - Export RNA counts data to Loupe file (loupeR v1.1.0)
#   Need to patch eula.R as a notice to aggree with
#   EULA is shown in the --loupe parameter.
#
# v0.0.35 -- based on biowardrobe2/sc-tools:v0.0.34
# - Added sc_atac_filter.R script
# - Refactored plots
#
# v0.0.34 -- based on biowardrobe2/sc-tools:v0.0.33
# - Use intrinsicDimension to estimate dimensionality
#   in sc_rna_reduce.R and sc_rna_cluster.R scripts
#   if --dimensions parameter was set to 0
# - Allow to show density levels on UMAP (see
#   dim_plot function from graphics.R)
# - Show cell counts on the composition plots (can
#   disabled when label parameter is set to FALSE)
# - Allow to set seed in all scripts
# - Automatically estimate --minumis, --mingenes,
#   --maxgenes, --maxmt, and --minfragments filtering
#   thresholds if set to 0 (related to sc_rna_filter.R
#   and sc_multiome_filter.R scripts)
# - Updated plots for cell counts comparison between
#   datasets, groups, clusters, etc in
#   sc_[rna/atac/wnn]_cluster.R and sc_ctype_assign.R
#   scripts
# - Add optional --reduction to sc_ctype_assign.R
#   scripts to outputs plots only to selected reduction
#   (if not provided, it will be defined based on the
#   --source parameter)
# - Added "RNA reads vs mitochondrial % per cell" plot in
#   sc_rna_filter.R and sc_multiome_filter.R scripts
# - Set the default normalization method in sc_rna_reduce.R
#   to sctglm
# - Added --minpct threshold to sc_rna_de_pseudobulk.R
#   script to remove genes that are not expressed in
#   the majority of the cells
# v0.0.33 -- based on biowardrobe2/sc-tools:v0.0.32
# - Replace all "Transcipts" with "RNA reads" and
#   all "Fragments" with "ATAC fragments".
# - Use biowardrobe2/sc-tools:v0.0.32 as a base
#   image only updating R scripts
#
# v0.0.32
# - Fix bug with ATAC Dim Reduction pipeline
# - Updated all --dimension parameters to be integers
# - Set scRepertoire version to v1, because latest from
#   the GitHub is already v2
# - Added --splitby parameter to sc_ctype_assign.R
# - Added --upstream, --downstream parameters for genome
#   coverage plots
#
# v0.0.31
# - Set identities to new.ident after filtering by barcodes
#   (this will allow script not to fail when we overwritten
#   new.ident columns with our custom metadata file)
# - Minor correction of the HOPACH clustering labels
# - Need to install specific version of Signac (1.11.0),
#   because the latest one is already updated to work with
#   Seurat 5, but the latest docker image for Seurat is not
#   yet version 5.
#
# v0.0.30
# - Updated base image to the latest (has the same
#   Seurat 4.3.0 as satijalab/seurat:4.3.0).
#   Otherwise can't install cmapR (its Cytolib dependency)
#   as in the satijalab/seurat:4.3.0 R version is too old.
# - Updated RNA trajectory script
#   * show gene expression along the pseudotime
#   * show pseudotime histogram colored by cluster
# - Need to install Matrix.utils from GitHub
#   because it was removed from the R repository
#
# v0.0.29
# - Updated gene markers heatmap
# - --regressgenes input from RNA reduce
#   workflow is not a regex
#
# v0.0.28
# - Added V(D)J analysis script sc_vdj_profile.R
# - Install scRepertoire from GitHub because,
#   unless we update base image to the newer R,
#   the bioconductor version of scRepertoire
#   doesn't include createHTOContigList function
#
# v0.0.27
# - Added trajectory analysis script sc_rna_trajectory.R
#
# v0.0.26
# - Optionally replace Cellranger peaks with peaks
#   called by MACS2 from the Tn5 cut sites
# - adjusted plots sizes from the filtering workflows
# - need to install cython==0.29 because of this bug
#   https://github.com/macs3-project/MACS/discussions/568
#
# v0.0.25
# - Refactoring
# - Bug fixes
#
# v0.0.24
# - Refactoring
#
# v0.0.23
# - Refactoring - updated terminology
#
# v0.0.22
# - include ENCODE blacklist regions and cell cycle
#   genes files into the image
#
# v0.0.21
# - Add Differential Binding Analysis for scATAC data
#
# v0.0.20
# - Make doublets removal configurable to include only
#   RNA, only ATAC, union or intersection of RNA and
#   ATAC doublets.
#
# v0.0.19
# - Updated sc_rna_de_pseudobulk.R script to support
#   FindMarkers function for differential expression
#   analysis
#
# v0.0.18
# - Added sc_atac_coverage.R script to generate bigWigs
# - Updated sc_multiome_filter.R script to load chromosome
#   length infomration from file (we need it later when
#   export coverage to bigWig format)
#
# v0.0.17
# - Export RNA assay to SCope compatible loom file
#
# v0.0.16
# - Add doublets identification and removal for RNA and ATAC
# - Use a separate reduction for Elbow plot, run PCA and SVD
#   with that number of dimensions that user specified
# - Export colors to UCSC Cell Browser
#
# v0.0.15
# - Export feature markers to UCSC Cell Browser
# - Update axes on log-scaled plots
# - Add gene expression heatmap with "magick" and "ComplexHeatmap"
# - Install MACS2 from source because of the known bug
#   https://github.com/macs3-project/MACS/issues/544
# - Need to patch /etc/ImageMagick-6/policy.xml because of
#   https://askubuntu.com/questions/1041349/imagemagick-command-line-convert-limit-values
#
# v0.0.14
# - updated to seurat:4.1.0
# - barcodes filtering allows to exclude the whole dataset
# - fitlering pipelines export data to UCSC Cellbrowser
# - updated cell cycle phases regression
# - harmony is installed from CRAN
#
# v0.0.13
# - Doesn't fail anymore when analyzing single dataset
# - Updated sc_rna_de_pseudobulk.R script to
#   * produce MDS plot
#   * to save HOPACH clustered aggregated GCT heatmap
#   * to use dittoHeatmap for cell heatmap
# - Updated sc_[rna/atac/wnn]_cluster.R scripts to allow
#   selecting cluster algorithm
# - Need to intall Harmony from GitHub as it disappeared
#   from BioConductor and official R repository
#
# v0.0.12
# - add sc_triangulate.R to run scTriangulate
# - install certain packages with manually provided
#   dependencies as R updates Seurat to the latest
#   version by default
# - need to have fixed versions for scipy and numpy
#   to be able to build numpy from source because of
#   seg. fault when running it from reticulate
#   https://stackoverflow.com/questions/70711946/reticulate-segfaults-with-call-to-plt-plot
#   https://github.com/rstudio/reticulate/issues/1133#issuecomment-1021783041
#
# v0.0.11
# - add integration with Harmony in sc_atac_reduce.R script
# - updated --barcodes parameter to extend metadata
# - updated --norm parameter in sc_atac_reduce.R
# - updated --callby parameter in sc_multiome_filter.R
#
# v0.0.10
# - add integration with Harmony on sc_rna_reduce.R script
# - bug fix with cell cycle removal in not integrated SCTransformed dataset
# - updated UCSC Cell Browser from 1.1.1 to 1.2.1
#
# v0.0.9
# - export h5ad files
# - minor graphics correction
# - add sc_rna_da_cells.R script
#
# v0.0.8
# - rename sc_de_pseudobulk.R to sc_rna_de_pseudobulk.R
#   added more UMAPs to plot
#
# v0.0.7
# - added sc_de_pseudobulk.R script for pseudobulk DE analysis
# - install limma package
#
# v0.0.6
# - added sc_ctype_assign.R script for manual cell types
#   assignment
#
# v0.0.5
# - updated sc_[rna/wnn]_cluster.R script to use densoty plots
#   from Nebulosa
# - removed --regressrnaumi from sc_rna_reduce.R
# - made --regressgenesin sc_rna_reduce.R to use list of genes
#
# v0.0.4
# - add/update scripts
#   sc_rna_filter.R
#   sc_multiome_filter.R
#   sc_rna_reduce.R
#   sc_atac_reduce.R
#   sc_rna_cluster.R
#   sc_atac_cluster.R
#   sc_wnn_cluster.R
# - install MACS2 after numba as it fails on numpy
#
# v0.0.3
# - add sc_gex_reduce.R script
# - add sc_gex_cluster.R
# Notes:
# - pip3 install -U numba is required. This will reinstall numpy
#   to the version that is needed by numba thus making possible to
#   use umap in R through reticulate (use umap-learn in runUMAP).
#
# v0.0.2
# - add sc_gex_filter.R script
#
# v0.0.1
# - initial version of sc_multiome_filter.R script
#
#################################################################


### Base Image
FROM --platform=linux/amd64 satijalab/seurat:latest
LABEL maintainer="misha.kotliar@gmail.com"
ENV DEBIAN_FRONTEND noninteractive


################## BEGIN INSTALLATION ######################

WORKDIR /tmp

ENV R_MAX_VSIZE=200000000000 \
    CB_VERSION=1.2.8 \
    MACS2_VERSION=2.2.8 \
    SCTRIANGULATE_VERSION=0.12.0 \
    SCIPY_VERSION=1.7.3 \
    NUMPY_VERSION=1.22.4 \
    HTSLIB_VERSION=1.17 \
    LOUPER_VERSION=1.1.0 \
    MACS2_URL=https://github.com/macs3-project/MACS.git
ENV HTSLIB_URL=https://github.com/samtools/htslib/releases/download/${HTSLIB_VERSION}/htslib-${HTSLIB_VERSION}.tar.bz2 \
    LOUPER_URL=https://github.com/10XGenomics/loupeR/releases/download/v${LOUPER_VERSION}/loupeR_Linux.tar.gz

COPY ./scripts/sc_tools/sc_* /usr/local/bin/
COPY ./scripts/sc_tools/modules/*.R /usr/local/bin/modules/
COPY ./scripts/sc_tools/data/*.csv /opt/sc_tools/

### Installing dependencies
RUN apt-get update && \
    apt-get install libgcc-10-dev python3-dev python3-pip libxml2-dev libcurl4-openssl-dev \
                    libssl-dev pandoc libudunits2-dev libgdal-dev libcairo2-dev libharfbuzz-dev \
                    libfribidi-dev libbz2-dev tk libfontconfig1-dev libfreetype6-dev libpng-dev \
                    libtiff5-dev libjpeg-dev libmagick++-dev vim libgit2-dev -y && \
    wget -q -O - $HTSLIB_URL | tar -jxv && \
    cd htslib-${HTSLIB_VERSION} && \
    ./configure --prefix=/usr/local/ && \
    make -j 4 && \
    make install && \
    cd .. && \
    sed -i -e 's/name="disk" value="1GiB"/name="disk" value="15GiB"/g' /etc/ImageMagick-6/policy.xml && \
    sed -i -e 's/name="width" value="16KP"/name="width" value="25MP"/g' /etc/ImageMagick-6/policy.xml && \
    sed -i -e 's/name="height" value="16KP"/name="height" value="25MP"/g' /etc/ImageMagick-6/policy.xml && \
    pip3 install --no-binary="numpy" numpy==${NUMPY_VERSION} --ignore-installed && \
    pip3 install scipy==${SCIPY_VERSION} && \
    pip3 install anndata && \
    pip3 install cellbrowser==${CB_VERSION} && \
    cd /usr/local/lib/python3.8/dist-packages/cellbrowser/cbWeb/ext && \
    mv chosen-sprite@2x.png chosen-sprite_2x.png && \
    sed -i 's/chosen-sprite@2x.png/chosen-sprite_2x.png/g' chosen.1.8.2.min.css && \
    cd - && \
    pip3 install -U numba && \
    pip3 install MAnorm2-utils && \
    git clone --depth 1 --branch v${MACS2_VERSION} ${MACS2_URL} && \
    cd MACS && \
    pip3 install cython==0.29 && \
    pip3 install . && \
    cd .. && \
    pip3 install sctriangulate==${SCTRIANGULATE_VERSION} && \
    R -e 'install.packages("devtools", repo = "https://cloud.r-project.org/")' && \
    R -e 'install.packages("argparse", repo = "https://cloud.r-project.org/")' && \
    R -e 'install.packages("tidyverse", repo = "https://cloud.r-project.org/")' && \
    R -e 'install.packages("modules", repo = "https://cloud.r-project.org/")' && \
    R -e 'install.packages("hexbin", repo = "https://cloud.r-project.org/")' && \
    R -e 'devtools::install_github("cvarrichio/Matrix.utils", upgrade = "never")' && \
    R -e "BiocManager::install(c('BiocGenerics', 'DelayedArray', 'DelayedMatrixStats','limma', \
                                 'S4Vectors', 'SingleCellExperiment', 'SummarizedExperiment', \
                                 'batchelor', 'DESeq2', 'Rsamtools', 'rtracklayer', \
                                 'glmGamPoi', 'limma', 'EnhancedVolcano', 'LoomExperiment', \
                                 'hopach', 'Glimma', 'dittoSeq', 'cmapR', 'ComplexHeatmap', 'scDblFinder', \
                                 'slingshot', 'traviz', 'DropletUtils', 'GSEABase'))" && \
    R -e 'install.packages("fastmatch")' && \
    R -e 'install.packages("RcppRoll")' && \
    R -e 'devtools::install_github("stuart-lab/signac@1.11.0", upgrade = "never")' && \
    R -e 'devtools::install_github("cellgeni/sceasy", upgrade = "never")' && \
    R -e 'devtools::install_github("KlugerLab/DAseq", upgrade = "never")' && \
    R -e 'devtools::install_github("aertslab/SCopeLoomR", upgrade = "never")' && \
    R -e 'devtools::install_github("dynverse/dynfeature", upgrade = "never")' && \
    R -e 'devtools::install_github("dynverse/dynplot", upgrade = "never")' && \
    R -e 'devtools::install_github("ncborcherding/scRepertoire@v2.0.0", upgrade = "never")' && \
    R -e 'devtools::install_github("powellgenomicslab/Nebulosa@1f0714dd4adee2f9dee2946084e5ca14765e77ae", upgrade = "never")' && \
    R -e 'install.packages("LambertW")' && \
    R -e 'install.packages("nortest")' && \
    R -e 'install.packages("doParallel")' && \
    R -e 'install.packages("doRNG")' && \
    R -e 'install.packages("butcher")' && \
    R -e 'install.packages("recipes")' && \
    R -e 'install.packages("bestNormalize", repo = "https://cloud.r-project.org/", dependencies = FALSE)' && \
    R -e 'install.packages("harmony")' && \
    R -e 'install.packages("magick")' && \
    R -e 'install.packages("MAnorm2")' && \
    R -e 'install.packages("circlize")' && \
    R -e 'install.packages("intrinsicDimension")' && \
    R -e 'install.packages("ggnewscale")' && \
    R -e 'install.packages("patchwork")' && \
    R -e 'install.packages("ggdensity")' && \
    R -e 'devtools::install_github("satijalab/seurat-data", upgrade = "never", ref = "b198ed523b1fd773c09356d30d9dfcebd62f22cf")' && \
    R -e 'devtools::install_github("michael-kotliar/azimuth", upgrade = "never", ref = "v0.4.6mod")' && \
    wget ${LOUPER_URL} && \
    tar xzf loupeR_Linux.tar.gz && \
    sed -i 's/file\.exists(eula_lock_file())/TRUE/g' /tmp/loupeR/R/eula.R && \
    R -e 'install.packages("/tmp/loupeR", repos=NULL, type="source")' && \
    R -e 'library("loupeR"); loupeR::setup()' && \
### Installing R scripts
    chmod +x /usr/local/bin/sc_rna_filter.R && \
    chmod +x /usr/local/bin/sc_multiome_filter.R && \
    chmod +x /usr/local/bin/sc_rna_reduce.R && \
    chmod +x /usr/local/bin/sc_atac_reduce.R && \
    chmod +x /usr/local/bin/sc_rna_cluster.R && \
    chmod +x /usr/local/bin/sc_atac_filter.R && \
    chmod +x /usr/local/bin/sc_atac_cluster.R && \
    chmod +x /usr/local/bin/sc_atac_coverage.R && \
    chmod +x /usr/local/bin/sc_atac_dbinding.R && \
    chmod +x /usr/local/bin/sc_wnn_cluster.R && \
    chmod +x /usr/local/bin/sc_ctype_assign.R && \
    chmod +x /usr/local/bin/sc_rna_de_pseudobulk.R && \
    chmod +x /usr/local/bin/sc_rna_da_cells.R && \
    chmod +x /usr/local/bin/sc_triangulate.R && \
    chmod +x /usr/local/bin/sc_rna_trajectory.R && \
    chmod +x /usr/local/bin/sc_vdj_profile.R && \
    chmod +x /usr/local/bin/sc_tn5_cut_sites.sh && \
    chmod +x /usr/local/bin/sc_cb_utils_atac_search.R && \
    chmod +x /usr/local/bin/sc_cb_utils_split_mex.R && \
    chmod +x /usr/local/bin/sc_report_wrapper.R && \
    chmod +x /usr/local/bin/sc_rna_azimuth.R && \
    chmod +x /usr/local/bin/sc_rna_load_rhapsody.R && \
### Downloading blacklist regions files
    wget https://raw.githubusercontent.com/Boyle-Lab/Blacklist/61a04d2c5e49341d76735d485c61f0d1177d08a8/lists/hg38-blacklist.v2.bed.gz && \
    wget https://raw.githubusercontent.com/Boyle-Lab/Blacklist/61a04d2c5e49341d76735d485c61f0d1177d08a8/lists/hg19-blacklist.v2.bed.gz && \
    wget https://raw.githubusercontent.com/Boyle-Lab/Blacklist/61a04d2c5e49341d76735d485c61f0d1177d08a8/lists/mm10-blacklist.v2.bed.gz && \
    gzip -d hg38-blacklist.v2.bed.gz && mv hg38-blacklist.v2.bed /opt/sc_tools/ && \
    gzip -d hg19-blacklist.v2.bed.gz && mv hg19-blacklist.v2.bed /opt/sc_tools/ && \
    gzip -d mm10-blacklist.v2.bed.gz && mv mm10-blacklist.v2.bed /opt/sc_tools/ && \
### Cleaning
    apt-get clean && \
    apt-get purge && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && \
    strip /usr/local/bin/*; true
