Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

ggirelli/fastx-barber

Repository files navigation

fastx-barber

DOI Release ID Release date
PyPI - Python Version PyPI - Status GitHub Actions Python package status
license Code size
Watch no. Stars no.

PyPi | docs

A Python3.8+ package to trim and extract flags from FASTA and FASTQ files.

Features (in short)

  • Works on both FASTA and FASTQ files.
  • Selects reads based on a pattern (regex).
  • Trims reads by pattern (regex), length, or single-base quality.
  • Extracts parts (flags) of reads based on a pattern and stores them in the read headers.
  • Generates BED file with the locations of a substring in FASTX records.
  • Regular expression support fuzzy matching (fuzzy matching might affect the barber's speed).
  • Parallelizes processing by splitting the fastx file in chunks.

For more available features, check out our docs!

Requirements

fastx-barber has been tested with Python 3.8 and 3.9. We recommend installing it using pipx (see below) to avoid dependency conflicts with other packages. The packages it depends on are listed in our dependency graph. We use poetry to handle our dependencies.

Install

We recommend installing fastx-barber using pipx. Check how to install pipx here if you don't have it yet!

Once you have pipx ready on your system, install the latest stable release of fastx-barber by running: pipx install fastx-barber. If you see the stars (✨ 🌟 ✨), then the installation went well!

Usage

Run:

  • fbarber to access the barber's services.
  • fbarber find_seq to extract the locations of a sequence (e.g., restriction site) in FASTX records.
  • fbarber flag to extract or manipulate read flags.
  • fbarber match to select reads based on a pattern (regular expression).
  • fbarber trim to trim your reads.

Add -h to see the full help page of a command!

Contributing

We welcome any contributions to fastx-barber. In short, we use black to standardize code format. Any code change also needs to pass mypy checks. For more details, please refer to our contribution guidelines if this is your first time contributing! Also, check out our code of conduct.

License

MIT License - Copyright (c) 2020-21 Gabriele Girelli