Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Feature/310 config migration #314

Merged
merged 36 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
44cdfaf
[utils] Add new generic function to extract params of given tools. Th…
dweemx Feb 12, 2021
1ae30c0
Migrate to params.tools for scanpy and file_converter tools
dweemx Feb 12, 2021
b0f5c4e
Migrate to params.tools for celda tool
dweemx Feb 12, 2021
047eb44
Migrate to params.tools for cellranger tool
dweemx Feb 12, 2021
51d4f1d
Migrate to params.tools for directs tool
dweemx Feb 12, 2021
bce499d
Migrate to params.tools for dropletutils tool
dweemx Feb 12, 2021
75c591d
Migrate to params.tools for dropseqtools tool
dweemx Feb 12, 2021
2a54dcb
Migrate to params.tools for edirect tool
dweemx Feb 12, 2021
039dd82
Migrate to params.tools for fastp tool
dweemx Feb 12, 2021
e55385f
Migrate to params.tools for flybaser tool
dweemx Feb 17, 2021
fbc446b
Migrate to params.tools for harmony tool
dweemx Feb 17, 2021
f8d2f07
Migrate to params.tools for pcacv tool
dweemx Feb 17, 2021
b6ea3d3
Migrate to params.tools for picard tool
dweemx Feb 17, 2021
2bc48cb
Migrate to params.tools for popscle tool
dweemx Feb 17, 2021
625c4e6
Migrate to params.tools for scenic tool
dweemx Feb 17, 2021
bf1e64c
Migrate to params.tools for scrublet tool
dweemx Feb 17, 2021
bc4f6b9
Migrate to params.tools for soupx tool
dweemx Feb 17, 2021
8db2dbe
Migrate to params.tools for sratoolkit tool
dweemx Feb 17, 2021
04ec07b
Migrate to params.tools for star tool
dweemx Feb 17, 2021
cb30bbb
Migrate to params.tools for cellranger-(atac) tools
dweemx Feb 17, 2021
c59656e
Migrate to params.tools for utils and docs
dweemx Feb 17, 2021
c08fa3b
Temp switch back to params.sc for CI
dweemx Feb 17, 2021
94f273d
Temp switch back to params.sc for CI (2): forgot scrublet, decontx co…
dweemx Feb 17, 2021
5a4cd3e
Fix to avoid Variable `params` already defined in the process scope
dweemx Feb 17, 2021
d0ec719
Other missed conversions: from params\.tools\.([a-z_]+) to params.get…
dweemx Feb 17, 2021
b64291d
Other fixes: params.tools left in scrublet and decontx plus add fix t…
dweemx Feb 17, 2021
e8b377d
Move to new config structure: from params.sc to params.tools. Decided…
dweemx Feb 17, 2021
32ef310
misc config entry was wrongly renamed
dweemx Feb 17, 2021
b7b250c
scope utils config under params.utils
dweemx Feb 17, 2021
a9907ca
Remove the use of backward compatible functions
dweemx Feb 17, 2021
e0ee972
Fix typo and fix test__cell_annotate_filter config
dweemx Feb 17, 2021
ee62d32
Other fixes in notebooks to access params.tools and fix bug getting c…
dweemx Feb 17, 2021
e045e72
Add fixes for scrublet and decontx
dweemx Feb 17, 2021
7ad6de1
Add missing import
dweemx Feb 17, 2021
b3d2cd3
Migrate missing config access for sratoolkit and
dweemx Jul 9, 2021
19e944c
Fix test config for harmony_scenic pipeline
dweemx Jul 9, 2021
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
5 changes: 5 additions & 0 deletions conf/generic.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import static groovy.json.JsonOutput.*

