Skip to content

Commit

Permalink
Merge pull request #107 from LiuzLab/dockerseparation
Browse files Browse the repository at this point in the history
Separate R Dockerfile
  • Loading branch information
jylee-bcm authored Nov 21, 2024
2 parents 9983265 + 42cd314 commit 5e37e29
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 40 deletions.
31 changes: 0 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,6 @@ RUN pip3 install --upgrade pip
RUN pip3 install -r /opt/requirements.txt
RUN pip3 install bgzip


# Install R
RUN apt-get update
RUN apt install -y --no-install-recommends software-properties-common dirmngr
# Add the keys
RUN apt install wget
RUN wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
#RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 || \
# apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 || \
# apt-key adv --keyserver pgp.mit.edu --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 || \
# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 || \
# apt-key adv --keyserver keyserver.pgp.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
#RUN add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

RUN add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
RUN add-apt-repository universe
RUN apt-get update

RUN apt install -y r-base r-base-core

# Install R libs
RUN R -e "install.packages('data.table',dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('dplyr',dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('ontologyIndex',dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('ontologySimilarity',dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('tidyverse',dependencies=TRUE, repos='http://cran.rstudio.com/')"



# Install bcftools
RUN wget https://github.com/samtools/bcftools/releases/download/1.20/bcftools-1.20.tar.bz2
RUN mv bcftools-1.20.tar.bz2 /opt/bcftools-1.20.tar.bz2
Expand Down
5 changes: 5 additions & 0 deletions Dockerfiles/r.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM rocker/tidyverse

# Install R libs
RUN R -e "install.packages('ontologyIndex',dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('ontologySimilarity',dependencies=TRUE, repos='http://cran.rstudio.com/')"
39 changes: 30 additions & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ process GENESYM_TO_PHRANK {


process HPO_SIM {
container 'zhandongliulab/aim-lite-r'

input:
path hpo
path omim_hgmd_phen
Expand Down Expand Up @@ -514,28 +516,43 @@ process ANNOTATE_BY_MODULES {
"""
}

process JOIN_TIER_PHRANK {
process ANNOTATE_TIER {
container 'zhandongliulab/aim-lite-r'
tag "${scores.simpleName}"

input:
path scores
path phrank

path ref_annot_dir
path ref_var_tier_dir
path ref_merge_expand_dir

output:
path "${scores.simpleName}_scores.txt.gz", emit: compressed_scores
path "${scores.simpleName}_Tier.v2.tsv", emit: tier

script:
"""
mv $scores scores.csv
VarTierDiseaseDBFalse.R ${params.ref_ver}
mv Tier.v2.tsv ${scores.simpleName}_Tier.v2.tsv
"""
}

process JOIN_PHRANK {
tag "${scores.simpleName}"

input:
path scores
path phrank
path ref_merge_expand_dir

output:
path "${scores.simpleName}_scores.txt.gz", emit: compressed_scores

script:
"""
mv $scores scores.csv
generate_new_matrix_2.py ${params.run_id} ${params.ref_ver}
mv scores.txt.gz ${scores.simpleName}_scores.txt.gz
mv Tier.v2.tsv ${scores.simpleName}_Tier.v2.tsv
"""
}

Expand Down Expand Up @@ -712,19 +729,23 @@ workflow {
NORMALIZE_VCF.out.vcf,
)

JOIN_TIER_PHRANK (
ANNOTATE_TIER (
ANNOTATE_BY_MODULES.out.scores,
PHRANK_SCORING.out,

file(params.ref_annot_dir),
file(params.ref_var_tier_dir),
)

JOIN_PHRANK (
ANNOTATE_BY_MODULES.out.scores,
PHRANK_SCORING.out,
file(params.ref_merge_expand_dir)
)

MERGE_SCORES_BY_CHROMOSOME(
PHRANK_SCORING.out,
JOIN_TIER_PHRANK.out.tier.collect(),
JOIN_TIER_PHRANK.out.compressed_scores.collect(),
ANNOTATE_TIER.out.tier.collect(),
JOIN_PHRANK.out.compressed_scores.collect(),
file(params.ref_annot_dir),
file(params.ref_mod5_diffusion_dir),
file(params.ref_merge_expand_dir)
Expand Down

0 comments on commit 5e37e29

Please sign in to comment.