Skip to content

Commit

Permalink
Merge branch 'master' into refactor/sentieon
Browse files Browse the repository at this point in the history
  • Loading branch information
asp8200 authored Jul 12, 2024
2 parents 2d7d222 + 0554167 commit 872ce8e
Show file tree
Hide file tree
Showing 114 changed files with 1,719 additions and 989 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fix-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4

- name: Install Prettier
run: npm install -g prettier @prettier/plugin-php
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
# FIXME Flip this off once we get to less than a couple hundred. Adding
# this so it will only run against changed files. It'll make it much
Expand All @@ -45,7 +45,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Install NodeJS
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "20"

Expand All @@ -60,7 +60,7 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "20"

Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"

Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"

Expand Down Expand Up @@ -413,7 +413,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"

Expand Down Expand Up @@ -664,7 +664,7 @@ jobs:
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
with:
python-version: "3.11"

Expand Down
6 changes: 3 additions & 3 deletions modules/nf-core/barrnap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ process BARRNAP {
--threads $task.cpus \\
--kingdom $db \\
$input \\
> rrna_${db}.gff
> ${prefix}_${db}.gff
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -44,9 +44,9 @@ process BARRNAP {
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

db = dbname ? "${dbname}" : 'bac'
"""
touch ${prefix}.gff
touch ${prefix}_${db}.gff
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 4 additions & 1 deletion modules/nf-core/barrnap/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
homepage: "https://github.com/tseemann/barrnap"
documentation: "https://github.com/tseemann/barrnap"
tool_dev_url: "https://github.com/tseemann/barrnap"
licence: "['GPL v3']"
licence: ["GPL v3"]
input:
- meta:
type: map
Expand All @@ -23,6 +23,9 @@ input:
type: file
description: fastq or fasta file nucleotides (it can be amino acids as well)
pattern: "*.{fna,fasta,faa,fastq}"
- dbname:
type: string
description: database to use(bacteria, archaea, eukaryota, metazoan mitochondria)
output:
- meta:
type: map
Expand Down
57 changes: 57 additions & 0 deletions modules/nf-core/barrnap/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
nextflow_process {

name "Test Process BARRNAP"
script "../main.nf"
process "BARRNAP"
tag "modules"
tag "modules_nfcore"
tag "barrnap"

test("barrnap") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true),
"bac"
]
"""
}
}

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

test("barrnap - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true),
"bac"
]
"""
}
}

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


72 changes: 72 additions & 0 deletions modules/nf-core/barrnap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"barrnap - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_bac.gff:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b"
],
"gff": [
[
{
"id": "test",
"single_end": false
},
"test_bac.gff:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.1"
},
"timestamp": "2024-07-10T11:25:35.085998"
},
"barrnap": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_bac.gff:md5,df19e1b84ba6f691d20c72b397c88abf"
]
],
"1": [
"versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b"
],
"gff": [
[
{
"id": "test",
"single_end": false
},
"test_bac.gff:md5,df19e1b84ba6f691d20c72b397c88abf"
]
],
"versions": [
"versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.04.1"
},
"timestamp": "2024-07-10T11:25:28.621027"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/barrnap/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
barrnap:
- "modules/nf-core/barrnap/**"
20 changes: 14 additions & 6 deletions modules/nf-core/bcftools/pluginsplit/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ process BCFTOOLS_PLUGINSPLIT {
path(targets)

output:
tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}") , emit: vcf
path "versions.yml" , emit: versions
tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf
tuple val(meta), path("*.tbi") , emit: tbi, optional: true
tuple val(meta), path("*.csi") , emit: csi, optional: true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -32,6 +34,7 @@ process BCFTOOLS_PLUGINSPLIT {

"""
bcftools plugin split \\
${args} \\
${vcf} \\
${samples_arg} \\
${groups_arg} \\
Expand All @@ -56,12 +59,17 @@ process BCFTOOLS_PLUGINSPLIT {
args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" :
args.contains("--output-type v") || args.contains("-Ov") ? "vcf" :
"vcf"

def index = args.contains("--write-index=tbi") || args.contains("-W=tbi") ? "tbi" :
args.contains("--write-index=csi") || args.contains("-W=csi") ? "csi" :
args.contains("--write-index") || args.contains("-W") ? "csi" :
""
def determination_file = samples ?: targets
def create_cmd = extension.matches("vcf|bcf") ? "touch " : "echo '' | gzip > "
def create_files = "cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}/' > files.txt; while IFS= read -r filename; do ${create_cmd} \"\$filename\"; done < files.txt"
def create_index = index.matches("csi|tbi") ? "cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}.${index}/' > indices.txt; touch \$(<indices.txt)" : ""
"""
cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}/' > files.txt
touch \$(<files.txt)
${create_files}
${create_index}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
Loading

0 comments on commit 872ce8e

Please sign in to comment.