params {
breakPrettyPrintMap = { p ->
throw new Exception(prettyPrint(toJson(p)))
}
// This closure facilitates the usage of sample specific parameters
parseConfig = { sample, paramsGlobal, paramsLocal ->
def lv = { a,b -> return org.codehaus.groovy.runtime.MethodRankHelper.delDistance(a, b) }
Expand Down
2 changes: 1 addition & 1 deletion conf/nemesh.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ params {
qsubaccount = ''
}

sc {
tools {
nemesh {
// User can extract custom cell barcodes by providing it with a TSV containing all the barcodes
// custom_selected_barcodes = ''
Expand Down
5 changes: 1 addition & 4 deletions conf/test__bbknn.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = "testdata/*/outs/"
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__bbknn_scenic.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = "testdata/*/outs/"
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
10 changes: 6 additions & 4 deletions conf/test__cell_annotate_filter.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
tools {
scanpy {
container = 'vibsinglecellnf/scanpy:1.8.1'
}
}
utils {
file_converter {
off = 'h5ad'
tagCellWithSampleId = false
useFilteredMatrix = true
makeVarIndexUnique = false
}
scanpy {
container = 'vibsinglecellnf/scanpy:1.8.1'
}
cell_annotate {
off = 'h5ad'
method = 'aio'
Expand Down
5 changes: 1 addition & 4 deletions conf/test__decontx.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
celda {
container = 'vibsinglecellnf/celda:1.4.5'
decontx {
Expand Down
5 changes: 1 addition & 4 deletions conf/test__harmony.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = "testdata/*/outs/"
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
7 changes: 6 additions & 1 deletion conf/test__harmony_scenic.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ params {
cellranger_mex = "testdata/*/outs/"
}
}
sc {
utils {
file_annotator {
metadataFilePath = ''
}
}
tools {
file_annotator {
metadataFilePath = ''
}
Expand Down
5 changes: 1 addition & 4 deletions conf/test__mnncorrect.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = "testdata/*/outs/"
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
2 changes: 1 addition & 1 deletion conf/test__scenic.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ params {
global {
project_name = 'scenic_CI'
}
sc {
tools {
file_annotator {
metadataFilePath = ''
}
Expand Down
5 changes: 1 addition & 4 deletions conf/test__scenic_multiruns.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ params {
global {
project_name = 'scenic_multiruns_CI'
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scenic {
filteredLoom = 'https://raw.githubusercontent.com/aertslab/SCENICprotocol/master/example/expr_mat_small.loom'
grn {
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_decontx_correct.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_decontx_correct_scrublet.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_decontx_filter.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_param_exploration.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_scenic.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_scenic_multiruns.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
5 changes: 1 addition & 4 deletions conf/test__single_sample_scrublet.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ params {
cellranger_mex = 'sample_data/outs'
}
}
sc {
file_annotator {
metadataFilePath = ''
}
tools {
scanpy {
filter {
cellFilterMinNGenes = 1
Expand Down
26 changes: 13 additions & 13 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Steps:
.. code:: groovy

params {
sc {
tools {
harmony {
container = 'vibsinglecellnf/harmony:1.0'
report_ipynb = "${params.misc.test.enabled ? '../../..' : ''}/src/harmony/bin/reports/sc_harmony_report.ipynb"
Expand Down Expand Up @@ -239,7 +239,7 @@ Steps:

process SC__HARMONY__HARMONY_MATRIX {

container params.sc.harmony.container
container params.tools.harmony.container
publishDir "${params.global.outdir}/data/intermediate", mode: 'symlink'
clusterOptions "-l nodes=1:ppn=${params.global.threads} -l walltime=1:00:00 -A ${params.global.qsubaccount}"

Expand All @@ -250,7 +250,7 @@ Steps:
tuple val(sampleId), path("${sampleId}.SC__HARMONY__HARMONY_MATRIX.tsv")

script:
def sampleParams = params.parseConfig(sampleId, params.global, params.sc.harmony)
def sampleParams = params.parseConfig(sampleId, params.global, params.tools.harmony)
processParams = sampleParams.local
varsUseAsArguments = processParams.varsUse.collect({ '--vars-use' + ' ' + it }).join(' ')
"""
Expand Down Expand Up @@ -364,7 +364,7 @@ Steps:

// Run clustering
// Define the parameters for clustering
def clusteringParams = SC__SCANPY__CLUSTERING_PARAMS( clean(params.sc.scanpy.clustering) )
def clusteringParams = SC__SCANPY__CLUSTERING_PARAMS( clean(params.tools.scanpy.clustering) )
CLUSTER_IDENTIFICATION(
normalizedTransformedData,
DIM_REDUCTION_TSNE_UMAP.out.dimred_tsne_umap,
Expand Down Expand Up @@ -400,7 +400,7 @@ Steps:
)
harmony_report = GENERATE_DUAL_INPUT_REPORT(
becDualDataPrePost,
file(workflow.projectDir + params.sc.harmony.report_ipynb),
file(workflow.projectDir + params.tools.harmony.report_ipynb),
"SC_BEC_HARMONY_report",
clusteringParams.isParameterExplorationModeOn()
)
Expand Down Expand Up @@ -490,10 +490,10 @@ Steps:
SC__FILE_CONVERTER | \
FILTER_AND_ANNOTATE_AND_CLEAN

if(params.sc.scanpy.containsKey("filter")) {
if(params.tools.scanpy.containsKey("filter")) {
out = QC_FILTER( out ).filtered // Remove concat
}
if(params.sc.containsKey("file_concatenator")) {
if(params.utils.file_concatenator) {
out = SC__FILE_CONCATENATOR(
out.map {
it -> it[1]
Expand All @@ -502,7 +502,7 @@ Steps:
)
)
}
if(params.sc.scanpy.containsKey("data_transformation") && params.sc.scanpy.containsKey("normalization")) {
if(params.tools.scanpy.containsKey("data_transformation") && params.tools.scanpy.containsKey("normalization")) {
out = NORMALIZE_TRANSFORM( out )
}
out = HVG_SELECTION( out )
Expand All @@ -527,7 +527,7 @@ Steps:

// Conversion
// Convert h5ad to X (here we choose: loom format)
if(params.sc.containsKey("file_concatenator")) {
if(params.utils?.file_concatenator) {
filteredloom = SC__H5AD_TO_FILTERED_LOOM( SC__FILE_CONCATENATOR.out )
scopeloom = FILE_CONVERTER(
BEC_HARMONY.out.data.groupTuple(),
Expand All @@ -552,7 +552,7 @@ Steps:

// Collect the reports:
// Define the parameters for clustering
def clusteringParams = SC__SCANPY__CLUSTERING_PARAMS( clean(params.sc.scanpy.clustering) )
def clusteringParams = SC__SCANPY__CLUSTERING_PARAMS( clean(params.tools.scanpy.clustering) )
// Pairing clustering reports with bec reports
if(!clusteringParams.isParameterExplorationModeOn()) {
clusteringBECReports = BEC_HARMONY.out.cluster_report.map {
Expand Down Expand Up @@ -722,8 +722,8 @@ Workflows import multiple processes and define the workflow by name:
workflow CELLRANGER {

main:
SC__CELLRANGER__MKFASTQ(file(params.sc.cellranger.mkfastq.csv), path(params.sc.cellranger.mkfastq.runFolder))
SC__CELLRANGER__COUNT(file(params.sc.cellranger.count.transcriptome), SC__CELLRANGER__MKFASTQ.out.flatten())
SC__CELLRANGER__MKFASTQ(file(params.tools.cellranger.mkfastq.csv), path(params.tools.cellranger.mkfastq.runFolder))
SC__CELLRANGER__COUNT(file(params.tools.cellranger.count.transcriptome), SC__CELLRANGER__MKFASTQ.out.flatten())
emit:
SC__CELLRANGER__COUNT.out

Expand Down Expand Up @@ -775,7 +775,7 @@ The parameter structure internally (post-merge) is:
project_name = "MCF7"
...
}
sc {
tools {
utils {
file_converter {
...
Expand Down
Loading