Skip to content

Commit

Permalink
Add samtools cramsize (#5743)
Browse files Browse the repository at this point in the history
* New module for the cram-size command of samtools.

* Update modules/nf-core/samtools/cramsize/main.nf

Adding name of the tool

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Update modules/nf-core/samtools/cramsize/main.nf

Adding prefix to make the module set up more flexible.

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Update modules/nf-core/samtools/cramsize/main.nf

Changing `.baseName` by `prefix` in output names.

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Stub added to the main.nf script.

* Adding generated test.yml file.

* Adding pytest.

* Adding a new nf-core module called plasflow.

* Update manta modules (#3615)

* Update manta somatic

* Update manta tumoronly

* add varlociraptor call subcommand (#3529)

* add call subcommand

* at calls runs now [skip ci]

* add test files

* linting

* fix tests

* add contains check

* Update tests/modules/nf-core/varlociraptor/callvariants/main.nf

Co-authored-by: Maxime U Garcia <[email protected]>

---------

Co-authored-by: Maxime U Garcia <[email protected]>

* add new module iCount-mini/metagene (#3612)

* add module template

* first version

* update testing and linting

* update file naming

* update test

* fix test

* Newmodule ngmerge (#3626)

* ngmerge first commit

* main module code

* complete module

* remove trailing whitespace

* fix versions.yml

* fix version yml

* versions yml

* vyml

* try vyml again

* touch versions yml

* vyml

* NEW MODULE: PURECLIP (#3624)

* initial commit

* module version 1

* full testing

* linting

* fix version yaml

* fix version yaml command

* fix version yml maybe this time please

* fix version yml for real this time

* try again versions yaml

* fix version yml

* vyml

* version yaml

* vyml

* update ref to have meta

* fix integer overflow (#3620)

Co-authored-by: Steven Strong <[email protected]>

* Fix metaeuk_easypredict when using mmseqs database (#3525)

Fix metaeuk and add tests

* 3630 add unstitched reads as emitted output of ngmerge (#3632)

* add -f option

* update tests

* Update vardictjava (#3633)

* new module picard/scatterintervalsbyns

* update annotsv to 3.3.6

* update installannotations

* update vardictjava

* Adding modules from #scrnaseq for simpleaf (#3619)

* Start adding modules from #scrnaseq for simpleaf

* Fix tests

* t2gene is necessary, simplify tests

* Linteing fixes

* Fix test files

* Test fixes

* prettier

* Address feedback

* Update test string- logs in newer version lack some messages

* Apply suggestions from code review

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Post-review index fixes

* Post-review quant fixes

* add stubs

* Add metas, fix meta usage

* Appease eclint

---------

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* update icount mini version (#3640)

module currently fails, i've fixed the error in icount-mini so now by bumping the version here we fix the issue (old matplotlib syntax)

* Bump taxpasta version (biocontainer not yet available) (#3639)

* Purecn/run (#3140)

* Set up nf-core template for purecn/run module

* Add run script and I/O

* Clean TODOs and set main script

* Fix duplicate entry

* Set up main script

* [ci skip] Format with prettier

* [ci skip] Address review question and set up stub

* [ci skip] Set stub for testing

* Reformat with prettier

* [CI skip] Adjust some typos

* [CI skip] Set up test script using stub

* Set up test yml

* Reformat with prettier

* Set up meta.yml file and fix typos

* Reformat with prettier

* Fix typo

* Remove quay.io from container string

* Remove optional input argument

* Add optional outputs and clean non-mandatory parameters

* Clean non-mandatory outputs

* Reformat outputs

* Fix minor and address reviews

* new module: samtools/import (#3642)

* new module: samtools/import

* fix versions

* fix versions some more

* Update modules/nf-core/samtools/import/main.nf

* fix meta

* Adding seqkit sliding command (#3637)

* Adding seqkit sliding command

* Linting fix

* Updating for better matching

* reverted to regex using end line markers for better matching other wise fastq gets caught by fa, error in other modules

* Added a test for fastq too

---------

Co-authored-by: Matthieu Muffato <[email protected]>

* Hicexplorer hicpca (#2933)

* create module hicpca

* Update modules/nf-core/hicexplorer/hicpca/main.nf

Co-authored-by: Sébastien Guizard <[email protected]>

* Update modules/nf-core/hicexplorer/hicpca/main.nf

Co-authored-by: Sébastien Guizard <[email protected]>

* add more keywords.

* remove quay.io.

---------

Co-authored-by: Sébastien Guizard <[email protected]>

* Fix bug in pyrodigal module (#3643)

Add "--force" to pigz

* Update gecco/run (#3652)

Version bump to 0.9.8

* New module: instrain/compare (#3623)

* Started instrain compare tests

* instrain compare

* Update modules/nf-core/instrain/compare/main.nf

* Update modules/nf-core/instrain/compare/main.nf

* Update modules/nf-core/instrain/compare/main.nf

* Updated test.yml and added stub

* Update modules/nf-core/instrain/compare/main.nf

Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Update meta.yml to include meta2

* Updated test.yml output files

* Changed md5 to content for several test.yml files

* changed content to contains

* Added another contains option in test.yml

* shortened contains string to pass prettier check

---------

Co-authored-by: Margot Lavitt <[email protected]>
Co-authored-by: Nicolas Vannieuwkerke <[email protected]>

* Update LAST modules to v1453 (#3303)

* Update LAST to version 1453.

* update lastdb version to 1453

* update last mafconvert to 1453

* update last mafswap to 1453

* update postmask to last v1453

* update last split to v1453

* last update train to v1453

* Update meta.yml

Change output value type to string

* Update meta.yml

Change output value type to string

---------

Co-authored-by: Charles Plessy <[email protected]>
Co-authored-by: Charlotte Capitanchik <[email protected]>
Co-authored-by: Johannes Nicolaus Wibisana <[email protected]>
Co-authored-by: Charlotte Capitanchik <[email protected]>

* Hisat2-build: index construction w/ truly optional inputs  (#3649)

* index construction mode dependent on optional inputs rather than memory availability

* added tests for new functionality

* updated tests to use appropriate test data

* cleaned up test.yml to only contain BUILD outputs

* removed unnecessary extract ss call

* added : to empty metamaps. Reverted to sarscov2 test files

---------

Co-authored-by: James A. Fellows Yates <[email protected]>

* update metaphlan module (#3661)

* CNVKit 0.9.10 update (#3651)

* upgrade CNVkit to 0.9.10

* homogenise keywords of all CNVkit modules

* Add samtools dependency to bam2seqz module of sequenzautils

Without specifying the dependency to a more or less current version of samtools, conda solves the environment for sequenza by using a very old samtools version that can cause problems when processing subsampled files (automated tests)

* Update cnvkit to 0.9.10

Changes:
 - Update cnvkit to 0.9.10
 - Update samtools in cnvkit modules to 1.17

Based on #3545 authored by @priesgo.

* cnvkit 0.9.10 test update

* update checksums of output files in tests for CNVkit batch

* Update cnvkit/export VCF test

* Additional tags for sequenzautils

---------

Co-authored-by: Pablo Riesgo-Ferreiro <[email protected]>
Co-authored-by: Julian Mohr <[email protected]>

* Update gatk3 modules (#3660)

* update mapdage2 module

* Add meta for all files in gatk modules

* Update tiddit to v3.6.1 (#3663)

* Update stubs for samtools flagstat (#3657)

Update stubs

Co-authored-by: Ram Nanduri <[email protected]>

* R differential modules control over output prefixes (#3664)

* R differential modules control over output prefixes

* Set differential module prefixes

* Actually we need to do prefix handling within the template

* Set differential module prefixes

* Fix test files for new prefix specification

* Add meta to limma test

* Fix DESeq2 tests

* fix remaining tests for limma

* Update grep to fix broken solve

* Try bumping affy

* Use new build

* update md5sum for annotation

* Update stubs for samtools idxstats (#3665)

* Update stubs

* Update stubs for samtools idxstats

---------

Co-authored-by: Ram Nanduri <[email protected]>

* Bump ensembl-vep modules to 110.0 (#3658)

* bump ensembl-vep to 110.0

* update tests

* put conda tests back

* update config for ENSEMBLVEP_DOWNLOAD

* update tests for related subworkflows

* fix path to module

* enable conda tests back

* better tests

* fix tests

* nicer channels

* fix channel queue to value

* fix syntax

* Remove containers with cache with snpEff too (#3670)

* update tests for snpeff

* remove containers in config

* fix cache version in tests

* update meta.yml

* fix meta.yml

* fix meta data

* fix md5sum

* re-enable conda tests

* Update stubs for bwa mem (#3671)

Co-authored-by: Ram Nanduri <[email protected]>

* Additional optional output to homer/annotatepeaks  (#3667)

* add optional stats output for use with the -annStats parameter (to be provided with ext.args)

* Update meta.yml

* add additional stats output to annotatepeaks test

---------

Co-authored-by: Edmund Miller <[email protected]>

* Hisat2 align splicesitesoptional (#3656)

* added align tests for splicesitesoptional

* changes to homo sap

* updated splice sites to be optional with tests

* Fix invalid GATK container (#3673)

Fix GATK container which was invalid

Fixes #3668

* Update: bamtools, gstama, ultra (#3655)

* Update Bamtools [2.5.1 -> 2.5.2]

* Update gstama/merge [1.0.2 -> 1.0.3]

* Update ultra [0.0.4.2 -> 0.1]

* Update ultra/index|align|pipeline tests

replace gffread by gnu/sort

* Irregular md5sum for database.db

* Update bamtools/convert test.yml

* Fix centrifuge: reduce number of input channels (#3674)

* Bump taxpasta version (biocontainer not yet available)

* Remove unnecessary (and sometimes problematic) input channel

* Improve output glob for optional alignments

* Remove now unnecessary variable from command

* linting

* Add missing args

* Remove unused ublast module

* Checking tests that were failing from the samtools/cramsize module.

* Writing some errors.

* Checking failed test of the samtools/cram-size module.

* Checking failed test on yml file.

* Fixing test.yml file.

* Fixing test.yml from plasflow module.

* Removing trailing whitespaces from files.

* Fixing test.yml from plasflow module.

* Removing Plasflow from conda. It doesn't work.

* Running prettier on test.yml from plasflow.

* Details of the conda environment.

* Adding specific Tensorflow version for Plasflow.

* Adding channel for python 3.5

* Fixing the channel for python 3.5 for plasflow module.

* Changing the channel for python 3.5 (to conda-forge) for plasflow module.

* Update cramsize

* Excluse cramsize from pytest

* Remove plasflow

* Update and fix linting

* Update modules/nf-core/samtools/cramsize/tests/main.nf.test

Co-authored-by: Carson J Miller <[email protected]>

* Update modules/nf-core/samtools/cramsize/tests/main.nf.test

Co-authored-by: Carson J Miller <[email protected]>

---------

Co-authored-by: limrp <[email protected]>
Co-authored-by: limrp <[email protected]>
Co-authored-by: Nicolas Vannieuwkerke <[email protected]>
Co-authored-by: Maxime U Garcia <[email protected]>
Co-authored-by: Friederike Hanssen <[email protected]>
Co-authored-by: Maxime U Garcia <[email protected]>
Co-authored-by: Charlotte Capitanchik <[email protected]>
Co-authored-by: Steven Strong <[email protected]>
Co-authored-by: Steven Strong <[email protected]>
Co-authored-by: Jim Downie <[email protected]>
Co-authored-by: Jonathan Manning <[email protected]>
Co-authored-by: James A. Fellows Yates <[email protected]>
Co-authored-by: Aldo Sergi <[email protected]>
Co-authored-by: Matthias De Smet <[email protected]>
Co-authored-by: Damon-Lee Pointon <[email protected]>
Co-authored-by: Matthieu Muffato <[email protected]>
Co-authored-by: JIANHONG OU <[email protected]>
Co-authored-by: Sébastien Guizard <[email protected]>
Co-authored-by: Jasmin Frangenberg <[email protected]>
Co-authored-by: Carson J Miller <[email protected]>
Co-authored-by: Margot Lavitt <[email protected]>
Co-authored-by: Johannes Nicolaus Wibisana <[email protected]>
Co-authored-by: Charles Plessy <[email protected]>
Co-authored-by: Charlotte Capitanchik <[email protected]>
Co-authored-by: Johannes Nicolaus Wibisana <[email protected]>
Co-authored-by: Jack Tierney <[email protected]>
Co-authored-by: Lili Andersson-Li <[email protected]>
Co-authored-by: Adam Talbot <[email protected]>
Co-authored-by: Pablo Riesgo-Ferreiro <[email protected]>
Co-authored-by: Julian Mohr <[email protected]>
Co-authored-by: Thiseas C. Lamnidis <[email protected]>
Co-authored-by: Anders Sune Pedersen <[email protected]>
Co-authored-by: Ram Sai Nanduri <[email protected]>
Co-authored-by: Ram Nanduri <[email protected]>
Co-authored-by: Laura Blum <[email protected]>
Co-authored-by: Edmund Miller <[email protected]>
  • Loading branch information
1 parent a5ba4d5 commit 49cc8dc
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/nf-core/samtools/cramsize/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: samtools_cramsize

channels:
- conda-forge
- bioconda
- defaults

dependencies:
- bioconda::htslib=1.20
- bioconda::samtools=1.20
46 changes: 46 additions & 0 deletions modules/nf-core/samtools/cramsize/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
process SAMTOOLS_CRAMSIZE {
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/samtools:1.20--h50ea8bc_0' :
'biocontainers/samtools:1.20--h50ea8bc_0' }"

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

output:
tuple val(meta), path("*.size"), emit: size
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"
"""
samtools \\
cram-size \\
$args \\
-o ${prefix}.size \\
$cram
cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "$meta.id"
"""
touch ${prefix}.size
cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}
42 changes: 42 additions & 0 deletions modules/nf-core/samtools/cramsize/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: samtools_cramsize
description: List CRAM Content-ID and Data-Series sizes
keywords:
- cram-size
- cram
- size
tools:
- samtools:
description: |
SAMtools is a set of utilities for interacting with and post-processing
short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li.
These files are generated as output by short read aligners like BWA.
homepage: http://www.htslib.org/
documentation: http://www.htslib.org/doc/samtools.html
doi: 10.1093/bioinformatics/btp352
licence: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- cram:
type: file
description: CRAM file
pattern: "*.cram"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- size:
type: file
description: Size information file
pattern: "*.size"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@limrp"
56 changes: 56 additions & 0 deletions modules/nf-core/samtools/cramsize/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
nextflow_process {

name "Test Process SAMTOOLS_CRAMSIZE"
script "../main.nf"
process "SAMTOOLS_CRAMSIZE"

tag "modules"
tag "modules_nfcore"
tag "samtools"
tag "samtools/cramsize"

test("human - cram") {

when {
process {
"""
input[0] = [[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true)
]
"""
}
}

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

}

test("human - cram - stub") {

options "-stub"

when {
process {
"""
input[0] = [[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true)
]
"""
}
}

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

}

}
72 changes: 72 additions & 0 deletions modules/nf-core/samtools/cramsize/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"human - cram - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.size:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,2814b0d0507520469838cbceb7516836"
],
"size": [
[
{
"id": "test",
"single_end": false
},
"test.size:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,2814b0d0507520469838cbceb7516836"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-03T13:38:57.726189593"
},
"human - cram": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.size:md5,aff113286a3368bcb9c5b708bdf5f777"
]
],
"1": [
"versions.yml:md5,2814b0d0507520469838cbceb7516836"
],
"size": [
[
{
"id": "test",
"single_end": false
},
"test.size:md5,aff113286a3368bcb9c5b708bdf5f777"
]
],
"versions": [
"versions.yml:md5,2814b0d0507520469838cbceb7516836"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-03T13:38:46.273448099"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/samtools/cramsize/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
samtools/cramsize:
- "modules/nf-core/samtools/cramsize/**"

0 comments on commit 49cc8dc

Please sign in to comment.