Skip to content

kpj/bin2fasta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disclaimer: this is only a proof-of-concept (and a joke), please don't actually use this.

bin2fasta

pypi version Tests license

Store any file as a fasta file!

Installation

$ pip install bin2fasta

Usage

$ bin2fasta --help
Usage: bin2fasta [OPTIONS] FILENAME

  Store any file as a fasta file

Options:
  -D, --decode           Enable conversion from FASTA to
                         binary.
  -o, --output FILENAME  File to write to.
  --help                 Show this message and exit.

Basic example:

$ file foo.png
foo.png: PNG image data, 618 x 257, 8-bit/color RGBA, non-interlaced
$ bin2fasta -o bar.fasta foo.png
319400it [00:00, 683649.99it/s]
$ head -c50 bar.fasta
>Sequence_master
AGTTGAGGCGCCTTACTGCCGAATTAGTTAAGA
$ bin2fasta --decode -o baz.png bar.fasta
159700it [00:00, 455825.67it/s]
$ file baz.png
baz.png: PNG image data, 618 x 257, 8-bit/color RGBA, non-interlaced
$ diff foo.png baz.png
$

Note that you can easily chain multiple commands by piping their respective outputs and using -:

$ cat foo.png | xz | gpg -c | bin2fasta - > bar.fasta
$ cat bar.fasta | bin2fasta -D - | gpg -d | xz --decompress > baz.png
$ diff foo.png baz.png
$

Poetry workflow

Only relevant for developers:

Run executable:

$ poetry run bin2fasta

Publish to PyPi:

$ poetry --build publish

About

Store any file as a fasta file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages