Skip to content

Commit

Permalink
bambu 3.2.4 & bam inputs for DNA variant calling
Browse files Browse the repository at this point in the history
  • Loading branch information
yuukiiwa committed Sep 18, 2024
1 parent be55066 commit 266d37c
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 31 deletions.
30 changes: 30 additions & 0 deletions conf/test_nobc_nodx_noaln_vc.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* -------------------------------------------------
* Nextflow config file for running tests
* -------------------------------------------------
* Defines bundled input files and everything required
* to run a fast and simple test. Use as follows:
* nextflow run nf-core/nanoseq -profile test_nobc_nodx_vc,<docker/singularity>
*/

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check variant calling functions'

// Limit resources so that this can run on Travis
max_cpus = 2
max_memory = 6.GB
max_time = 12.h

// Input data to skip demultiplexing and variant call
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/nanoseq/3.2/samplesheet/samplesheet_nobc_nodx_noaln_vc.csv'
fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/nanoseq/reference/hg19_KCMF1.fa'
skip_basecalling = true
protocol = 'DNA'
skip_alignment = true
skip_quantification = true
skip_demultiplexing = true
call_variants = true
variant_caller = 'clair3'
structural_variant_caller = 'sniffles'
}
4 changes: 2 additions & 2 deletions modules/local/bambu.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ process BAMBU {

conda "conda-forge::r-base=4.0.3 bioconda::bioconductor-bambu=3.0.8 bioconda::bioconductor-bsgenome=1.66.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bioconductor-bambu:3.0.8--r42hc247a5b_0' :
'quay.io/biocontainers/bioconductor-bambu:3.0.8--r42hc247a5b_0' }"
'https://depot.galaxyproject.org/singularity/bioconductor-bambu:3.2.4--r43hf17093f_0' :
'quay.io/biocontainers/bioconductor-bambu:3.2.4--r43hf17093f_0' }"

input:
tuple path(fasta), path(gtf)
Expand Down
29 changes: 29 additions & 0 deletions modules/local/blue-crab.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
process BLUE_CRAB {
tag "$meta.id"
label 'process_medium'

conda "bioconda::slow5tools==1.2.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/slow5tools:1.2.0--h56e2c18_1' :
'quay.io/biocontainers/slow5tools:1.2.0--h56e2c18_1' }"

input:
tuple val(meta), path(genome), path(gtf), path(fastq), path(bam), path(bai), path(pod5)

output:
tuple val(meta), path(genome), path(gtf), path(fastq), path(bam), path(bai), path(blow5), emit: nanopolish_outputs
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
"""
blue-crab p2s $pod5 -o $blow5
cat <<-END_VERSIONS > versions.yml
"${task.process}":
blue-crab: \$( blue-crab -V | tail -c 6 )
END_VERSIONS
"""
}
27 changes: 27 additions & 0 deletions modules/local/modkit_bedmethyl.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
process DORADO {
tag "$meta.id"
label 'process_medium'

container "modkit"

input:
tuple val(meta), path(mod_bam)

output:
tuple val(meta), path("*.bed") , emit: bedmethyl
path "versions.yml" , emit: versions

script:
bedmethyl = "$meta.id" +".bed"
"""
modkit pileup $mod_bam $bedmethyl
cat <<-END_VERSIONS > versions.yml
"${task.process}":
dorado: \$(echo \$(dorado --version 2>&1) | sed -r 's/.{81}//')
END_VERSIONS
gzip basecall.fastq
"""
}

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ profiles {
test_nobc_nodx_stringtie { includeConfig 'conf/test_nobc_nodx_stringtie.config' }
test_nobc_nodx_noaln { includeConfig 'conf/test_nobc_nodx_noaln.config' }
test_nobc_nodx_vc { includeConfig 'conf/test_nobc_nodx_vc.config' }
test_nobc_nodx_noaln_vc { includeConfig 'conf/test_nobc_nodx_noaln_vc.config' }
test_nobc_nodx_rnamod { includeConfig 'conf/test_nobc_nodx_rnamod.config' }
}

Expand Down
63 changes: 34 additions & 29 deletions workflows/nanoseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ include { QCAT } from '../modules/nf-core/qcat/main'
include { NANOLYSE } from '../modules/nf-core/nanolyse/main'
include { CUSTOM_GETCHROMSIZES } from '../modules/nf-core/custom/getchromsizes/main'
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main'
include { SAMTOOLS_INDEX } from '../modules/nf-core/samtools/index/main'

