Skip to content
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
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,13 @@ To build the tool the Rust stable (>= 1.75) toolchain is required, and can be do
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup toolchain install stable

```

### Windows

Follow the instructions at the site:
https://rustup.rs/

### Additional opt-in features

Additional features can be enabled by specifying them in the command line while building/installing GGCAT (ex. --features "feature1,feature2"):

- **kmer-counters**: Adds kmer abundance for each unitig, in a BCALM2 compatible format. If enabled GGCAT uses more memory while building colored graphs

### Building

Then the tool can be installed with the commands:
Expand All @@ -226,6 +219,15 @@ the binary is automatically copied to `$HOME/.cargo/bin`

To launch the tool directly from the command line, the above directory should be added to the `$PATH` variable.

### Features list

GGCAT ships with some features enabled by default. These default features can be disabled by specifying --no-default-features in the command line while building/installing GGCAT.
Individual features can be enabled by specifying them (ex. --features "feature1,feature2") in the command line while building/installing GGCAT.

| Feature name | Default | Description |
| -------- | ------- | ------- |
| **kmer-counters** | Yes | Adds kmer abundance for each unitig, in a BCALM2 compatible format. Disable to reduce memory usage while building colored graphs. |

## API usage

GGCAT has an API for both Rust and C++.
Expand Down
2 changes: 1 addition & 1 deletion crates/cmdline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ clap = { version = "4.5.50", features = ["derive"] }


[features]
default = ["full"]
default = ["full", "kmer-counters"]
memory-guards = ["parallel-processor/memory-guards"]
mem-analysis = ["parallel-processor/track-usage"]
no-stats = ["parallel-processor/no-stats"]
Expand Down
2 changes: 1 addition & 1 deletion crates/io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ parking_lot = "0.12.3"
byteorder = "1.5.0"
lz4 = "1.25.0"
bzip2 = "0.4.4"
xz2 = "0.1.7"
liblzma = "0.4.7"
zstd = "0.13.2"
flate2 = "1.0.30"
bstr = "1.9.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/io/src/lines_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl LinesReader {
);
});
} else if path.as_ref().extension().filter(|x| *x == "xz").is_some() {
let file = xz2::read::XzDecoder::new(
let file = liblzma::read::XzDecoder::new(
File::open(&path).expect(&format!("Cannot open file {}", path.as_ref().display())),
);
self.read_stream_buffered(file, callback)
Expand Down
2 changes: 1 addition & 1 deletion crates/querier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ lz4 = "1.25.0"
flate2 = "1.0.30"
zstd = "0.13.2"
bzip2 = "0.6.1"
xz2 = "0.1.7"
liblzma = "0.4.7"
ggcat-logging = { version = "2.2.0", path = "../logging" }
anyhow = "1.0.89"
typenum = "1.18.0"
Expand Down
29 changes: 15 additions & 14 deletions crates/querier/src/pipeline/colored_query_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum QueryOutputFileWriter {
GzipCompressed(Option<flate2::write::GzEncoder<File>>),
ZstdCompressed(Option<zstd::stream::write::Encoder<'static, File>>),
BZ2Compressed(Option<bzip2::write::BzEncoder<File>>),
XZCompressed(Option<xz2::write::XzEncoder<File>>),
XZCompressed(Option<liblzma::write::XzEncoder<File>>),
}

impl Write for QueryOutputFileWriter {
Expand Down Expand Up @@ -137,12 +137,10 @@ pub fn colored_query_output<MH: HashFunctionFactory, CX: ColorsManager>(
.unwrap(),
)),
Some("gz") => {
QueryOutputFileWriter::GzipCompressed(Some(
flate2::GzBuilder::new().write(
query_output_file,
Compression::new(output_compression_level.min(9)),
),
))
QueryOutputFileWriter::GzipCompressed(Some(flate2::GzBuilder::new().write(
query_output_file,
Compression::new(output_compression_level.min(9)),
)))
}
Some("zst") | Some("zstd") => QueryOutputFileWriter::ZstdCompressed(Some(
zstd::stream::write::Encoder::new(
Expand All @@ -151,15 +149,18 @@ pub fn colored_query_output<MH: HashFunctionFactory, CX: ColorsManager>(
)
.unwrap(),
)),
Some("bz2") => QueryOutputFileWriter::BZ2Compressed(Some(
bzip2::write::BzEncoder::new(
Some("bz2") => {
QueryOutputFileWriter::BZ2Compressed(Some(bzip2::write::BzEncoder::new(
query_output_file,
bzip2::Compression::new(output_compression_level.min(9)),
),
)),
Some("xz") => QueryOutputFileWriter::XZCompressed(Some(
xz2::write::XzEncoder::new(query_output_file, output_compression_level.min(9)),
)),
)))
}
Some("xz") => {
QueryOutputFileWriter::XZCompressed(Some(liblzma::write::XzEncoder::new(
query_output_file,
output_compression_level.min(9),
)))
}
_ => QueryOutputFileWriter::Plain(Some(query_output_file)),
},
),
Expand Down
2 changes: 1 addition & 1 deletion crates/sequence_output/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ parking_lot = "0.12.5"
serde = "1.0.228"
zstd = "0.13.3"
bzip2 = "0.6.1"
xz2 = "0.1.7"
liblzma = "0.4.7"


[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/sequence_output/src/structured_sequences/fasta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<CX: ColorsManager, LinksInfo: IdentSequenceWriter> StructuredSequenceBacken
}

fn new_compressed_xz(path: impl AsRef<Path>, level: u32) -> Self {
let compress_stream = xz2::write::XzEncoder::new(
let compress_stream = liblzma::write::XzEncoder::new(
BufWriter::with_capacity(DEFAULT_OUTPUT_BUFFER_SIZE, File::create(&path).unwrap()),
level,
);
Expand Down
2 changes: 1 addition & 1 deletion crates/sequence_output/src/structured_sequences/gfa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<const VERSION: u32, CX: ColorsManager, LinksInfo: IdentSequenceWriter>
}

fn new_compressed_xz(path: impl AsRef<Path>, level: u32) -> Self {
let compress_stream = xz2::write::XzEncoder::new(
let compress_stream = liblzma::write::XzEncoder::new(
BufWriter::with_capacity(DEFAULT_OUTPUT_BUFFER_SIZE, File::create(&path).unwrap()),
level,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use bzip2::write::BzEncoder;
use flate2::write::GzEncoder;
use liblzma::write::XzEncoder;
use std::{
fs::File,
io::{BufWriter, Write},
};
use xz2::write::XzEncoder;

pub(crate) trait SequencesFileFinish: Write {
fn finalize(self);
Expand Down