Skip to content

Commit

Permalink
Adding module for miniprot_index. Closes #1. (#29)
Browse files Browse the repository at this point in the history
* Adding module for miniprot_index. Closes #1.

* Adding module for miniprot_index. Closes #1.

* Adding module for miniprot_index. Closes #1.

* Adding module for miniprot_index. Closes #1.

* Adding module for miniprot_index. Closes #1.

* Adding module for miniprot_index. Closes #1.

* update the wrong file name

* put back the test data path

* change index file name

Co-authored-by: Guoying Qi <[email protected]>
  • Loading branch information
yumisims and gq1 authored Nov 4, 2022
1 parent b7c199a commit 5f56c87
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 0 deletions.
35 changes: 35 additions & 0 deletions modules/miniprot/index/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
process MINIPROT_INDEX {
tag "$meta.id"
label 'process_medium'
def version = '0.5-c2'
if (params.enable_conda) {
exit 1, "Conda environments cannot be used when using the miniprot process. Please use docker or singularity containers."
}
container "quay.io/sanger-tol/miniprot:${version}"

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

output:
tuple val(meta), path("*.mpi"), emit: index
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''

"""
miniprot \\
-t $task.cpus \\
-d ${fasta.baseName}.mpi \\
$args \\
$fasta
cat <<-END_VERSIONS > versions.yml
"${task.process}":
miniprot: $version
END_VERSIONS
"""
}
39 changes: 39 additions & 0 deletions modules/miniprot/index/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: miniprot_index
description: Provides fasta index required by miniprot alignment.
keywords:
- index
- fasta
- reference
tools:
- miniprot:
description: |
A versatile pairwise aligner for genomic and protein sequences.
homepage: https://github.com/lh3/miniprot
documentation: https://github.com/lh3/miniprot
licence: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: |
Reference database in FASTA format.
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- index:
type: file
description: miniprot fasta index.
pattern: "*.mpi"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@yumisims"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,10 @@ minimap2/index:
- modules/minimap2/index/**
- tests/modules/minimap2/index/**

miniprot/index:
- modules/miniprot/index/**
- tests/modules/miniprot/index/**

mlst:
- modules/mlst/**
- tests/modules/mlst/**
Expand Down
3 changes: 3 additions & 0 deletions tests/config/test_data.config
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ params {
}
}
'Oscheius_sp' {
'assembly'{
assembly_fasta ="${tol_test_data_dir}/Oscheius_sp/assembly//nxOscSpef2.fasta"
}
'genomic_data' {
'nxOscSpen2' {
'selfcomp' {
Expand Down
10 changes: 10 additions & 0 deletions tests/modules/miniprot/index/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { MINIPROT_INDEX } from '../../../../modules/miniprot/index/main.nf'

workflow test_miniprot_index {
fasta =file(params.tol_test_data['small_genome']['Oscheius_sp']['assembly']['assembly_fasta'],checkIfExists: true)
MINIPROT_INDEX ( [ [id:'test'], fasta ] )
}
5 changes: 5 additions & 0 deletions tests/modules/miniprot/index/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
10 changes: 10 additions & 0 deletions tests/modules/miniprot/index/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- name: miniprot index
command: nextflow run ./tests/modules/miniprot/index -entry test_miniprot_index -c ./tests/config/nextflow.config -c ./tests/modules/miniprot/index/nextflow.config
tags:
- miniprot
- miniprot/index
files:
- path: output/miniprot/nxOscSpef2.mpi
md5sum: ec3d98dc989e73873afe5b529c84c022
- path: output/miniprot/versions.yml
md5sum: b191a09118135126e3da7080ad64983d

0 comments on commit 5f56c87

Please sign in to comment.