Expand description
§psltools
A high-performance library and CLI for the PSL alignment format (BLAT/lastz
output), modeled on chaintools.
§Design
- Zero-copy parsing. Names and PSLx sequence columns are
ByteSliceviews into a shared (memory-mapped or owned) buffer; the three block coordinate lists live in one structure-of-arrays arena. The whole-fileReaderallocates nothing per record. - One record per line. Unlike chain, a PSL record is a single line, so parsing chunks in parallel, indexing, and streaming are all simple.
- Kent-exact scoring.
psl_score/milli_bad/percent_idreproducekent/src/lib/psl.cbit-for-bit (includingrepMatch >> 1,sizeMulderivation, andi32integer semantics). - Correctness on the hard corners. Negative-strand
qStarts/tStarts, translated (two-char) strands, and PSLx sequence columns are handled in the model from the start.
§Quick start
use psltools::Reader;
let reader = Reader::<psltools::Psl>::from_path("example.psl")?;
for psl in reader.records() {
println!(
"{} -> {} score={}",
psl.query_name_str(),
psl.reference_name_str(),
psl.score()
);
}§Feature flags
mmap(default): memory-map inputs for zero-copy parsing.cli(default): build thepsltoolsbinary (impliesparallel).gzip: transparently read/write.gzPSL.parallel: multi-threaded parsing and parallel record iteration.index: record-offset and interval indexes.serde: deriveSerialize/Deserializeon the owned types.bigcoords: widenCoordtou64for exotic assemblies.
Re-exports§
pub use model::Coord;pub use model::block::Block;pub use model::block::BlockSlice;pub use model::block::Blocks;pub use model::error::PslError;pub use model::psl::Psl;pub use model::psl::PslFlavor;pub use model::psl::PslRecord;pub use model::psl::PslxSeq;pub use model::psl::Strand;pub use model::psl::Strands;pub use io::reader::Reader;pub use io::reader::ReaderOptions;pub use io::storage::ByteSlice;pub use io::stream::OwnedBlocks;pub use io::stream::OwnedPsl;pub use io::stream::OwnedPslHeader;pub use io::stream::StreamItem;pub use io::stream::StreamingReader;pub use io::writer::PslWriter;pub use io::writer::write_psl;pub use io::writer::write_psl_header;pub use ops::check::CheckReport;pub use ops::check::check;pub use ops::convert::to_bed;pub use ops::convert::to_bed12;pub use ops::convert::to_genepred;pub use ops::score::ScoreOpts;pub use ops::score::milli_bad;pub use ops::score::percent_id;pub use ops::score::psl_score;pub use ops::swap::swap;pub use ops::swap::swap_with;pub use genepred;