A command line tool and Rust library for working with recombination maps.

Related tags

Command-line recmap
Overview

Crates.io Crates.io docs Rust CI DOI

RecMap library (and command line tool) for reading and working with recombination maps in Rust

A RecMap object can be created from reading in a HapMap-formatted recombination map. Note that since the HapMap recombination format does not include the chromosome lengths, this must be specified too. A convenience function read_seqlens is provided to read in TSV-formatted "genome" files of the chromosome names and lengths.

Here is a example which loads a recombination map from a HapMap-formatted recombination map and calculates the total map lengths.

use recmap::prelude::*;
let seqlens = read_seqlens("hg38_seqlens.tsv")
                  .expect("could not read seqlens");
let rec_map = RecMap::from_hapmap("decode_2019_map.txt", seqlens)
                  .expect("cannot read hapmap");

for (name, rate_map) in rec_map.iter() {
    println!("{}\t{}", name, rate_map.total_map_length().unwrap());
}

This example can be run on the command line with:

cargo run --example  calc_map_lengths --  --seqlens hg38_seqlens.tsv decode_2019_map.txt

One of the most common tasks when working with recombination maps is to estimate the map position of arbitrary markers, which is usually done by linear interpolation. RecMap provides an easy way to do this for one position (RecMap.interpolate_map_position()) and for many positions, with RecMap.interpolate_map_positions():

use recmap::prelude::*;
let seqlens = read_seqlens("hg38_seqlens.tsv")
                  .expect("could not read seqlens");
let rec_map = RecMap::from_hapmap("decode_2019_map.txt", seqlens)
                  .expect("cannot read hapmap");

let positions = vec![11975064, 15007450];
rec_map.interpolate_map_positions("chr1", &positions);

Command line tool

Additionally, recmap had an optional command line tool feature that interpolates recombination map positions and recombination rates, given BED3 input:

$ recmap interp --seqlens hg38_seqlens.tsv --hapmap decode_2019_map.txt \
   hg38_1Mb_windows.bed --output decode_2019_map_1Mb_summaries.tsv --header

Currently the command line tool only has one subcommand, though more features may be added. Please file an issue if there is a feature you'd like!

Installation

To use the library in your own Rust projects, install with:

$ cargo add recmap

To install the command line tool, use:

$ cargo install recmap --features=cli
You might also like...
H2O Open Source Kubernetes operator and a command-line tool to ease deployment (and undeployment) of H2O open-source machine learning platform H2O-3 to Kubernetes.
H2O Open Source Kubernetes operator and a command-line tool to ease deployment (and undeployment) of H2O open-source machine learning platform H2O-3 to Kubernetes.

H2O Kubernetes Repository with official tools to aid the deployment of H2O Machine Learning platform to Kubernetes. There are two essential tools to b

🍅 A command-line tool to get and set values in toml files while preserving comments and formatting

tomato Get, set, and delete values in TOML files while preserving comments and formatting. That's it. That's the feature set. I wrote tomato to satisf

tmplt is a command-line interface tool that allows you to quickly and easily set up project templates for various programming languages and frameworks
tmplt is a command-line interface tool that allows you to quickly and easily set up project templates for various programming languages and frameworks

tmplt A User Friendly CLI Tool For Creating New Projects With Templates About tmplt is a command-line tool that lets users quickly create new projects

🎙 A compact library for working with user output
🎙 A compact library for working with user output

🎙 Storyteller A library for working with user output Table of contents 👋 Introduction 🖼 Visualized introduction 📄 Example source code ❓ Origins 💖

Command line tool for cheap and efficient email automation written in Rust

Pigeon Pigeon is a command line tool for automating your email workflow in a cheap and efficient way. Utilize your most efficient dev tools you are al

A Rust command line tool to simplify embedded development and deployment.

Bobbin-CLI bobbin-cli is a tool designed to make it easy to build, deploy, test and debug embedded devices using a unified CLI. bobbin-cli understands

rip is a command-line deletion tool focused on safety, ergonomics, and performance

rip (Rm ImProved) rip is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does not imple

verilot (verifiable lottery) is a command line tool for running and verifying one-time lotteries.

verilot verilot (verifiable lottery) is a command line tool for running and verifying one-time lotteries. Install Install Rust and Cargo with Rustup.

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

Releases(v0.2.3)
  • v0.2.3(Feb 9, 2024)

Owner
Vince Buffalo
Evolutionary geneticist at UC Berkeley, former bioinformatician. ♥s probability, statistics. Author of book Bioinformatics Data Skills.
Vince Buffalo
Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're working with files or directories, this tool simplifies common file operations with ease.

Rust FileOps Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're w

Harikesh Ranjan Sinha 5 May 2, 2024
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Dynamic, Type-Erased Key-Value Maps in Rust

Dynamic Objects in Rust Do you love Rust but are tired of being constrained by static typing when you need a map to hold values of different types? Do

Travis A. Wagner 12 Feb 25, 2024
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

Boston Vanseghi 4 Oct 24, 2022
⌚ A command-line tool (and library) for the rusty Swatch Internet Time.

⌚ A command-line tool (and library) for the rusty Swatch Internet Time. Comes with XBar/Swiftbar support.

Gil Desmarais 4 Jul 18, 2022
A command-line tool for re-packaging an epub that has been unzipped. Can also be used as a library.

?? zaino A command-line tool for re-packaging an epub that has been unzipped. Can also be used as a library. Installation To use zaino as a library, a

Zachary Golba 3 Aug 17, 2023
A workflow tool for quickly running / testing something you are working on

runfast What is it? This is a program intended to be run in a project directory to set up a project run command, and remember it so we dont have to ty

anna 4 Dec 16, 2022
REC2 (Rusty External Command and Control) is client and server tool allowing auditor to execute command from VirusTotal and Mastodon APIs written in Rust. 🦀

Information: REC2 is an old personal project (early 2023) that I didn't continue development on. It's part of a list of projects that helped me to lea

Quentin Texier (g0h4n) 104 Oct 7, 2023
Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Vitaly Shukela 3 Jan 3, 2023