Skip to content

Dev nf #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .editorconfig
100644 → 100755
Empty file.
Empty file modified .gitattributes
100644 → 100755
Empty file.
Empty file modified .github/.dockstore.yml
100644 → 100755
Empty file.
Empty file modified .github/CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/bug_report.md
100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/config.yml
100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/feature_request.md
100644 → 100755
Empty file.
Empty file modified .github/PULL_REQUEST_TEMPLATE.md
100644 → 100755
Empty file.
Empty file modified .github/workflows/awsfulltest.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/awstest.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/branch.yml
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:

- name: Build new docker image
if: ${{ github.event.workflow_run.conclusion == 'thiswillnevertrigger' }}
run: docker build --no-cache . -t almurphy/scfdev:dev
run: docker build --no-cache . -t nfancy/scflow:dev
- name: Pull docker image
if: ${{ github.event.workflow_run.conclusion == 'thiswillnevertrigger' }}
run: |
docker pull almurphy/scfdev:dev
docker tag almurphy/scfdev:dev almurphy/scfdev:dev
docker pull nfancy/scflow:dev
docker tag nfancy/scflow:dev nfancy/scflow:dev
Empty file modified .github/workflows/linting.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/linting_comment.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .markdownlint.yml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .nf-core.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:

schema_params:
- input

