Skip to content

Commit

Permalink
Merge pull request #9 from KirillKryukov/develop
Browse files Browse the repository at this point in the history
Add support for multi-file archives
  • Loading branch information
KirillKryukov authored Sep 17, 2020
2 parents 357c79f + f3530b7 commit 372f161
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Compress.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,18 @@ you have to switch to text mode (`--text`).
Since both `--dna` and `--text` modes can be used for DNA data, which is better?
Short answer: `--dna` is faster and has stronger compression.
For details, see [this benchmark page](http://kirill-kryukov.com/study/naf/benchmark-text-vs-dna-Spur.html).

## Can it compress multiple files into single archive?

Yes, with the help of a [Multi-Multi-FASTA file format](https://github.com/KirillKryukov/mumu).
It works similarly to gzipping a tar file:
First you combine individual FASTA files into a single Multi-Multi-FASTA stream, then compress it using _ennaf_.
Example commands:

Compressing:<br>
`mumu.pl --dir 'Helicobacter' 'Helicobacter pylori*' | ennaf -22 --text -o Hp.nafnaf`

Decompressing and unpacking:<br>
`unnaf Hp.nafnaf | mumu.pl --unpack --dir 'Helicobacter'`

"**nafnaf**" is the recommended filename extension for such archives containing multiple FASTA files.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ See `ennaf -h` and [Compression Manual](Compress.md) for detailed usage.

See `unnaf -h` and [Decompression Manual](Decompress.md).

## Compressing multiple files

Working with multiple files is possible using [Multi-Multi-FASTA](https://github.com/KirillKryukov/mumu) as intermediate format.
Example commands:

Compressing:<br>
`mumu.pl --dir 'Helicobacter' 'Helicobacter pylori*' | ennaf -22 --text -o Hp.nafnaf`

Decompressing and unpacking:<br>
`unnaf Hp.nafnaf | mumu.pl --unpack --dir 'Helicobacter'`

Filename of NAF-compressed single file normally ends with a ".naf".
To avoid ambiguity, **".nafnaf"** is the recommended suffix for multi-file NAF archives.

## Citation

If you use NAF, please cite:
Expand Down

0 comments on commit 372f161

Please sign in to comment.