Skip to content

Commit

Permalink
Merge pull request #5 from chrarnold/main
Browse files Browse the repository at this point in the history
Updated GRaNIE resources
  • Loading branch information
janursa authored Aug 16, 2024
2 parents b9862c0 + dd380e8 commit 00c9149
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 19 deletions.
39 changes: 39 additions & 0 deletions dockerfiles/granie/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use the base image
FROM bioconductor/bioconductor_docker:devel-R-4.4.1


# Install required dependencies for the R packages
#RUN apt-get update && apt-get install -y \
# libcurl4-openssl-dev \
# libxml2-dev \
# libssl-dev \
# libcairo2-dev
# libxt-dev \
# libopenblas-dev


#Install R packages
RUN R -e "install.packages(c('devtools'))"

# Set the working directory
WORKDIR /workspace

# Default command
CMD ["R"]

RUN R -e "remotes::install_version('Matrix', version = '1.6-3')"

#Version 1.9.4 of GRaNIE
RUN R -e "devtools::install_gitlab('grp-zaugg/GRaNIE@855bf3def33ad7af9353db79c7e21c9279035fb8', host = 'git.embl.de', subdir = 'src/GRaNIE', dependencies = TRUE, upgrade = 'never')"

#Version 0.2.1 of GRaNIEverse
RUN R -e "devtools::install_gitlab('grp-zaugg/GRaNIEverse@3224b042f25f0085eeaf9194042bcb89103ea962', host = 'git.embl.de', upgrade = 'never', dependencies = TRUE)"

#There seems to be an incompatibility with the Matrix and irlba package, downgrading Matrix seems to work

RUN R -e "install.packages('irlba',type='source')"

RUN R -e "BiocManager::install(c('BSgenome.Hsapiens.UCSC.hg38', 'EnsDb.Hsapiens.v86', 'EnsDb.Mmusculus.v79', 'BSgenome.Mmusculus.UCSC.mm39'))"



138 changes: 138 additions & 0 deletions src/methods/multi_omics/granie/config.novsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
__merge__: ../../../api/comp_method.yaml


functionality:
name: GRaNIE
namespace: "grn_methods"
info:
label: GRaNIE
summary: "GRN inference using GRaNIE"
description: |
GRN inference using GRaNIE
documentation_url: https://grp-zaugg.embl-community.io/GRaNIE/
arguments:
- name: --file_rna
type: file
required: true
direction: input
description: "Path to the RNA data file (e.g., rna.rds)."

- name: --file_atac
type: file
required: true
direction: input
description: "Path to the ATAC data file (e.g., atac.rds)."

- name: --temp_dir
type: directory
required: false
direction: input
default: "output/granie/"
description: "Temporary directory for output files."

- name: --preprocessing_clusteringMethod
type: integer
required: false
default: 1
direction: input
description: "Seurat::FindClusters: Clustering method to use (1 = original Louvain algorithm, 2 = Louvain algorithm with multilevel refinement, 3 = SLM algorithm, 4 = Leiden algorithm)."

- name: --preprocessing_clusterResolution
type: float
required: true
direction: input
description: "Resolution for clustering, typically between 5 and 20."

- name: --preprocessing_SCT_nDimensions
type: integer
required: false
direction: input
default: 50
description: "Number of dimensions for SCT, default is 50."

- name: --genomeAssembly
type: string
required: true
direction: input
description: "Genome assembly version (e.g., hg38). Currently, hg38 and mm10 is supported."

- name: --GRaNIE_corMethod
type: string
required: false
default: "spearman"
direction: input
description: "Correlation method used in GRaNIE (e.g., 'spearman')."

- name: --GRaNIE_includeSexChr
type: boolean
required: false
default: true
direction: input
description: "Include sex chromosomes in analysis."

- name: --GRaNIE_promoterRange
type: integer
required: false
default: 250000
direction: input
description: "Range in base pairs for maximum distance of peak-gene connections (default is 250000)."

