This project shows how to implement a simple Nextflow plugin named nf-biojava using Java instead Groovy

It provides the ability to integrate functionalities from the biojava project (https://biojava.org/) into Nexflow pipelines

Note
THIS IS A PREVIEW TECHNOLOGY, FEATURES AND CONFIGURATION SETTINGS CAN CHANGE IN FUTURE RELEASES.

Requirements

  • java 11 or later

Build

./gradlew build

Documentation

execute into the cloned directory:

./gradlew asciidoctor

if all it’s ok you can find the documentation at plugins/nf-biojava/build/docs/asciidoc directory

Get started

Make sure to have Nextflow 22.10.0 or later. Add the following snippet to your nextflow.config file.

nextflow.config
plugins {
  id 'nf-biojava@0.0.1'
}

The above declaration allows the use of the plugin functionalities in your Nextflow pipelines.

For example

test.nf
include {
    createDNASequence;
    getProteinSequenceForId;
} from 'plugin/nf-biojava'

println createDNASequence( path('example.dna') )

println getProteinSequenceForId( 'Q21691' )

Configuration

The configuration of the plugin is under biojava scope.

Following values are availables:

Key Description Default Value

proteineRepoURL

a pattern url where download the proteine

https://www.uniprot.org/uniprot/%s.fasta

Available Factories

fromRNAFasta(path)

emit a tuple of ID,RNA

fromDNAFasta(path)

emit a tuple of ID,DNA

fromProteinFasta(path)

emit a tuple of ID,Protein

fromProteinFastaExample.nf
include {fromProteinFasta} from 'plugin/nf-biojava'

process echo{
    input: tuple val(key), val(v)
    output: stdout
    script:
    """
    echo key = ${key}
    echo dna = ${v.toString()[0..20]}
    """
}
workflow{
    channel
        .fromProteinFasta(file('https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/reference/genome.fasta.gz'))
    | echo
    | view
}

Available functions

This plugin adds to the Nextflow DSL the following extensions that allows performing of queries and populating database tables.

createDNASequence

TBD!!!

createDNASequence

TBD!!!

getProteinSequenceForId

TBD!!!