@@ -7,6 +7,8 @@ Base Sequence Compression is a Rust library for compressing and decompressing DN
7
7
- ** Compression and Decompression** : Compress DNA sequences into a binary format and decompress them back to their original form.
8
8
- ** Error Handling** : Handles invalid DNA sequences by panicking, ensuring data integrity.
9
9
- ** Compression Rate Calculation** : Calculate the compression rate to evaluate the efficiency of the compression.
10
+ - ** FASTA File Compression** : Compress and decompress FASTA files containing multiple DNA sequences.
11
+ - ** WASM Support** : The library can be compiled to WebAssembly for use in web applications.
10
12
11
13
## Usage
12
14
@@ -16,7 +18,7 @@ Add the following to your `Cargo.toml`:
16
18
17
19
``` toml
18
20
[dependencies ]
19
- base_sequence_compression = " 0.1 .0"
21
+ base_sequence_compression = " 1.0 .0"
20
22
```
21
23
22
24
### Example
@@ -55,13 +57,35 @@ pub fn compress_sequence(sequence: &str) -> Vec<u8>
55
57
Decompresses binary data back into the original DNA sequence .
56
58
57
59
```rust
58
- pub fn decompress_sequence (compressed : & [u8 ], sequence_length : usize ) -> io :: Result <String > {
60
+ pub fn decompress_sequence (compressed : & [u8 ], sequence_length : usize ) -> io :: Result <String >
59
61
```
60
62
61
63
- * * Input ** : `& [u8 ]` - The compressed binary data .
62
64
- * * Input ** : `usize ` - The length of the original DNA sequence .
63
65
- * * Output ** : `io :: Result <String >` - The decompressed DNA sequence .
64
66
67
+ ### `compress_fasta `
68
+
69
+ Compresses a FASTA file containing DNA sequences .
70
+
71
+ ```rust
72
+ pub fn compress_fasta (content : & str ) -> Vec <u8 >
73
+ ```
74
+
75
+ - * * Input ** : `& str ` - The content of the FASTA file .
76
+ - * * Output ** : `Vec <u8 >` - The compressed binary data .
77
+
78
+ ### `decompress_fasta `
79
+
80
+ Decompresses binary data back into the original FASTA file content .
81
+
82
+ ```rust
83
+ pub fn decompress_fasta (data : & [u8 ]) -> String
84
+ ```
85
+
86
+ - * * Input ** : `& [u8 ]` - The compressed binary data .
87
+ - * * Output ** : `String ` - The decompressed FASTA file content .
88
+
65
89
## Tests
66
90
67
91
The library includes a comprehensive set of tests to ensure the correctness of the compression and decompression functions . To run the tests , use the following command :
0 commit comments