- name: --GRaNIE_TF_peak.fdr.threshold
type: float
required: false
default: 0.2
direction: input
description: "FDR threshold for TF-peak connections (default is 0.2)."

- name: --GRaNIE_peak_gene.fdr.threshold
type: float
required: false
default: 0.2
direction: input
description: "FDR threshold for peak-gene connections (default is 0.2)."

- name: --GRaNIE_nCores
type: integer
required: true
direction: input
description: "Number of cores to use for computation (default is 4)."

- name: --peak_gene
type: file
required: false
direction: output
description: "Path to the peak-gene output file (e.g., peak_gene.csv). Not yet implemented."

- name: --prediction
type: file
required: true
direction: output
description: "Path to the prediction output file (e.g., prediction.csv)."

- name: --useWeightingLinks
type: boolean
required: false
default: false
direction: input
description: "Flag to indicate whether to use weighting links in analysis."

- name: --forceRerun
type: boolean
required: false
default: false
direction: input
description: "Flag to force rerun of the analysis regardless of existing results."

resources:
- type: r_script
path: script.R


platforms:
- type: docker
image: chrarnold84/granieverse:latest

- type: native
- type: nextflow
directives:
label: [midtime,midmem,midcpu]
38 changes: 19 additions & 19 deletions src/methods/multi_omics/granie/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ library(BSgenome.Mmusculus.UCSC.mm39)
library(dplyr)

## VIASH START
par <- list(
file_rna = "resources_test/grn-benchmark/multiomics_r/rna.rds",
files_atac = "resources_test/grn-benchmark/multiomics_r/atac.rds",
temp_dir = "output/granie/",
preprocessing_clusteringMethod = 1, # Seurat::FindClusters: (1 = original Louvain algorithm, 2 = Louvain algorithm with multilevel refinement, 3 = SLM algorithm, 4 = Leiden algorithm)
preprocessing_clusterResolution = 14, # Typically between 5 and 20
preprocessing_SCT_nDimensions = 50, # Default 50
genomeAssembly = "hg38",
GRaNIE_corMethod = "spearman",
GRaNIE_includeSexChr = TRUE,
GRaNIE_promoterRange = 250000,
GRaNIE_TF_peak.fdr.threshold = 0.2,
GRaNIE_peak_gene.fdr.threshold = 0.2,
GRaNIE_nCores = 4,
peak_gene = "output/granie/peak_gene.csv", # not yet implemented, should I?
prediction= "output/granie/prediction.csv",
useWeightingLinks = FALSE,
forceRerun = FALSE
)
# par <- list(
# file_rna = "resources_test/grn-benchmark/multiomics_r/rna.rds",
# file_atac = "resources_test/grn-benchmark/multiomics_r/atac.rds",
# temp_dir = "output/granie/",
# preprocessing_clusteringMethod = 1, # Seurat::FindClusters: (1 = original Louvain algorithm, 2 = Louvain algorithm with multilevel refinement, 3 = SLM algorithm, 4 = Leiden algorithm)
# preprocessing_clusterResolution = 14, # Typically between 5 and 20
# preprocessing_SCT_nDimensions = 50, # Default 50
# genomeAssembly = "hg38",
# GRaNIE_corMethod = "spearman",
# GRaNIE_includeSexChr = TRUE,
# GRaNIE_promoterRange = 250000,
# GRaNIE_TF_peak.fdr.threshold = 0.2,
# GRaNIE_peak_gene.fdr.threshold = 0.2,
# GRaNIE_nCores = 4,
# peak_gene = "output/granie/peak_gene.csv", # not yet implemented, should I?
# prediction= "output/granie/prediction.csv",
# useWeightingLinks = FALSE,
# forceRerun = FALSE
# )

print(par)
# meta <- list(
Expand Down

0 comments on commit 00c9149

Please sign in to comment.