Skip to content

Commit

Permalink
🔀 Merge pull request #54 from cnr-ibba/dev
Browse files Browse the repository at this point in the history
🔖 pipeline release v0.5.2
  • Loading branch information
bunop authored Dec 21, 2023
2 parents db2db3e + 5179306 commit f3fa36e
Show file tree
Hide file tree
Showing 121 changed files with 2,936 additions and 307 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
EditorConfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker
Expand All @@ -27,9 +27,9 @@ jobs:
Prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install Prettier
run: npm install -g prettier
Expand All @@ -40,7 +40,7 @@ jobs:
PythonBlack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check code lints with Black
uses: psf/black@stable
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out pipeline code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
Expand Down
1 change: 1 addition & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ process {
}

withName: PICARD_MARKDUPLICATES {
ext.args = "--CREATE_INDEX"
publishDir = [
path: { "${params.outdir}/bam_files" },
mode: params.publish_dir_mode,
Expand Down
32 changes: 18 additions & 14 deletions lib/NfcoreTemplate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.yaml.snakeyaml.Yaml
import groovy.json.JsonOutput
import nextflow.extension.FilesEx

class NfcoreTemplate {

Expand Down Expand Up @@ -141,12 +142,14 @@ class NfcoreTemplate {
try {
if (params.plaintext_email) { throw GroovyException('Send plaintext e-mail, not HTML') }
// Try to send HTML e-mail using sendmail
def sendmail_tf = new File(workflow.launchDir.toString(), ".sendmail_tmp.html")
sendmail_tf.withWriter { w -> w << sendmail_html }
[ 'sendmail', '-t' ].execute() << sendmail_html
log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Sent summary e-mail to $email_address (sendmail)-"
} catch (all) {
// Catch failures and try with plaintext
def mail_cmd = [ 'mail', '-s', subject, '--content-type=text/html', email_address ]
if ( mqc_report.size() <= max_multiqc_email_size.toBytes() ) {
if ( mqc_report != null && mqc_report.size() <= max_multiqc_email_size.toBytes() ) {
mail_cmd += [ '-A', mqc_report ]
}
mail_cmd.execute() << email_html
Expand All @@ -155,14 +158,16 @@ class NfcoreTemplate {
}

// Write summary e-mail HTML to a file
def output_d = new File("${params.outdir}/pipeline_info/")
if (!output_d.exists()) {
output_d.mkdirs()
}
def output_hf = new File(output_d, "pipeline_report.html")
def output_hf = new File(workflow.launchDir.toString(), ".pipeline_report.html")
output_hf.withWriter { w -> w << email_html }
def output_tf = new File(output_d, "pipeline_report.txt")
FilesEx.copyTo(output_hf.toPath(), "${params.outdir}/pipeline_info/pipeline_report.html");
output_hf.delete()

// Write summary e-mail TXT to a file
def output_tf = new File(workflow.launchDir.toString(), ".pipeline_report.txt")
output_tf.withWriter { w -> w << email_txt }
FilesEx.copyTo(output_tf.toPath(), "${params.outdir}/pipeline_info/pipeline_report.txt");
output_tf.delete()
}

//
Expand Down Expand Up @@ -227,15 +232,14 @@ class NfcoreTemplate {
// Dump pipeline parameters in a json file
//
public static void dump_parameters(workflow, params) {
def output_d = new File("${params.outdir}/pipeline_info/")
if (!output_d.exists()) {
output_d.mkdirs()
}

def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def output_pf = new File(output_d, "params_${timestamp}.json")
def filename = "params_${timestamp}.json"
def temp_pf = new File(workflow.launchDir.toString(), ".${filename}")
def jsonStr = JsonOutput.toJson(params)
output_pf.text = JsonOutput.prettyPrint(jsonStr)
temp_pf.text = JsonOutput.prettyPrint(jsonStr)

FilesEx.copyTo(temp_pf.toPath(), "${params.outdir}/pipeline_info/params_${timestamp}.json")
temp_pf.delete()
}

//
Expand Down
63 changes: 39 additions & 24 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@
"cnr-ibba": {
"bamaddrg": {
"branch": "master",
"git_sha": "603030624cc426e58d6f2d6a44ff8c7d5cb047b1",
"git_sha": "0df6dad6fccf03d5bf452766dd1ea9795654338b",
"installed_by": ["modules"]
},
"freebayes/chunk": {
"branch": "master",
"git_sha": "e28cb1426b148bd8e5459910cf3354fe2b5f8d19",
"git_sha": "03189b5139b1112cc869e8b78b3b6f82c595d4df",
"installed_by": ["modules"]
},
"freebayes/splitbam": {
"branch": "master",
"git_sha": "fa93794d74e9508fb856b35c5826a7e93fbae990",
"installed_by": ["modules"]
},
"samtools/coverage": {
"branch": "master",
"git_sha": "603030624cc426e58d6f2d6a44ff8c7d5cb047b1",
"git_sha": "03189b5139b1112cc869e8b78b3b6f82c595d4df",
"installed_by": ["modules"]
},
"seqkit/rmdup": {
"branch": "master",
"git_sha": "f4c847049adcd3135e6e67fb469af12e05952791",
"git_sha": "c101f87859323fe184912c12a17404149a2a9ddd",
"installed_by": ["modules"]
}
}
Expand All @@ -38,77 +33,97 @@
"nf-core": {
"bcftools/concat": {
"branch": "master",
"git_sha": "78cf39939fbe160a1410c44a6c5946f9a4c56e7e",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
"installed_by": ["modules"]
},
"bcftools/norm": {
"branch": "master",
"git_sha": "78cf39939fbe160a1410c44a6c5946f9a4c56e7e",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
"installed_by": ["modules"]
},
"bcftools/stats": {
"branch": "master",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
"installed_by": ["modules"]
},
"bwa/index": {
"branch": "master",
"git_sha": "9518fa4f65f3fb8cde24fde7d40333b39ec8fd65",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"bwa/mem": {
"branch": "master",
"git_sha": "cf5b9c30a2adacc581793afb79fae5f5b50bed01",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"cat/fastq": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"custom/dumpsoftwareversions": {
"branch": "master",
"git_sha": "8022c68e7403eecbd8ba9c49496f69f8c49d50f0",
"git_sha": "bba7e362e4afead70653f84d8700588ea28d0f9e",
"installed_by": ["modules"]
},
"fastqc": {
"branch": "master",
"git_sha": "3dd73937b084b547f9272bc901e0f120a7913fd8",
"git_sha": "65ad3e0b9a4099592e1102e92e10455dc661cf53",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "4ab13872435962dadc239979554d13709e20bf29",
"installed_by": ["modules"]
},
"picard/markduplicates": {
"branch": "master",
"git_sha": "eca65aa4a5e2e192ac44d6962c8f9260f314ffb8",
"git_sha": "20b0918591d4ba20047d7e13e5094bcceba81447",
"installed_by": ["modules"]
},
"samtools/coverage": {
"branch": "master",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"samtools/faidx": {
"branch": "master",
"git_sha": "cf5b9c30a2adacc581793afb79fae5f5b50bed01",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"samtools/flagstat": {
"branch": "master",
"git_sha": "cf5b9c30a2adacc581793afb79fae5f5b50bed01",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"samtools/idxstats": {
"branch": "master",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"samtools/index": {
"branch": "master",
"git_sha": "cf5b9c30a2adacc581793afb79fae5f5b50bed01",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"samtools/stats": {
"branch": "master",
"git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c",
"installed_by": ["modules"]
},
"tabix/bgzip": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"tabix/tabix": {
"branch": "master",
"git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"trimgalore": {
"branch": "master",
"git_sha": "b51a69e30973c71950225c817ad07a3337d22c40",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
}
}
Expand Down
7 changes: 7 additions & 0 deletions modules/cnr-ibba/bamaddrg/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: bamaddrg
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::bamaddrg=9baba65f88228e55639689a3cea38dd150e6284f
4 changes: 2 additions & 2 deletions modules/cnr-ibba/bamaddrg/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ process BAMADDRG {
tag "$meta.id"
label 'process_low'

conda (params.enable_conda ? "bioconda::bamaddrg=9baba65f88228e55639689a3cea38dd150e6284f" : null)
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bamaddrg:9baba65f88228e55639689a3cea38dd150e6284f--ha89c123_1':
'quay.io/biocontainers/bamaddrg:9baba65f88228e55639689a3cea38dd150e6284f--ha89c123_1' }"
'biocontainers/bamaddrg:9baba65f88228e55639689a3cea38dd150e6284f--ha89c123_1' }"

input:
tuple val(meta), path(bam)
Expand Down
7 changes: 5 additions & 2 deletions modules/cnr-ibba/bamaddrg/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: "bamaddrg"
description: adds read groups to input BAM files
keywords:
- sort
- add
- read
- group
- bam
tools:
- "bamaddrg":
description: "Add read group to BAM files"
homepage: "https://github.com/ekg/bamaddrg"
documentation: "https://github.com/ekg/bamaddrg"
tool_dev_url: "https://github.com/ekg/bamaddrg"
doi: ""
licence: "['MIT']"
licence: ["MIT"]

input:
# Only when we have meta
Expand Down
7 changes: 7 additions & 0 deletions modules/cnr-ibba/freebayes/chunk/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: freebayes_chunk
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::freebayes=1.3.6
16 changes: 8 additions & 8 deletions modules/cnr-ibba/freebayes/chunk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ process FREEBAYES_CHUNK {
label 'process_low'
label 'error_retry'

conda (params.enable_conda ? "bioconda::freebayes=1.3.6" : null)
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/freebayes:1.3.6--hb089aa1_0':
'quay.io/biocontainers/freebayes:1.3.6--hb089aa1_0' }"
'biocontainers/freebayes:1.3.6--hb089aa1_0' }"

input:
tuple val(meta), val(region)
tuple val(sample_meta), path(bam)
tuple val(sample_meta), path(bai)
tuple val(sample_meta), path(bam_list)
path(genome_fasta)
path(genome_fasta_fai)
tuple val(meta), val(region)
tuple val(meta2), path(bam)
tuple val(meta2), path(bai)
tuple val(meta2), path(bam_list)
tuple val(meta3), path(genome_fasta)
tuple val(meta3), path(genome_fasta_fai)

output:
tuple val(meta), path("*.vcf.gz") , emit: vcf
Expand Down
Loading

0 comments on commit f3fa36e

Please sign in to comment.