Skip to content

Commit

Permalink
granie failed to load seuratobject
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Aug 16, 2024
1 parent 140fc46 commit 238e004
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,29 @@ __merge__: ../../../api/comp_method.yaml


functionality:
name: GRaNIE
name: granie
namespace: "grn_methods"
info:
label: GRaNIE
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
required: false
direction: input
description: "Path to the RNA data file (e.g., rna.rds)."
default: resources_test/grn-benchmark/multiomics_rna.rds

- name: --file_atac
type: file
required: true
required: false
direction: input
description: "Path to the ATAC data file (e.g., atac.rds)."
default: resources_test/grn-benchmark/multiomics_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
Expand All @@ -38,76 +34,67 @@ functionality:
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
type: double
required: false
direction: input
description: "Resolution for clustering, typically between 5 and 20."
description: Resolution for clustering, typically between 5 and 20.
default: 14

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

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

- name: --GRaNIE_corMethod
type: string
required: false
default: "spearman"
default: spearman
direction: input
description: "Correlation method used in GRaNIE (e.g., 'spearman')."
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."
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)."
description: Range in base pairs for maximum distance of peak-gene connections (default is 250000).

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

- name: --GRaNIE_peak_gene.fdr.threshold
type: float
- name: --GRaNIE_peak_gene_fdr_threshold
type: double
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)."
description: FDR threshold for peak-gene connections (default is 0.2).

- 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)."
description: Path to the peak-gene output file (e.g., peak_gene.csv). Not yet implemented.
default: output/granie/peak_gene.csv

- name: --useWeightingLinks
type: boolean
Expand Down
48 changes: 24 additions & 24 deletions src/methods/multi_omics/granie/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ library(BSgenome.Mmusculus.UCSC.mm39)
library(dplyr)

## VIASH START
# 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
# )

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,
num_workers = 4,
peak_gene = "output/granie/peak_gene.csv", # not yet implemented, should I?
prediction= "output/granie/prediction.csv",
useWeightingLinks = FALSE,
forceRerun = FALSE
)
## VIASH END
print(par)
# meta <- list(
# functionality_name = "my_method_r"
# )
## VIASH END


#### STANDARD ASSIGNMENTS ###
file_seurat = "seurat_granie.qs"
Expand Down Expand Up @@ -210,11 +210,11 @@ GRN = runGRaNIE(
corMethod = par$GRaNIE_corMethod,
promoterRange = par$GRaNIE_promoterRange,
useGCCorrection = FALSE,
TF_peak.fdr.threshold = par$GRaNIE_TF_peak.fdr.threshold,
peak_gene.fdr.threshold = par$GRaNIE_peak_gene.fdr.threshold,
TF_peak.fdr.threshold = par$GRaNIE_TF_peak_fdr_threshold,
peak_gene.fdr.threshold = par$GRaNIE_peak_gene_fdr_threshold,
runTFClassification = FALSE,
runNetworkAnalyses = FALSE,
nCores = par$GRaNIE_nCores,
nCores = par$num_workers,
forceRerun = TRUE
)

Expand Down
2 changes: 1 addition & 1 deletion src/methods/multi_omics/scglue_ns/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ functionality:
platforms:
- type: nextflow
directives:
label: [ midtime, midmem, lowcpu ]
label: [ hightime, midmem, lowcpu ]

0 comments on commit 238e004

Please sign in to comment.