Skip to content

Commit 6717466

Browse files
committed
Increase capnproto size limit
Bump limit for Mash Make Clippy happy Fix comment. Decrease limit
1 parent fc85af0 commit 6717466

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ This repository provides a library and command-line interface that reimplements
1212
You may build Finch from source, which requires Rust >= `1.49`. Rust's Cargo package manager (see [rustup](https://www.rustup.rs) for Cargo installation instructions) can automatically build and install Finch with `cargo install finch_cli`.
1313
If you require python bindings, you must take extra steps (see [python support](#python-support)). Alternatively, [download a prebuilt binary](https://github.com/onecodex/finch-rs/releases) or install from [PyPi](https://pypi.org/project/finch-sketch/) `pip install finch-sketch`.
1414

15+
### Building ###
16+
17+
To compile from source:
18+
19+
```sh
20+
# from finch-rs
21+
cargo +nightly-2023-06-28 build --release
22+
```
23+
1524
### Example Usage ###
25+
1626
To get started, we first compute sketches for several FASTA or FASTQ files. These sketches are compact, sampled representations of the underlying genomic data, and what allow `finch` to rapidly estimate distances between datasets. Sketching files uses the `finch sketch` command:
1727

1828
```

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ path = "src/main.rs"
1616

1717
[dependencies]
1818
clap = "2.33.0"
19-
finch = "0.6"
19+
finch = { path = "../lib" }
2020
serde_json = "1"
2121
anyhow = "1"
2222

lib/src/serialization/json.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize};
99
use crate::bail;
1010
use crate::errors::FinchResult;
1111
use crate::filtering::FilterParams;
12-
pub use crate::serialization::mash::{read_mash_file, write_mash_file};
1312
use crate::serialization::Sketch;
1413
use crate::sketch_schemes::{KmerCount, SketchParams};
1514

lib/src/serialization/mash.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ pub fn write_mash_file(file: &mut dyn Write, sketches: &[Sketch]) -> FinchResult
5858
}
5959

6060
pub fn read_mash_file(file: &mut dyn BufRead) -> FinchResult<Vec<Sketch>> {
61-
let options = *message::ReaderOptions::new().traversal_limit_in_words(Some(1024 * 1024 * 1024));
61+
let options = *message::ReaderOptions::new().traversal_limit_in_words(
62+
// measured in words
63+
// 1 word = 8 bytes
64+
Some(2 * 1024 * 1024 * 1024),
65+
);
6266
let reader = capnp_serialize::read_message(file, options)?;
6367
let mash_data: min_hash::Reader = reader.get_root::<min_hash::Reader>()?;
6468

lib/src/serialization/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ pub fn write_finch_file(file: &mut dyn Write, sketches: &[Sketch]) -> FinchResul
171171
}
172172

173173
pub fn read_finch_file(file: &mut dyn BufRead) -> FinchResult<Vec<Sketch>> {
174-
let options = *message::ReaderOptions::new().traversal_limit_in_words(Some(1024 * 1024 * 1024));
174+
let options = *message::ReaderOptions::new().traversal_limit_in_words(
175+
// measured in words
176+
// 1 word = 8 bytes
177+
Some(2 * 1024 * 1024 * 1024),
178+
);
175179
let reader = capnp_serialize::read_message(file, options)?;
176180
let cap_data: multisketch::Reader = reader.get_root::<multisketch::Reader>()?;
177181
let cap_sketches = cap_data.get_sketches()?;

0 commit comments

Comments
 (0)