Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase capnproto size #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ This repository provides a library and command-line interface that reimplements
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`.
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`.

### Building ###

To compile from source:

```sh
# from finch-rs
cargo +stable build --release
```

### Example Usage ###

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:

```
Expand Down
1 change: 0 additions & 1 deletion lib/src/serialization/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize};
use crate::bail;
use crate::errors::FinchResult;
use crate::filtering::FilterParams;
pub use crate::serialization::mash::{read_mash_file, write_mash_file};
use crate::serialization::Sketch;
use crate::sketch_schemes::{KmerCount, SketchParams};

Expand Down
6 changes: 5 additions & 1 deletion lib/src/serialization/mash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ pub fn write_mash_file(file: &mut dyn Write, sketches: &[Sketch]) -> FinchResult
}

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

Expand Down
6 changes: 5 additions & 1 deletion lib/src/serialization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ pub fn write_finch_file(file: &mut dyn Write, sketches: &[Sketch]) -> FinchResul
}

pub fn read_finch_file(file: &mut dyn BufRead) -> FinchResult<Vec<Sketch>> {
let options = *message::ReaderOptions::new().traversal_limit_in_words(Some(1024 * 1024 * 1024));
let options = *message::ReaderOptions::new().traversal_limit_in_words(
// measured in words
// 1 word = 8 bytes
Some(2 * 1024 * 1024 * 1024),
);
let reader = capnp_serialize::read_message(file, options)?;
let cap_data: multisketch::Reader = reader.get_root::<multisketch::Reader>()?;
let cap_sketches = cap_data.get_sketches()?;
Expand Down
Loading