Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7cb5d69
aucell script
allyhawkins Feb 27, 2025
f74c4e5
workflow and params for ewing cell typing
allyhawkins Feb 27, 2025
9496729
ewing readme
allyhawkins Feb 27, 2025
0d50838
account for not enough gene overlap
allyhawkins Feb 27, 2025
f466c5e
add params to schema
allyhawkins Feb 27, 2025
95e0f6c
write the output not read
allyhawkins Feb 27, 2025
b8e0d84
fix a typo
allyhawkins Feb 27, 2025
82ae052
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 27, 2025
70af9fe
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
allyhawkins Feb 27, 2025
e9516ba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 27, 2025
85cd5b1
temporarily turn off auto fix PRs
allyhawkins Feb 27, 2025
2dc78ec
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
allyhawkins Feb 27, 2025
039b0a7
add typos rule for aucThr
jashapiro Feb 28, 2025
a2a4034
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 28, 2025
90d9ff0
use identifier, not word
jashapiro Feb 28, 2025
aae0ad3
don't need to redefine types
jashapiro Feb 28, 2025
08c5bee
Merge pull request #132 from AlexsLemonade/jashapiro/typos-thr
jashapiro Feb 28, 2025
88a7e5f
use v0.2.2
allyhawkins Feb 28, 2025
6bc6594
name output
allyhawkins Feb 28, 2025
3c60e89
use correct tagged link
allyhawkins Feb 28, 2025
38b5423
add descriptions to schema
allyhawkins Feb 28, 2025
981aef5
Merge remote-tracking branch 'origin/allyhawkins/ewing-cell-types-par…
allyhawkins Feb 28, 2025
46006c1
don't comment out other modules
allyhawkins Feb 28, 2025
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ repos:
- id: style-files
- id: parsable-R
ci:
autofix_prs: true
autofix_prs: false
autoupdate_schedule: quarterly
4 changes: 4 additions & 0 deletions config/containers.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ params{

// cell-type-consensus module
consensus_cell_type_container = 'public.ecr.aws/openscpca/cell-type-consensus:v0.2.2'

// cell-type-ewings module
cell_type_ewing_container = 'public.ecr.aws/openscpca/cell-type-ewings:v0.2.2'

}
5 changes: 5 additions & 0 deletions config/module_params.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ params{
cell_type_consensus_ref_file = 'https://raw.githubusercontent.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.2/analyses/cell-type-consensus/references/consensus-cell-type-reference.tsv'
cell_type_consensus_marker_gene_ref_file = 'https://raw.githubusercontent.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.2/analyses/cell-type-consensus/references/validation-markers.tsv'

// cell type ewings
cell_type_ewings_auc_max_rank = 425 // 1% of the total detected genes in the merged object, equivalent to the value used to obtain assignments in OpenScPCA-analysis
cell_type_ewings_msigdb_list = 'https://raw.githubusercontent.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.2/analyses/cell-type-ewings/references/msigdb-gene-sets.tsv'
cell_type_ewings_ews_high_list = 'https://raw.githubusercontent.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.2/analyses/cell-type-ewings/references/gene_signatures/aynaud-ews-targets.tsv'
cell_type_ewings_ews_low_list = 'https://raw.githubusercontent.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.2/analyses/cell-type-ewings/references/gene_signatures/wrenn-nt5e-genes.tsv'
}
12 changes: 8 additions & 4 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include { merge_sce } from './modules/merge-sce'
include { detect_doublets } from './modules/doublet-detection'
include { seurat_conversion } from './modules/seurat-conversion'
include { cell_type_consensus } from './modules/cell-type-consensus'
include { cell_type_ewings } from './modules/cell-type-ewings'

