Skip to content

fanavarro/DnaCompress

Repository files navigation

To encode a file you only have to write the following line:
	encode -f fileToCompress

fileToCompress is a file tha contains a DNA sequence, for example "AATCCGCTGACGT".

If the name of fileToCompres is foo, the application will create the following new files:
	foo_bin   -> This is a text file that contains the binary of the DNA sequence after the compression.
	foo_table -> This is a text file that contains the Huffman Table generated by the algorithm to perform the compression.

Encode operation will show the following information in the screen:
	Huffman Table generated without grouped symbols (This table will not be used to encode. It's shown for comparative reasons).
	Huffman Table generated with grouped symbols (This table will be used to encode).
	Compression rate if we would have used the Huffman Table without grouped symbols.
	Compression rate using the Huffman Table with grouped symbols.


To decode a file, you have to write the following line:
	decode -f binaryFile -t huffmanTableFile -o outputFile

binaryFile is a text file that contains the compressed DNA sequence in bits.
huffmanTableFile is a text file that contains the Huffman Table generated by the algorithm when it performed the compression.
outputFile is the file where the original DNA sequence will be written.




There is a folder called "ejemplos" that contains three output examples.
To encode:
encode -f ejemplos/ej1
encode -f ejemplos/ej2
encode -f ejemplos/ej3

To decode (output will be written in ejemplos/ejX_recompuesto):
decode -f ejemplos/ej1_bin -t ejemplos/ej1_table -o ejemplos/ej1_recompuesto
decode -f ejemplos/ej2_bin -t ejemplos/ej2_table -o ejemplos/ej2_recompuesto
decode -f ejemplos/ej3_bin -t ejemplos/ej3_table -o ejemplos/ej3_recompuesto

About

Dna sequence compressor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published