---
---
# `fibertools-rs`
<img src="./assets/img/fiber_tools_teal.png#gh-dark-mode-only" alt="fibertools-rs dark logo" width="200"/>
<img src="./assets/img/fiber_tools_grey.png#gh-light-mode-only" alt="fibertools-rs light logo" width="200"/>
[](https://github.com/fiberseq/fibertools-rs/actions)
[](https://anaconda.org/bioconda/fibertools-rs)
[](https://anaconda.org/bioconda/fibertools-rs)
[](https://crates.io/crates/fibertools-rs)
[](https://crates.io/crates/fibertools-rs)
[](https://zenodo.org/badge/latestdoi/517338593)
`fibertools-rs` a CLI tool for creating and interacting with fiberseq bam files.
# Install [](https://anaconda.org/bioconda/fibertools-rs)
`fibertools-rs` is avalible through `bioconda` and can be installed with the following command:
```bash
mamba install -c conda-forge -c bioconda fibertools-rs
```
However, due to size constraints in `bioconda` this version does not support m6a prediction or GPU acceleration. If you would like to use m6A prediction and GPU acceleration, you will need to install using the directions in the [INSTALL.md](/INSTALL.md) file.
# Usage
```bash
ft --help
```
[Help page for fibertools](/docs/ft--help.md)
# Subcommands for `fibertools-rs`
## `ft predict-m6a`
Predict m6A positions using HiFi kinetics data and encode the results in the MM and ML bam tags. [Help page for predict-m6a](/docs/ft-predict-m6a-help.md).
## `ft add-nucleosomes`
Add nucleosomes to a bam that file already contains m6a predictions. Note, this process is also run in the background during `predict-m6a`, so it is unnecessary to run independently unless you want to try new parameters for nucleosome calling. [Help page for add-nucleosomes](/docs/ft-add-nucleosomes-help.md).
## `ft extract`
Extracts Fiber-seq data from a bam file into plain text. [Help page for extract](/docs/extract.md).

## `ft center`
Center Fiber-seq reads (bam) around reference position(s). [Help page for center](/docs/center.md).

# Python API (`pyft`)
The python API is still in development and not stable; however, you can find the current code progress in the [py-ft](/py-ft) folder. More information available at [readthedocs](https://py-ft.readthedocs.io/en/latest/).
# Cite
**Jha, A.**, **Bohaczuk, S. C.**, Mao, Y., Ranchalis, J., Mallory, B. J., Min, A. T., Hamm, M. O., Swanson, E., Finkbeiner, C., Li, T., Whittington, D., Stergachis, A. B., & **Vollger, M. R.** (2023). DNA-m6A calling and integrated long-read epigenetic and genetic analysis with **fibertools**. _bioRxiv_. https://doi.org/10.1101/2023.04.20.537673
# TODO items
- [ ] Use new iterator for `ft extract` and group writes to try and improve the speed
- [ ] long format extract command
- [ ] Improve progress bar for predict-m6a.
- [ ] Get size of bam, say how far we are through the bam in terms of MB/GB?
- [x] Add a python API (see py-ft for progress)
- [ ] add default data viz
- [ ] add conversion to pandas data frame or maybe anndata
- [x] GPU support
- [ ] see if I can simplify or statically link PyTorch to get it onto bioconda
- [ ] Detect GPU memory to set batch size dynamically.
- [ ] Add unaligned, secondary, supplemental reads to the test bam.
# Contributing
If you would like to contribute to `fibertools-rs`, please see the [CONTRIBUTING.md](/CONTRIBUTING.md) file for more information.