Skip to content

Commit f819bb9

Browse files
committed
Update readme
1 parent 3766ee0 commit f819bb9

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Base Sequence Compression is a Rust library for compressing and decompressing DN
77
- **Compression and Decompression**: Compress DNA sequences into a binary format and decompress them back to their original form.
88
- **Error Handling**: Handles invalid DNA sequences by panicking, ensuring data integrity.
99
- **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.
1012

1113
## Usage
1214

@@ -16,7 +18,7 @@ Add the following to your `Cargo.toml`:
1618

1719
```toml
1820
[dependencies]
19-
base_sequence_compression = "0.1.0"
21+
base_sequence_compression = "1.0.0"
2022
```
2123

2224
### Example
@@ -55,13 +57,35 @@ pub fn compress_sequence(sequence: &str) -> Vec<u8>
5557
Decompresses binary data back into the original DNA sequence.
5658

5759
```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>
5961
```
6062

6163
- **Input**: `&[u8]` - The compressed binary data.
6264
- **Input**: `usize` - The length of the original DNA sequence.
6365
- **Output**: `io::Result<String>` - The decompressed DNA sequence.
6466

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+
6589
## Tests
6690

6791
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

Comments
 (0)