actions_awsfulltest: False
pipeline_todos: False
actions_ci: False
repository_type: pipeline
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified CITATIONS.md
100644 → 100755
Empty file.
Empty file modified CODE_OF_CONDUCT.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Try the pipeline on an in-built, minimal test dataset (all inputs will be automa
3. Download the pipeline and test it on a minimal dataset with a single command:

```console
nextflow run nf-core/scflow -profile test,<docker/singularity/podman/shifter/charliecloud/conda/institute>
nextflow run combiz/nf-core-scflow -r dev-nf -profile test,<docker/singularity/podman/shifter/charliecloud/conda/institute>
```

> - Please check [nf-core/configs](https://github.com/nf-core/configs#documentation) to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use `-profile <institute>` in your command. This will enable either `docker` or `singularity` and set the appropriate execution settings for your local compute environment.
Expand All @@ -75,7 +75,7 @@ A complete, automated, scalable, and reproducible case-control analysis can then
1. Start running your own analysis!

```bash
nextflow run nf-core/scflow \
nextflow run combiz/nf-core-scflow -r dev-nf \
--manifest Manifest.tsv \
--input Samplesheet.tsv \
-c scflow_params.config \
Expand Down
Empty file modified assets/NO_FILE.tsv
100644 → 100755
Empty file.
Empty file modified assets/email_template.html
100644 → 100755
Empty file.
Empty file modified assets/email_template.txt
100644 → 100755
Empty file.
Empty file modified assets/nf-core-scflow_logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/schema_input.json
100644 → 100755
Empty file.
Empty file modified assets/sendmail_template.txt
100644 → 100755
Empty file.
85 changes: 0 additions & 85 deletions bin/scflow_annotate_integrated.R

This file was deleted.

14 changes: 6 additions & 8 deletions bin/scflow_dge.r
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ required$add_argument(
)

required$add_argument(
"--fc_threshold",
"--logFC_threshold",
type = "double",
default = 1.1,
metavar = "number",
help = "Absolute fold-change cutoff for DE [default %(default)s]"
)

required$add_argument(
"--pval_cutoff",
"--padj_cutoff",
type = "double",
default = 0.05,
metavar = "number",
Expand Down Expand Up @@ -254,8 +254,6 @@ de_results <- perform_de(
ref_class = args$ref_class,
confounding_vars = args$confounding_vars,
random_effects_var = args$random_effects_var,
fc_threshold = args$fc_threshold,
pval_cutoff = args$pval_cutoff,
mast_method = args$mast_method,
force_run = args$force_run,
ensembl_mapping_file = args$ensembl_mappings,
Expand All @@ -278,8 +276,8 @@ for (result in names(de_results)) {
)

report_de(de_results[[result]],
fc_threshold = args$fc_threshold,
pval_cutoff = args$pval_cutoff,
logFC_threshold = args$logFC_threshold,
padj_cutoff = args$padj_cutoff,
n_label = args$n_label,
report_folder_path = file.path(getwd()),
report_file = paste0(file_name, result, "_scflow_de_report")
Expand All @@ -289,8 +287,8 @@ for (result in names(de_results)) {

p <- scFlow::volcano_plot(
dt = de_results[[result]],
fc_threshold = args$fc_threshold,
pval_cutoff = args$pval_cutoff,
logFC_threshold = args$logFC_threshold,
padj_cutoff = args$padj_cutoff,
n_label = args$n_label
)

Expand Down
24 changes: 21 additions & 3 deletions bin/scflow_dirichlet.r
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,28 @@ required$add_argument(
required = TRUE
)

required$add_argument(
"--confounding_vars",
help = "confounding variables",
metavar = "sex",
required = TRUE
)

# get command line options, if help option encountered print help and exit,
# otherwise if options not found on command line then set defaults
args <- parser$parse_args()
args$var_order <- strsplit(args$var_order, ",")[[1]]
if (tolower(args$var_order) == "null") { args$var_order <- NULL }

if (tolower(args$var_order) == "null") {
args$var_order <- NULL
} else {
args$var_order <- strsplit(args$var_order, ",")[[1]]
}

if (tolower(args$confounding_vars) == "null") {
args$confounding_vars <- NULL
} else {
args$confounding_vars <- strsplit(args$confounding_vars, ",")[[1]]
}

# ____________________________________________________________________________
# Start ####
Expand All @@ -82,7 +99,8 @@ results <- model_celltype_freqs(
celltype_var = args$celltype_var,
dependent_var = args$dependent_var,
ref_class = args$ref_class,
var_order = args$var_order
var_order = args$var_order,
confounding_vars = args$confounding_vars
)

## ............................................................................
Expand Down
37 changes: 29 additions & 8 deletions bin/scflow_ipa.r
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ required$add_argument(
)

required$add_argument(
"--fc_threshold",
"--logFC_threshold",
type = "double",
default = 1.1,
default = 0.5,
metavar = "number",
help = "Absolute fold-change cutoff for DE [default %(default)s]"
)

required$add_argument(
"--pval_cutoff",
"--padj_cutoff",
type = "double",
default = 0.05,
metavar = "number",
Expand Down Expand Up @@ -121,8 +121,8 @@ for (gene_file in args$gene_file) {

dt <- dt %>%
dplyr::filter(
padj <= args$pval_cutoff,
abs(logFC) >= log2(args$fc_threshold)
padj <= args$padj_cutoff,
abs(logFC) >= args$logFC_threshold
)

if (nrow(dt) < 5) {
Expand All @@ -134,11 +134,32 @@ for (gene_file in args$gene_file) {
organism = getOption("scflow_species"),
enrichment_tool = args$enrichment_tool,
enrichment_method = args$enrichment_method,
enrichment_database = args$enrichment_database,
is_output = TRUE,
output_dir = output_dir
enrichment_database = args$enrichment_database
)

for(i in names(enrichment_result)){

output_dir_path <- paste(output_dir, i, sep = "/")
dir.create(output_dir_path)

res <- enrichment_result[[i]]

lapply(
setdiff(names(res), c("plot", "metadata")),
function(dt) {
write.table(res[dt],
file = paste(output_dir_path, "/", dt, ".tsv", sep = ""),
row.names = FALSE,
col.names = gsub(dt, "", colnames(res[[dt]])), sep = "\t")})
lapply(
names(res$plot),
function(p) {
ggplot2::ggsave(paste(output_dir_path, "/", p, ".png", sep = ""),
res$plot[[p]],
device = "png", height = 8,
width = 10, units = "in", dpi = 300)})
}

if (all(unlist(lapply(
enrichment_result, function(dt) {
isFALSE(dt$metadata$result)
Expand Down
10 changes: 10 additions & 0 deletions bin/scflow_map_celltypes.r
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ required$add_argument(
required = TRUE
)

required$add_argument(
"--annotation_level",
default = 1,
type = "integer",
help = "the annotation level of the reference ctd",
required = TRUE,
metavar = "N"
)

required$add_argument(
"--species",
help = "the biological species (e.g. mouse, human)",
Expand Down Expand Up @@ -101,6 +110,7 @@ sce <- map_celltypes_sce(
ctd_folder = args$ctd_folder,
clusters_colname = args$clusters_colname,
cells_to_sample = args$cells_to_sample,
annotation_level = as.numeric(args$annotation_level),
species = args$species
)

Expand Down
1 change: 1 addition & 0 deletions bin/scflow_reduce_dims.r
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ args <- purrr::map(args, function(x) {

sce <- read_sce(args$sce_path, read_metadata = TRUE)

set.seed(42)
sce <- reduce_dims_sce(
sce,
input_reduced_dim = args$input_reduced_dim,
Expand Down
4 changes: 3 additions & 1 deletion conf/base.config
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ process {
time = { check_max( 8.h * task.attempt, 'time' ) }
}
withLabel:process_high {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
time = { check_max( 16.h * task.attempt, 'time' ) }
}
withLabel:process_long {
time = { check_max( 20.h * task.attempt, 'time' ) }
}
withLabel:process_high_memory {
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
time = { check_max( 8.h * task.attempt, 'time' ) }
}
withLabel:error_ignore {
errorStrategy = 'ignore'
Expand Down
Empty file modified conf/gcp.config
100644 → 100755
Empty file.
Empty file modified conf/igenomes.config
100644 → 100755
Empty file.
Empty file modified conf/modules.config
100644 → 100755
Empty file.
10 changes: 6 additions & 4 deletions conf/scflow_analysis.config
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ params {
// Options: Dimensionality Reduction
reddim_input_reduced_dim = 'PCA,Liger' // *
reddim_reduction_methods = 'tSNE,UMAP,UMAP3D' // *
reddim_vars_to_regress_out = 'nCount_RNA,pc_mito' // *
reddim_vars_to_regress_out = 'total_counts,pc_mito' // *
// umap
reddim_umap_pca_dims = 30
reddim_umap_n_neighbors = 35
Expand Down Expand Up @@ -115,6 +115,7 @@ params {
// Options: Celltype Annotation
cta_clusters_colname = 'clusters'
cta_cells_to_sample = 10000
cta_annotation_level = 2

// Options: Celltype Metrics Report
cta_unique_id_var = 'manifest'
Expand All @@ -137,8 +138,8 @@ params {
dge_ref_class = 'Control'
dge_confounding_vars = 'cngeneson' // *
dge_random_effects_var = 'null'
dge_fc_threshold = 1.1
dge_pval_cutoff = 0.05
dge_logFC_threshold = 0.25
dge_padj_cutoff = 0.05
dge_n_label = 5
dge_force_run = 'false'
dge_max_cores = 'null'
Expand All @@ -153,7 +154,8 @@ params {
dirich_celltype_var = 'cluster_celltype'
dirich_dependent_var = 'diagnosis'
dirich_ref_class = 'Control'
dirich_var_order = 'null' // *
dirich_var_order = 'Control,Case' // *
dirich_confounding_vars = 'null' // *

// Options: Plots (Reduced Dim)
plotreddim_reduction_methods = 'UMAP_Liger' // *
Expand Down
4 changes: 2 additions & 2 deletions conf/test.config
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ params {

input = "https://raw.githubusercontent.com/nf-core/test-datasets/scflow/refs/SampleSheet.tsv"
manifest = "https://raw.githubusercontent.com/nf-core/test-datasets/scflow/refs/Manifest.txt"
ensembl_mappings = "https://raw.githubusercontent.com/nfancy/test-datasets/scflow/assets/ensembl_mappings.tsv"
ctd_path = "https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/28033407/ctd_v1.zip"
ensembl_mappings = "https://raw.githubusercontent.com/nf-core/test-datasets/scflow/assets/ensembl_mappings.tsv"
ctd_path = "https://raw.githubusercontent.com/combiz/scFlowData/dev-nf/assets/ctd.zip"
reddim_genes_yml = "https://raw.githubusercontent.com/nf-core/test-datasets/scflow/refs/reddim_genes.yml"

reddimplot_pointsize = 1
Expand Down
Empty file modified conf/test_full.config
100644 → 100755
Empty file.
Empty file modified docs/README.md
100644 → 100755
Empty file.
Empty file modified docs/images/nf-core-scflow_logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/images/scflow_workflow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/output.md
100644 → 100755
Empty file.
Empty file modified docs/usage.md
100644 → 100755
Empty file.
Empty file modified lib/nfcore_external_java_deps.jar
100644 → 100755
Empty file.
Empty file modified main.nf
100644 → 100755
Empty file.
5 changes: 1 addition & 4 deletions modules.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"name": "nf-core/scflow",
"homePage": "https://github.com/nf-core/scflow",
"repos": {
"nf-core/modules": {
}
}
"repos": {}
}
Empty file modified modules/local/functions.nf
100644 → 100755
Empty file.
Empty file modified modules/local/get_software_versions.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/functions.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/checkinputs.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/cluster.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/dge.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/dirichlet.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/finalize.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/functions.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/integrate.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/ipa.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/mapcelltypes.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/merge.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/mergeqctables.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/plotreddimgenes.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/qc.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/reducedims.nf
100644 → 100755
Empty file.
Empty file modified modules/local/process/scflow/reportintegrated.nf
100644 → 100755
Empty file.
Empty file modified modules/local/samplesheet_check.nf
100644 → 100755
Empty file.
Loading
Loading