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

Add Vireo to modules #5576

Merged
merged 9 commits into from
May 13, 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
9 changes: 9 additions & 0 deletions modules/nf-core/vireo/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "vireo"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::vireosnp=0.5.8"
62 changes: 62 additions & 0 deletions modules/nf-core/vireo/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
process VIREO {
tag "$meta.id"
label 'process_medium'

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

input:
tuple val(meta), path(cell_data), val(n_donor), path(donor_file), path(vartrix_data)
output:
tuple val(meta), path('*_summary.tsv') , emit: summary
tuple val(meta), path('*_donor_ids.tsv') , emit: donor_ids
tuple val(meta), path('*_prob_singlet.tsv.gz'), emit: prob_singlets
tuple val(meta), path('*_prob_doublet.tsv.gz'), emit: prob_doublets
path 'versions.yml' , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def input = cell_data ? "-c ${cell_data}" : "--vartrixData ${vartrix_data}"

"""
vireo \\
$input \\
-N ${n_donor} \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is -N mandatory?

-d ${donor_file} \\
-p $task.cpus \\
-o . \\
$args

mv summary.tsv ${prefix}_summary.tsv
mv donor_ids.tsv ${prefix}_donor_ids.tsv
mv prob_singlet.tsv.gz ${prefix}_prob_singlet.tsv.gz
mv prob_doublet.tsv.gz ${prefix}_prob_doublet.tsv.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
vireo: \$(vireo | sed '1!d ; s/Welcome to vireoSNP //; s/!//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}_summary.tsv
touch ${prefix}_donor_ids.tsv
echo "" | gzip > ${prefix}_prob_singlet.tsv.gz
echo "" | gzip > ${prefix}_prob_doublet.tsv.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
vireo: \$(vireo | sed '1!d ; s/Welcome to vireoSNP //; s/!//')
END_VERSIONS
"""
}
82 changes: 82 additions & 0 deletions modules/nf-core/vireo/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "vireo"
description: Use vireo to perform donor deconvolution for multiplexed scRNA-seq data
keywords:
- genotype-based demultiplexing
- donor deconvolution
- cellsnp
tools:
- "vireo":
description: "vireoSNP - donor deconvolution for multiplexed scRNA-seq data"
homepage: "https://vireosnp.readthedocs.io/en/latest/"
documentation: "https://vireosnp.readthedocs.io/en/latest/"
tool_dev_url: "https://github.com/single-cell-genetics/vireo"
doi: "10.1186/s13059-019-1865-2"
licence: ["Apache-2.0"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1']`

- cell_data:
type: file
description: The cell genotype file in VCF format or cellSNP folder with sparse matrices.
pattern: "*.vcf|*/"
- n_donor:
type: integer
description: Number of donors to demultiplex.
- donor_file:
type: file
description: The optional donor genotype file in VCF format.
pattern: "*.vcf"
- vartrix_data:
type: file
description: The optional cell genotype files in vartrix outputs.

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`

- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

- summary:
type: file
description: Summary tsv file of deconvolution result.
pattern: "*_summary.tsv"

- donor_ids:
type: file
description: Donor assignment with detailed statistics.
pattern: "*_donor_ids.tsv"

- prob_singlets:
type: file
description: contains probability of classifing singlets
pattern: "*_prob_singlet.tsv.gz"

- prob_doublets:
type: file
description: contains probability of classifing doublets
pattern: "*_prob_doublet.tsv.gz"

authors:
- "@mari-ga"
- "@maxozo"
- "@wxicu"
- "@Zethson"

maintainers:
- "@mari-ga"
- "@maxozo"
- "@wxicu"
- "@Zethson"
90 changes: 90 additions & 0 deletions modules/nf-core/vireo/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// nf-core modules test vireo
nextflow_process {

name "Test Process VIREO"
script "../main.nf"
process "VIREO"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "vireo"
tag "samtools/index"
tag "cellsnp/modea"

test("demultiplexing") {
setup {
run("SAMTOOLS_INDEX") {
script "../../samtools/index/main.nf"
process {
"""
input[0] = [
[ id:'sample1' ],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true) ]
"""
}
}
run("CELLSNP_MODEA") {
script "../../cellsnp/modea/main.nf"
process {
"""
input[0] = SAMTOOLS_INDEX.out.bai.collect{ meta, bai -> bai }.map{
bai -> [[id: 'sample1'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true),
bai,
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/barcodes.tsv', checkIfExists: true)]}
"""
}
}
}

when {
process {
"""
input[0] = CELLSNP_MODEA.out.cell.collect{ meta, cell -> cell }.map{
cell -> [[id:'test'],
cell,
2,
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true),
[]
]}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("demultiplexing - stub") {
options "-stub"

when {
process {
"""
input[0] = [[id:'sample1'],
[],
2,
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true),
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
Loading
Loading