Skip to content

Commit

Permalink
Merge pull request #6 from BertGalle/vcf-convert
Browse files Browse the repository at this point in the history
VCF convert + VEP
  • Loading branch information
ToonRosseel authored May 15, 2024
2 parents 33b2886 + fb5fed5 commit 4d3595a
Show file tree
Hide file tree
Showing 53 changed files with 1,731 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
# For example: adding multiple test runs with different parameters
# Remember that you can parallelise this by using strategy.matrix
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results -stub
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![nf-core/exomecnv](docs/images/nfcore-exomecnv_logo.png)
[![GitHub Actions CI Status](https://github.com/nf-cmgg/exomecnv/actions/workflows/ci.yml/badge.svg)](https://github.com/nf-cmgg/exomecnv/actions/workflows/ci.yml)
[![GitHub Actions Linting Status](https://github.com/nf-cmgg/exomecnv/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-cmgg/exomecnv/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)
[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)
Expand Down
53 changes: 53 additions & 0 deletions assets/exomedepth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Use --skip 1 with this config
chrom:
value: $6

pos:
value: $4

id:
value: $7

ref:
value: "."

alt:
value: ~if $2 == deletion <DEL> <DUP>

filter:
value: "."

info:
- name: SVTYPE
value: ~if $2 == deletion DEL DUP
number: 1
type: string
description: Type of structural variant
- name: END
value: $5
type: integer
description: End position of structural variant
- name: BF
value: $8
type: float
description: Bayes factor
- name: NEXONS
value: $3
type: integer
description: Number of exons
- name: READSEXP
value: $9
type: integer
description: Expected reads
- name: READSOBS
value: $10
type: integer
description: Observed reads
- name: READRATIO
value: $11
type: float
description: Ratio observed/expected reads
- name: EXONSENS
value: $12
type: string
description: Exons
14 changes: 14 additions & 0 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@
"errorMessage": "index of CRAM or BAM file must be provided, cannot contain spaces and must have extension '.crai' or '.bai' or '.csi'",
"format": "file-path",
"exists": true
},
"vcf": {
"type": "string",
"pattern": "^\\S+\\.(vcf|vcf.gz)$",
"errorMessage": "VCF is optional but must be provided when only annotating",
"format": "file-path",
"exists": true
},
"tbi": {
"type": "string",
"pattern": "^\\S+\\.(vcf.gz.tbi)$",
"errorMessage": "index of VCF file is optional but must be provided when only annotating",
"format": "file-path",
"exists": true
}
},
"required": ["sample", "pool", "family", "cram"]
Expand Down
4 changes: 1 addition & 3 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,5 @@ process {
errorStrategy = 'retry'
maxRetries = 2
}
withName:CUSTOM_DUMPSOFTWAREVERSIONS {
cache = false
}

}
36 changes: 18 additions & 18 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ process {
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]

withName: FASTQC {
ext.args = '--quiet'
}

withName: CUSTOM_DUMPSOFTWAREVERSIONS {
publishDir = [
path: { "${params.outdir}/pipeline_info" },
mode: params.publish_dir_mode,
pattern: '*_versions.yml'
]
}

withName: 'MULTIQC' {
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
publishDir = [
Expand All @@ -39,11 +27,23 @@ process {
]
}

withName: 'CRAM_TO_BAM' {
publishDir = [
path: { "${params.outdir}/bam" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
withName: 'BEDGOVCF' {
ext.args = { "--skip 1" }
}

withName: 'ENSEMBLVEP_VEP' {
ext.prefix = {"${meta.id}.vep"}
ext.args = {[
'--vcf',
'--format vcf',
'--coding_only',
'--offline',
'--no_stats',
'--per_gene',
'--merged',
'--exclude_predicted',
'--fields "SYMBOL,Gene"',
'--transcript_filter "stable_id match ENST"'
].join(' ').trim()}
}
}
13 changes: 12 additions & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,24 @@ params {
input = "${projectDir}/assets/samplesheet.csv"

// Genome references
// vep_fasta = "/home/bertg/vep/hg38.fa"
fasta = 'https://raw.githubusercontent.com/nf-cmgg/test-datasets/exomecnv/data/genomics/homo_sapiens/genome/seq/GCA_000001405.15_GRCh38_full_plus_hs38d1_analysis_set_chr21_and_chrX_subset.fna'
fai = 'https://raw.githubusercontent.com/nf-cmgg/test-datasets/exomecnv/data/genomics/homo_sapiens/genome/seq/GCA_000001405.15_GRCh38_full_plus_hs38d1_analysis_set_chr21_and_chrX_subset.fna.fai'

// Parameters
roi_auto = "https://raw.githubusercontent.com/nf-cmgg/test-datasets/exomecnv/data/genomics/homo_sapiens/genome/roi/Homo_sapiens.GRCh38.105.chr21_protein_coding_basic_sorted_merged_autosomal.bed"
roi_chrx = "https://raw.githubusercontent.com/nf-cmgg/test-datasets/exomecnv/data/genomics/homo_sapiens/genome/roi/Homo_sapiens.GRCh38.105.chrX_protein_coding_basic_sorted_merged.bed"

}
yamlconfig = "${projectDir}/assets/exomedepth.yaml"
exomedepth = false


// VEP options
annotate = false
vep_cache = "path" //Change to correct path
vep_assembly = "GRCh38"
vep_cache_version = 105
species = "homo_sapiens"

}

Binary file added docs/images/nfcore-exomecnv_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 17 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"bedgovcf": {
"branch": "master",
"git_sha": "71a96063a7e09be7ea48f069d134a56ce86c9ba6",
"installed_by": ["modules"]
},
"ensemblvep/vep": {
"branch": "master",
"git_sha": "b42fec6f7c6e5d0716685cabb825ef6bf6e386b5",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "b7ebe95761cd389603f9cc0e0dc384c0f663815a",
"installed_by": ["modules"]
},
"samtools/convert": {
"branch": "master",
"git_sha": "1b93e06140e6807cc408519759f68bd26da63a00",
"git_sha": "b42fec6f7c6e5d0716685cabb825ef6bf6e386b5",
"installed_by": ["modules"]
},
"tabix/tabix": {
"branch": "master",
"git_sha": "9502adb23c0b97ed8e616bbbdfa73b4585aec9a1",
"installed_by": ["modules"]
}
}
Expand All @@ -26,7 +41,7 @@
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa",
"git_sha": "92de218a329bfc9a9033116eb5f65fd270e72ba3",
"installed_by": ["subworkflows"]
},
"utils_nfvalidation_plugin": {
Expand Down
10 changes: 10 additions & 0 deletions modules/local/exomedepth/cnv_call/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: exomedepth_cnv_call
channels:
- conda-forge
- bioconda
- defaults

dependencies:
- r=3.6=r36_1003
- r-optparse=1.6.4=r36h6115d3f_0
- r-exomedepth:1.1.16--r43hfb3cda0_3
17 changes: 16 additions & 1 deletion modules/local/exomedepth/cnv_call/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
process CNV_CALL {
tag "$sample $meta2.chr"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-exomedepth:1.1.16--r43hfb3cda0_3' :
'biocontainers/r-exomedepth:1.1.16--r43hfb3cda0_3' }"
Expand All @@ -12,7 +14,7 @@ process CNV_CALL {
tuple val(meta2), val(sample), path(countfile) // meta:id, chr, sam, fam, sample

output:
tuple val(meta2), path("*.txt"), emit: cnvcall
tuple val(meta2), val (sample), path("*.txt"), emit: cnvcall
path "versions.yml", emit:versions

script:
Expand All @@ -34,4 +36,17 @@ process CNV_CALL {
R: \$(Rscript --version | sed 's/R scripting front-end //g')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${sample}_CNVs_ExomeDepth_${meta2.chr}"
def VERSION = '1.1.16'
"""
touch ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
ExomeDepth: ${VERSION}
R: \$(Rscript --version | sed 's/R scripting front-end //g')
END_VERSIONS
"""
}
2 changes: 1 addition & 1 deletion modules/local/exomedepth/count/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ channels:
dependencies:
- r=3.6=r36_1003
- r-optparse=1.6.4=r36h6115d3f_0
- r-exomedepth=1.1.12=r36h6786f55_0
- r-exomedepth:1.1.16--r43hfb3cda0_3
12 changes: 12 additions & 0 deletions modules/local/exomedepth/count/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@ process COUNT {
END_VERSIONS
"""

stub:
def VERSION = '1.1.16'
"""
touch ${meta.id}_${meta2.id}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
ExomeDepth: ${VERSION}
R: \$(Rscript --version | sed 's/R scripting front-end //g')
END_VERSIONS
"""
}
7 changes: 7 additions & 0 deletions modules/local/exomedepth/merge_cnv/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: coreutils
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- anaconda::coreutils=9.3
43 changes: 43 additions & 0 deletions modules/local/exomedepth/merge_cnv/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//MERGE CNV CALL FILES
process CNV_MERGE {
tag "$meta"

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

publishDir "$params.outdir/exomedepth/cnv_call", mode: 'copy'

input:
tuple val(meta), path(auto), path(chrx)

output:
tuple val(meta), path("*.txt"), emit:merge
path "versions.yml", emit:versions

script:
def prefix = task.ext.prefix ?: "${meta}_CNVs_ExomeDepth"
"""
cp $auto "${prefix}.txt"
tail +2 $chrx >> "${prefix}.txt"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
tail: \$(tail --version | sed '1!d; s/tail (GNU coreutils) //')
cp: \$(cp --version | sed '1!d; s/cp (GNU coreutils) //')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta}_CNVs_ExomeDepth"
"""
touch ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
tail: \$(tail --version | sed '1!d; s/tail (GNU coreutils) //')
cp: \$(cp --version | sed '1!d; s/cp (GNU coreutils) //')
END_VERSIONS
"""
}
7 changes: 7 additions & 0 deletions modules/local/exomedepth/merge_count/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: coreutils
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- anaconda::coreutils=9.3
34 changes: 32 additions & 2 deletions modules/local/exomedepth/merge_count/main.nf
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
// MERGE COUNT FILES
process COUNT_MERGE {
tag "$meta.id $meta.chr"

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

publishDir "$params.outdir/exomedepth/counts", mode: 'copy'

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

output:
tuple val(meta), path("${prefix}.txt")
tuple val(meta), path("*.txt"), emit:merge
path "versions.yml", emit:versions

script:
prefix = task.ext.prefix ?: "${meta.id}_${meta.chr}"
def prefix = task.ext.prefix ?: "${meta.id}_${meta.chr}"
"""
for file in $files; do
if [ -f ${prefix}.txt ]; then
Expand All @@ -19,5 +27,27 @@ process COUNT_MERGE {
cp \$file ${prefix}.txt
fi
done
cat <<-END_VERSIONS > versions.yml
"${task.process}":
paste: \$(paste --version | sed '1!d; s/paste (GNU coreutils) //')
mv: \$(mv --version | sed '1!d; s/mv (GNU coreutils) //')
cp: \$(cp --version | sed '1!d; s/cp (GNU coreutils) //')
awk: \$(awk -version 2>&1 | sed '1!d; s/(.*//')
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}_${meta.chr}"
"""
touch ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
paste: \$(paste --version | sed '1!d; s/paste (GNU coreutils) //')
mv: \$(mv --version | sed '1!d; s/mv (GNU coreutils) //')
cp: \$(cp --version | sed '1!d; s/cp (GNU coreutils) //')
awk: \$(awk -version 2>&1 | sed '1!d; s/(.*//')
END_VERSIONS
"""
}
Loading

0 comments on commit 4d3595a

Please sign in to comment.