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

Adapt vcf to scout #127

Merged
merged 11 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Parameters

| Old parameter | New parameter |
| ------------- | ------------- |

:::note
Parameter has been updated if both old and new parameter information is present.
Parameter has been added if just the new parameter information is present.
Parameter has been removed if new parameter information isn't present.
:::

## 2.0.2 - [XXXX-XX-XX]

### `Added`

Lucpen marked this conversation as resolved.
Show resolved Hide resolved
- Installed bcftools/norm [#127](https://github.com/genomic-medicine-sweden/tomte/pull/127)
- Installed bcftools/annotate [#127](https://github.com/genomic-medicine-sweden/tomte/pull/127)

### `Fixed`

- One line per call on vcf to make vcf suitable for Scout [#127](https://github.com/genomic-medicine-sweden/tomte/pull/127)
- Added variant caller to vcf to make vcf suitable for Scout [#127](https://github.com/genomic-medicine-sweden/tomte/pull/127)
- Normalised calls in vcf [#127](https://github.com/genomic-medicine-sweden/tomte/pull/127)

### `Parameters`

### `Changed`

- Updated template to v2.14.1 [#123](https://github.com/genomic-medicine-sweden/tomte/pull/123)

## 2.0.1 - Grinch [2024-04-25]

### `Added`
Expand Down
1 change: 1 addition & 0 deletions assets/foundin.hdr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
##INFO=<ID=FOUND_IN,Number=1,Type=String,Description="Program that called the variant">
18 changes: 12 additions & 6 deletions conf/modules/allele_specific_calling.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,33 @@ process {
withName: '.*ALLELE_SPECIFIC_CALLING:BCFTOOLS_MERGE' {
ext.args = '--output-type z'
ext.prefix = { "${meta.id}" }
publishDir = [
path: { "${params.outdir}/bootstrapann" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*ALLELE_SPECIFIC_CALLING:RENAME_FILES' {
ext.prefix = { "${meta.id}" }
}

withName: '.*ALLELE_SPECIFIC_CALLING:SPLIT_MULTIALLELICS' {
ext.prefix = { "${meta.id}_norm" }
ext.args = '--output-type z --multiallelics -both'
}

withName: '.*ALLELE_SPECIFIC_CALLING:REMOVE_DUPLICATES' {
ext.args = '--output-type z --rm-dup none'
ext.prefix = { "${meta.id}_split_rmdup" }
publishDir = [
path: { "${params.outdir}/bootstrapann" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
Lucpen marked this conversation as resolved.
Show resolved Hide resolved
]
}

withName: '.*ALLELE_SPECIFIC_CALLING:TABIX_TABIX' {
withName: '.*ALLELE_SPECIFIC_CALLING:TABIX_REMOVE_DUP' {
publishDir = [
path: { "${params.outdir}/bootstrapann" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

}
32 changes: 32 additions & 0 deletions conf/modules/call_variants.config
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,37 @@ process {
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}
withName: '.*CALL_VARIANTS:SPLIT_MULTIALLELICS' {
ext.prefix = { "${meta.id}_norm" }
ext.args = '--output-type z --multiallelics -both'
}

withName: '.*CALL_VARIANTS:REMOVE_DUPLICATES' {
ext.args = '--output-type z --rm-dup none'
ext.prefix = { "${meta.id}_split_rmdup" }
}

withName: '.*CALL_VARIANTS:ADD_VARCALLER_TO_BED' {
ext.args2 = '-s 1 -b 2 -e 3'
}

withName: '.*CALL_VARIANTS:BCFTOOLS_ANNOTATE' {
ext.args = "-c CHROM,FROM,TO,FOUND_IN --output-type z"
ext.prefix = { "${meta.id}_split_rmdup_info" }
publishDir = [
path: { "${params.outdir}/call_variants" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: '.*CALL_VARIANTS:TABIX_ANNOTATE' {
publishDir = [
path: { "${params.outdir}/call_variants" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}


}
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"bcftools/annotate": {
"branch": "master",
"git_sha": "2ad29c2aed06d815d9f68ad7ba20b3b1c574ce9c",
"installed_by": ["modules"]
},
"bcftools/index": {
"branch": "master",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
Expand All @@ -21,6 +26,11 @@
"installed_by": ["modules"],
"patch": "modules/nf-core/bcftools/mpileup/bcftools-mpileup.diff"
},
"bcftools/norm": {
"branch": "master",
"git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09",
"installed_by": ["modules"]
},
"bcftools/stats": {
"branch": "master",
"git_sha": "618364f55cb88f6c283f6c6c45c24d5f9f08f998",
Expand Down
47 changes: 47 additions & 0 deletions modules/local/add_varcallername_to_bed.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
process ADD_VARCALLER_TO_BED {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' :
'biocontainers/tabix:1.11--hdfd78af_0' }"

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

output:
tuple val(meta), path("*.gz"), path("*.tbi"), emit: gz_tbi
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def variant_caller = "${meta.id}"
"""
awk '{print \$1"\t0\t"\$2"\t$variant_caller\"}' $chromsizes > ${variant_caller}.bed
bgzip --threads ${task.cpus} -c $args ${variant_caller}.bed > ${prefix}.bed.gz
tabix $args2 ${prefix}.bed.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bed.gz
touch ${prefix}.bed.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
}
7 changes: 7 additions & 0 deletions modules/nf-core/bcftools/annotate/environment.yml

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

65 changes: 65 additions & 0 deletions modules/nf-core/bcftools/annotate/main.nf

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

56 changes: 56 additions & 0 deletions modules/nf-core/bcftools/annotate/meta.yml

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

6 changes: 6 additions & 0 deletions modules/nf-core/bcftools/annotate/tests/bcf.config

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

Loading