/*
* SUBWORKFLOW: Consisting entirely of nf-core/modules
Expand Down Expand Up @@ -335,18 +336,18 @@ workflow NANOSEQ{
ch_fastqc_multiqc = QCFASTQ_NANOPLOT_FASTQC.out.fastqc_multiqc.ifEmpty([])
}

ch_samtools_multiqc = Channel.empty()
if (!params.skip_alignment) {
ch_fasta = Channel.from( [id:'reference'], fasta ).collect()

ch_fasta = Channel.from( [id:'reference'], fasta ).collect()
/*
* SUBWORKFLOW: Make chromosome size file and covert GTF to BED12
*/
CUSTOM_GETCHROMSIZES( ch_fasta )
ch_chr_sizes = CUSTOM_GETCHROMSIZES.out.sizes
ch_fai = CUSTOM_GETCHROMSIZES.out.fai
ch_software_versions = ch_software_versions.mix(CUSTOM_GETCHROMSIZES.out.versions.first().ifEmpty(null))

/*
* SUBWORKFLOW: Make chromosome size file and covert GTF to BED12
*/
CUSTOM_GETCHROMSIZES( ch_fasta )
ch_chr_sizes = CUSTOM_GETCHROMSIZES.out.sizes
ch_fai = CUSTOM_GETCHROMSIZES.out.fai
ch_software_versions = ch_software_versions.mix(CUSTOM_GETCHROMSIZES.out.versions.first().ifEmpty(null))
ch_samtools_multiqc = Channel.empty()
if (!params.skip_alignment) {

if (params.aligner == 'minimap2') {

Expand All @@ -370,25 +371,6 @@ workflow NANOSEQ{
ch_software_versions = ch_software_versions.mix(ALIGN_GRAPHMAP2.out.samtools_version.first().ifEmpty(null))
}

if (params.call_variants && params.protocol == 'DNA') {

/*
* SUBWORKFLOW: Short variant calling
*/
if (!params.skip_vc) {
SHORT_VARIANT_CALLING ( ch_sorted_bam, ch_sorted_bai, ch_fasta, ch_fai )
ch_software_versions = ch_software_versions.mix(SHORT_VARIANT_CALLING.out.ch_versions.first().ifEmpty(null))
}

/*
* SUBWORKFLOW: Structural variant calling
*/
if (!params.skip_sv) {
STRUCTURAL_VARIANT_CALLING ( ch_sorted_bam, ch_sorted_bai, ch_fasta, ch_fai )
ch_software_versions = ch_software_versions.mix(STRUCTURAL_VARIANT_CALLING.out.ch_versions.first().ifEmpty(null))
}
}

ch_bedtools_version = Channel.empty()
if (!params.skip_bigwig) {

Expand Down Expand Up @@ -420,6 +402,29 @@ workflow NANOSEQ{
ch_sorted_bam = BAM_RENAME.out.bam
}

if (params.call_variants && params.protocol == 'DNA') {

SAMTOOLS_INDEX ( ch_sorted_bam )
ch_sorted_bai = SAMTOOLS_INDEX.out.bai
samtools_version = SAMTOOLS_INDEX.out.versions

/*
* SUBWORKFLOW: Short variant calling
*/
if (!params.skip_vc) {
SHORT_VARIANT_CALLING ( ch_sorted_bam, ch_sorted_bai, ch_fasta, ch_fai )
ch_software_versions = ch_software_versions.mix(SHORT_VARIANT_CALLING.out.ch_versions.first().ifEmpty(null))
}

/*
* SUBWORKFLOW: Structural variant calling
*/
if (!params.skip_sv) {
STRUCTURAL_VARIANT_CALLING ( ch_sorted_bam, ch_sorted_bai, ch_fasta, ch_fai )
ch_software_versions = ch_software_versions.mix(STRUCTURAL_VARIANT_CALLING.out.ch_versions.first().ifEmpty(null))
}
}

ch_featurecounts_gene_multiqc = Channel.empty()
ch_featurecounts_transcript_multiqc = Channel.empty()
if (!params.skip_quantification && (params.protocol == 'cDNA' || params.protocol == 'directRNA')) {
Expand Down

0 comments on commit 266d37c

Please sign in to comment.