Skip to content

FASTA Files

0.7.0

The nft-fasta plugin extends path by a fasta property that can be used to read FASTA files into maps. nft-fasta supports also gzipped FASTA files.

Setup

To use the fasta property you need to activate the nft-fasta plugin in your nf-test.config file:

config {
  plugins {
    load "nft-fasta@1.0.0"
  }
}

More about plugins can be fond here.

Comparing files

assert path('path/to/fasta1.fasta').fasta == path("path/to/fasta2.fasta'").fasta

Work with individual samples

def sequences = path('path/to/fasta1.fasta.gz').fasta
assert "seq1" in sequences
assert !("seq8" in sequences)
assert sequences.seq1 == "AGTACGTAGTAGCTGCTGCTACGTGCGCTAGCTAGTACGTCACGACGTAGATGCTAGCTGACTCGATGC"