// **** Parameter checks ****
include { validateParameters; paramsSummaryLog } from 'plugin/nf-schema'
Expand Down Expand Up @@ -52,14 +53,17 @@ workflow {
.filter{ run_all || it[1] in project_ids }

// Run the merge workflow
merge_sce(sample_ch)
//merge_sce(sample_ch)

// Run the doublet detection workflow
detect_doublets(sample_ch)
//detect_doublets(sample_ch)

// Run the seurat conversion workflow
seurat_conversion(sample_ch)
//seurat_conversion(sample_ch)

// Run the consensus cell type workflow
cell_type_consensus(sample_ch)
//cell_type_consensus(sample_ch)

// Run the cell type ewings workflow
cell_type_ewings(sample_ch)
}
13 changes: 13 additions & 0 deletions modules/cell-type-ewings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This module assigns cell types to all Ewing sarcoma samples in `SCPCP000015`.

Scripts are derived from the the `cell-type-ewings` module of the [OpenScPCA-analysis](https://github.com/AlexsLemonade/OpenScPCA-analysis) repository.

Links to specific original scripts used in this module:

- `01-aucell.R`: <https://github.com/AlexsLemonade/OpenScPCA-analysis/blob/main/analyses/cell-type-ewings/scripts/aucell-ews-signatures/01-aucell.R>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a tag or permalink here, please.


This module also uses the following reference files found in the `OpenScPCA-analysis` repository:

- `aynaud-ews-targets.tsv` : <https://github.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.1/analyses/cell-type-ewings/references/gene_signatures/aynaud-ews-targets.tsv>
- `wrenn-nt5e-genes.tsv`: <https://github.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.1/analyses/cell-type-ewings/references/gene_signatures/wrenn-nt5e-genes.tsv>
- `msigdb-gene-sets.tsv`: <https://github.com/AlexsLemonade/OpenScPCA-analysis/refs/tags/v0.2.1/analyses/cell-type-ewings/references/msigdb-gene-sets.tsv>
80 changes: 80 additions & 0 deletions modules/cell-type-ewings/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env nextflow

// Workflow to assign consensus cell type labels

process ewing_aucell {
container params.cell_type_ewing_container
tag "${project_id}"
label 'mem_8'
publishDir "${params.results_bucket}/${params.release_prefix}/cell-type-ewings/${project_id}/${sample_id}", mode: 'copy'
input:
tuple val(sample_id),
val(project_id),
path(library_files)
val auc_max_rank
path msigdb_list
path ews_high_list
path ews_low_list
output:
tuple val(sample_id),
val(project_id),
path(aucell_output_files)
script:
aucell_output_files = library_files
.collect{
it.name.replaceAll(/(?i).rds$/, "_ewing-aucell-results.tsv.gz")
}
// combine the custom gene sets into a single input
custom_geneset_files = [ews_high_list, ews_low_list].join(",")
"""
for file in ${library_files}; do
aucell.R \
--sce_file \$file \
--custom_geneset_files ${custom_geneset_files} \
--msigdb_genesets ${msigdb_list} \
--max_rank_threshold ${auc_max_rank} \
--output_file \$(basename \${file%.rds}_ewing-aucell-results.tsv.gz) \
--threads ${task.cpus} \
--seed 2025
done
"""

stub:
aucell_output_files = library_files
.collect{
it.name.replaceAll(/(?i).rds$/, "_ewing-aucell-results.tsv.gz")
}
"""
for file in ${library_files}; do
touch \$(basename \${file%.rds}_ewing-aucell-results.tsv.gz)
done
"""
}



workflow cell_type_ewings {
take:
sample_ch // [sample_id, project_id, sample_path]
main:
// create [sample_id, project_id, [list of processed files]]
libraries_ch = sample_ch
.map{sample_id, project_id, sample_path ->
def library_files = Utils.getLibraryFiles(sample_path, format: "sce", process_level: "processed")
return [sample_id, project_id, library_files]
}
// only run on SCPCP000015 with Ewing sarcoma samples
.filter{ it[1] == "SCPCP000015" }

// run aucell on ewing gene sets
ewing_aucell(
libraries_ch,
params.cell_type_ewings_auc_max_rank,
file(params.cell_type_ewings_msigdb_list),
file(params.cell_type_ewings_ews_high_list),
file(params.cell_type_ewings_ews_low_list)
)

emit:
ewing_aucell.out // [sample_id, project_id, [list of aucell_output_files]]
}
Loading