Skip to content

Commit

Permalink
Merge pull request #196 from nf-cmgg/watchpath-support
Browse files Browse the repository at this point in the history
Watchpath support
  • Loading branch information
nvnieuwk authored Sep 23, 2024
2 parents a27874b + 070a9cb commit 7fc0208
Show file tree
Hide file tree
Showing 46 changed files with 568 additions and 402 deletions.
68 changes: 52 additions & 16 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,64 @@
"meta": ["family"]
},
"cram": {
"type": "string",
"pattern": "^\\S+\\.cram$",
"format": "file-path",
"exists": true
"oneOf": [
{
"type": "string",
"pattern": "^\\S+\\.cram$",
"format": "file-path",
"exists": true
},
{
"type": "string",
"pattern": "^watch:\\S+\\.cram$",
"format": "file-path"
}
]
},
"crai": {
"type": "string",
"pattern": "^\\S+\\.crai$",
"format": "file-path",
"exists": true
"oneOf": [
{
"type": "string",
"pattern": "^\\S+\\.cram\\.crai$",
"format": "file-path",
"exists": true
},
{
"type": "string",
"pattern": "^watch:\\S+\\.cram\\.crai$",
"format": "file-path"
}
]
},
"gvcf": {
"type": "string",
"pattern": "^\\S+vcf(.gz)?$",
"format": "file-path",
"exists": true
"oneOf": [
{
"type": "string",
"pattern": "^\\S+\\.g\\.vcf(\\.gz)?$",
"format": "file-path",
"exists": true
},
{
"type": "string",
"pattern": "^watch:\\S+\\.g\\.vcf(\\.gz)?$",
"format": "file-path"
}
]
},
"tbi": {
"type": "string",
"pattern": "^\\S+\\.tbi$",
"format": "file-path",
"exists": true
"oneOf": [
{
"type": "string",
"pattern": "^\\S+\\.g\\.vcf\\.gz\\.tbi$",
"format": "file-path",
"exists": true
},
{
"type": "string",
"pattern": "^watch:\\S+\\.g\\.vcf\\.gz\\.tbi?$",
"format": "file-path"
}
]
},
"roi": {
"type": "string",
Expand Down
8 changes: 4 additions & 4 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ process {
}

withName: "^.*CRAM_CALL_GENOTYPE_GATK4:GVCF_JOINT_GENOTYPE_GATK4:GATK4_GENOMICSDBIMPORT\$" {
label = { meta.family_count <= 10 ? "process_medium" : "process_high" }
label = { meta.family_samples.tokenize(",").size() <= 10 ? "process_medium" : "process_high" }
time = { 16.h * task.attempt }
// Lots of parameters are fetched from https://gatk.broadinstitute.org/hc/en-us/articles/360056138571-GenomicsDBImport-usage-and-performance-guidelines
ext.args = {
[
meta.family_count >= 100 ? "--batch-size 100" : "",
meta.family_samples.tokenize(",").size() >= 100 ? "--batch-size 100" : "",
"--overwrite-existing-genomicsdb-workspace",
"--genomicsdb-shared-posixfs-optimizations",
"--merge-input-intervals",
"--bypass-feature-reader",
"--max-num-intervals-to-import-in-parallel ${task.cpus*10}",
"--reader-threads ${task.cpus}",
meta.family_count >= 100 ? "--consolidate" : "",
meta.family_samples.tokenize(",").size() >= 100 ? "--consolidate" : "",
"--merge-contigs-into-num-partitions 25"
].join(" ")
}
Expand Down Expand Up @@ -565,7 +565,7 @@ process {
withName: "^.*VCF_ROH_AUTOMAP:AUTOMAP_AUTOMAP\$" {
ext.prefix = {"automap_${meta.caller}"}
ext.args = {[
meta.family_count > 1 ? "--multivcf" : "--id ${meta.samples}",
meta.family_samples.tokenize(",").size() > 1 ? "--multivcf" : "--id ${meta.family_samples}",
params.automap_panel_name ? "--panelname ${params.automap_panel_name}" : ""
].findAll { it != "" }.join(" ")}
publishDir = [
Expand Down
6 changes: 3 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ workflow {
}
}

callers = params.callers.tokenize(",")
def callers = params.callers.tokenize(",")
callers.each { caller ->
if(!(caller in GlobalVariables.availableCallers)) { error("\"${caller}\" is not a supported callers please use one or more of these instead: ${GlobalVariables.availableCallers}")}
}
Expand All @@ -194,7 +194,6 @@ workflow {

def multiqc_logo = params.multiqc_logo ?: "$projectDir/assets/CMGG_logo.png"

print(params.genomes)
//
// SUBWORKFLOW: Run initialisation tasks
//
Expand All @@ -208,7 +207,8 @@ workflow {
params.input,
params.ped,
params.genomes,
params.genome
params.genome,
params.watchdir
)

//
Expand Down
74 changes: 37 additions & 37 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,48 @@
"nf-core": {
"bcftools/annotate": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "88ae68490e8f2478a1e1bbeedac970fd7cc73022",
"installed_by": ["modules"],
"patch": "modules/nf-core/bcftools/annotate/bcftools-annotate.diff"
},
"bcftools/concat": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "cdf83b18471db290a28fe98c2a0852cb05864890",
"installed_by": ["vcf_annotate_ensemblvep_snpeff"]
},
"bcftools/filter": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988",
"installed_by": ["modules"]
},
"bcftools/norm": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "f6cc00f107826cfaf1c933297b10ed1757b41479",
"installed_by": ["modules"]
},
"bcftools/pluginscatter": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988",
"installed_by": ["vcf_annotate_ensemblvep_snpeff"]
},
"bcftools/query": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "34ac993e081b32d2170ab790d0386b74122f9d36",
"installed_by": ["modules"]
},
"bcftools/reheader": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "c32611ac6813055b9321d2827678e2f8aebcb394",
"installed_by": ["modules"]
},
"bcftools/sort": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "cdf83b18471db290a28fe98c2a0852cb05864890",
"installed_by": ["vcf_annotate_ensemblvep_snpeff"]
},
"bcftools/stats": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f",
"installed_by": ["modules"]
},
"bedtools/intersect": {
Expand All @@ -58,62 +58,62 @@
},
"bedtools/merge": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "a3d614e4a7b8691a259bcfe33ad80903217d6215",
"installed_by": ["modules"]
},
"bedtools/split": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "6dc8a32e32158bb4d3f9af92c802233b5d4f8e4d",
"installed_by": ["modules"]
},
"ensemblvep/download": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "54c183cba37cac58860d9967feaae54acf9cc3e0",
"installed_by": ["modules"]
},
"ensemblvep/vep": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "54c183cba37cac58860d9967feaae54acf9cc3e0",
"installed_by": ["vcf_annotate_ensemblvep_snpeff"]
},
"gatk4/calibratedragstrmodel": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "3f42e07a1133064c569b0dbe182979527bca9e59",
"installed_by": ["modules"]
},
"gatk4/composestrtablefile": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "926e2f394d01c71d3abbdbca9c588630bfe51abf",
"installed_by": ["modules"]
},
"gatk4/createsequencedictionary": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "e6fe277739f5894711405af3e717b2470bd956b5",
"installed_by": ["modules"]
},
"gatk4/genomicsdbimport": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d",
"installed_by": ["modules"]
},
"gatk4/genotypegvcfs": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "8b74c800af3d91e0d7bfbecb902308dc4369071c",
"installed_by": ["modules"]
},
"gatk4/haplotypecaller": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "c332ea831f95f750be962c4b5de655f7a1e6e245",
"installed_by": ["modules"]
},
"gawk": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "cf3ed075695639b0a0924eb0901146df1996dc08",
"installed_by": ["modules"]
},
"mosdepth": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "9bfc81874554e87740bcb3e5e07acf0a153c9ecb",
"installed_by": ["modules"]
},
"multiqc": {
Expand All @@ -128,13 +128,13 @@
},
"rtgtools/pedfilter": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "c1c2a770cfb0bfbf093a2434a27f091ebbc65987",
"installed_by": ["modules"],
"patch": "modules/nf-core/rtgtools/pedfilter/rtgtools-pedfilter.diff"
},
"rtgtools/rocplot": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "64770369d851c45c364e410e052ef9a6c3a7d2bb",
"installed_by": ["modules"]
},
"rtgtools/vcfeval": {
Expand All @@ -144,73 +144,73 @@
},
"samtools/convert": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519",
"installed_by": ["modules"]
},
"samtools/faidx": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519",
"installed_by": ["modules"]
},
"samtools/index": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "46eca555142d6e597729fcb682adcc791796f514",
"installed_by": ["modules"]
},
"samtools/merge": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519",
"installed_by": ["modules"]
},
"snpeff/snpeff": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "3ad7292d9b8da881386e9d5b58364d7da489b38b",
"installed_by": ["vcf_annotate_ensemblvep_snpeff"]
},
"somalier/extract": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "458c882987320e27fc90723ec96c127a243a5497",
"installed_by": ["modules"]
},
"somalier/relate": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "458c882987320e27fc90723ec96c127a243a5497",
"installed_by": ["modules"],
"patch": "modules/nf-core/somalier/relate/somalier-relate.diff"
},
"tabix/bgzip": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "b20be35facfc5acdc1259f132ed79339d79e989f",
"installed_by": ["modules"]
},
"tabix/bgziptabix": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "0840b387799172e77510393ed09e4d4ec1bc6d7c",
"installed_by": ["modules"]
},
"tabix/tabix": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "0840b387799172e77510393ed09e4d4ec1bc6d7c",
"installed_by": ["modules", "vcf_annotate_ensemblvep_snpeff"]
},
"untar": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d",
"installed_by": ["modules"]
},
"vardictjava": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "e61e5a13ef49c5595986bd31efb85c3f0709a282",
"installed_by": ["modules"]
},
"vcf2db": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "730f3aee80d5f8d0b5fc532202ac59361414d006",
"installed_by": ["modules"]
},
"vcfanno": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
"git_sha": "9a8bba5910982ae637dedb8664e3121db77e173f",
"installed_by": ["modules"]
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/local/automap/automap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ process AUTOMAP_AUTOMAP {
def panel_name = args.contains("--panelname") ? args.split("--panelname")[-1].trim().split(" ")[0] : ""
prefix = task.ext.prefix ?: "${meta.id}"

def create_outputs = meta.family_count > 1 ? (1..meta.family_count).collect { number ->
def create_outputs = meta.family_samples.tokenize(",").size() > 1 ? (1..meta.family_samples.tokenize(",").size()).collect { number ->
def cmd_prefix = "touch ${prefix}/sample${number}"
[
"mkdir ${prefix}/sample${number}",
Expand Down
Loading

0 comments on commit 7fc0208

Please sign in to comment.