Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pipeline to run with a small test dataset #35

Merged
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- Update pipeline to run with a small test dataset [#35](https://github.com/genomic-medicine-sweden/skierfe/pull/35)
- Added test data and test profile [#33](https://github.com/genomic-medicine-sweden/skierfe/pull/33)
3 changes: 3 additions & 0 deletions conf/modules/assembly_variant_calling.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
process {

withName: DIPCALL {

ext.args = '--cs'

publishDir = [
path: { "${params.outdir}/assembly_variant_calling/dipcall/${meta.id}" },
mode: params.publish_dir_mode,
Expand Down
4 changes: 4 additions & 0 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ params {
}

process {
withName: '.*:ASSEMBLY:HIFIASM' {

ext.args = '-f0'
}
withName: '.*:PHASING:WHATSHAP_PHASE' {

ext.args = '--ignore-read-groups --indels --distrust-genotypes --include-homozygous'
Expand Down
12 changes: 6 additions & 6 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"fastqc": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"git_sha": "f4ae1d942bd50c5c0b9bd2de1393ce38315ba57c",
"installed_by": ["modules"],
"patch": "modules/nf-core/fastqc/fastqc.diff"
},
Expand All @@ -75,6 +75,11 @@
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"gunzip": {
"branch": "master",
"git_sha": "3a5fef109d113b4997c9822198664ca5f2716208",
"installed_by": ["modules"]
},
"hifiasm": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
Expand Down Expand Up @@ -109,11 +114,6 @@
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"samtools/fastq": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"samtools/index": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
Expand Down
24 changes: 12 additions & 12 deletions modules/local/dipcall.nf
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ process DIPCALL {
def prefix = task.ext.prefix ?: "${meta.id}"
if(sex == '2') {
"""
minimap2 -c --paf-no-hit -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.paf.gz.log | gzip > ${prefix}.hap1.paf.gz
minimap2 -c --paf-no-hit -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.paf.gz.log | gzip > ${prefix}.hap2.paf.gz
minimap2 ${args} -c --paf-no-hit -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.paf.gz.log | gzip > ${prefix}.hap1.paf.gz
minimap2 ${args} -c --paf-no-hit -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.paf.gz.log | gzip > ${prefix}.hap2.paf.gz

minimap2 -a -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.sam.gz.log | gzip > ${prefix}.hap1.sam.gz
minimap2 -a -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.sam.gz.log | gzip > ${prefix}.hap2.sam.gz
minimap2 ${args} -a -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.sam.gz.log | gzip > ${prefix}.hap1.sam.gz
minimap2 ${args} -a -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.sam.gz.log | gzip > ${prefix}.hap2.sam.gz

gzip -dc ${prefix}.hap1.paf.gz | sort -k6,6 -k8,8n | k8 /usr/local/bin/paftools.js call - 2> ${prefix}.hap1.var.gz.vst | gzip > ${prefix}.hap1.var.gz
gzip -dc ${prefix}.hap2.paf.gz | sort -k6,6 -k8,8n | k8 /usr/local/bin/paftools.js call - 2> ${prefix}.hap2.var.gz.vst | gzip > ${prefix}.hap2.var.gz

k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap1.sam.gz | samtools sort -m4G --threads ${task.cpus/2} -o ${prefix}.hap1.bam -
k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap2.sam.gz | samtools sort -m4G --threads ${task.cpus/2} -o ${prefix}.hap2.bam -
k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap1.sam.gz | samtools sort --threads ${task.cpus} -o ${prefix}.hap1.bam -
k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap2.sam.gz | samtools sort --threads ${task.cpus} -o ${prefix}.hap2.bam -

gzip -dc ${prefix}.hap1.var.gz | grep ^R | cut -f2- > ${prefix}.hap1.bed
gzip -dc ${prefix}.hap2.var.gz | grep ^R | cut -f2- > ${prefix}.hap2.bed
Expand All @@ -69,17 +69,17 @@ process DIPCALL {
"""
} else if (sex == '1') {
"""
minimap2 -c --paf-no-hit -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.paf.gz.log | gzip > ${prefix}.hap1.paf.gz
minimap2 -c --paf-no-hit -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.paf.gz.log | gzip > ${prefix}.hap2.paf.gz
minimap2 ${args} -c --paf-no-hit -xasm5 -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.paf.gz.log | gzip > ${prefix}.hap1.paf.gz
minimap2 ${args} -c --paf-no-hit -xasm5 -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.paf.gz.log | gzip > ${prefix}.hap2.paf.gz

minimap2 -a -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.sam.gz.log | gzip > ${prefix}.hap1.sam.gz
minimap2 -a -xasm5 --cs -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.sam.gz.log | gzip > ${prefix}.hap2.sam.gz
minimap2 ${args} -a -xasm5 -t ${task.cpus} ${mmi} ${haplotype_1} 2> ${prefix}.hap1.sam.gz.log | gzip > ${prefix}.hap1.sam.gz
minimap2 ${args} -a -xasm5 -t ${task.cpus} ${mmi} ${haplotype_2} 2> ${prefix}.hap2.sam.gz.log | gzip > ${prefix}.hap2.sam.gz

gzip -dc ${prefix}.hap1.paf.gz | sort -k6,6 -k8,8n | k8 /usr/local/bin/paftools.js call - 2> ${prefix}.hap1.var.gz.vst | gzip > ${prefix}.hap1.var.gz
gzip -dc ${prefix}.hap2.paf.gz | sort -k6,6 -k8,8n | k8 /usr/local/bin/paftools.js call - 2> ${prefix}.hap2.var.gz.vst | gzip > ${prefix}.hap2.var.gz

k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap1.sam.gz | samtools sort -m4G --threads ${task.cpus} -o ${prefix}.hap1.bam -
k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap2.sam.gz | samtools sort -m4G --threads ${task.cpus} -o ${prefix}.hap2.bam -
k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap1.sam.gz | samtools sort --threads ${task.cpus} -o ${prefix}.hap1.bam -
k8 /usr/local/bin/dipcall-aux.js samflt ${prefix}.hap2.sam.gz | samtools sort --threads ${task.cpus} -o ${prefix}.hap2.bam -

gzip -dc ${prefix}.hap1.var.gz | grep ^R | cut -f2- > ${prefix}.hap1.bed
gzip -dc ${prefix}.hap2.var.gz | grep ^R | cut -f2- > ${prefix}.hap2.bed
Expand Down
12 changes: 8 additions & 4 deletions modules/local/modkit/pileup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ process MODKIT_PILEUP {
tag "$meta.id"
label 'process_high'

container "docker.io/fellen31/modkit:0.1.9"
container "docker.io/fellen31/modkit:0.2.5"

input:
tuple val(meta), path(bam), path(bai)
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
tuple val(meta4), path(bed)

output:
tuple val(meta), path("${meta.id}.bed"), emit: bed, optional: true
Expand All @@ -24,19 +25,22 @@ process MODKIT_PILEUP {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

def include_bed = bed ? "--include-bed ${bed}" : ''
"""
modkit pileup \\
$args \\
$include_bed \\
--threads ${task.cpus} \\
--ref $fasta \\
--log-filepath ${bam.baseName}.modkit.log \\
${bam} \\
${meta.id}.${bam.baseName}.bed

if test -d ${meta.id}.${bam.baseName}.bed; then
mv ${meta.id}.${bam.baseName}.bed/1.bed ${meta.id}.1.bed
mv ${meta.id}.${bam.baseName}.bed/2.bed ${meta.id}.2.bed
mv ${meta.id}.${bam.baseName}.bed/ungrouped.bed ${meta.id}.ungrouped.bed
if test -f ${meta.id}.${bam.baseName}.bed/1.bed; then mv ${meta.id}.${bam.baseName}.bed/1.bed ${meta.id}.1.bed; fi
if test -f ${meta.id}.${bam.baseName}.bed/2.bed; then mv ${meta.id}.${bam.baseName}.bed/2.bed ${meta.id}.2.bed; fi
if test -f ${meta.id}.${bam.baseName}.bed/ungrouped.bed; then mv ${meta.id}.${bam.baseName}.bed/ungrouped.bed ${meta.id}.ungrouped.bed; fi
else
mv ${meta.id}.${bam.baseName}.bed ${meta.id}.bed
fi
Expand Down
25 changes: 23 additions & 2 deletions modules/nf-core/bcftools/merge/bcftools-merge.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions modules/nf-core/bcftools/merge/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions modules/nf-core/fastqc/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions modules/nf-core/fastqc/fastqc.diff

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 17 additions & 7 deletions modules/nf-core/fastqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions modules/nf-core/fastqc/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading