Skip to main content

Grep-like tool for retrieving matching sequence records from a FASTA file

Project description

Better FASTA Grep

BFG logo - a pair of binoculars

Better FASTA Grep, or BFG for short, is a Grep-like utility for retrieving matching sequence records from a FASTA file. Given one or more patterns and a FASTA file, it searches the file for matching headers and or sequences and outputs any matching headers, sequences, or both.

Features

  • Search headers, sequences, or both
  • Search via regular expressions or plain strings
  • Case-insensitive search
  • Select non-matching sequence records
  • Count the number of matches
  • Display line numbers in the result
  • Sequence records, not individual lines, are selected
  • Multi-line sequences are treated as singular units
  • Flexible output options: output headers, sequences, or both
BFG Screenshot

A screenshot of running BFG under macOS Mojave.

Quick installation

Download the script onto your computer by clicking the 'Download' button on this page, or use git to copy the bfg project into your current directory:

git clone https://github.com/fethalen/better_fasta_grep

Make the script executable by typing chmod +x bfg, while in the bfg directory. bfg can now be run by typing the following command.

./bfg --help

If you see yourself using this tool frequently, then you can add it to your path, so that you can reference it from any working directory. First, put the bfg directory into a permanent location (not your Desktop or Downloads folder). I keep my copy of bfg in my ~/projects directory, so for me I would type:

export PATH=$PATH:${HOME}/projects/bfg >> ~/.bashrc

Documentation

  1. Introduction
  2. Installation
  3. Invoking bfg
  4. Regular Expressions
  5. Input Data
  6. Usage

© Department for Animal Evolution and Biodiversity 2019

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

better_fasta_grep-1.0.0.tar.gz (148.5 kB view details)

Uploaded Source

Built Distribution

better_fasta_grep-1.0.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file better_fasta_grep-1.0.0.tar.gz.

File metadata

  • Download URL: better_fasta_grep-1.0.0.tar.gz
  • Upload date:
  • Size: 148.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for better_fasta_grep-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fa8671e4d0cec561f006a9ff986e7001f23947e7e7f325ade69b6479543b5bd8
MD5 5953781f88999b8b49f1bd159ba7530f
BLAKE2b-256 01f07a631941008c5e37705f4e3fd17b9ca05c6b19691802c3a61582b1dafc4c

See more details on using hashes here.

File details

Details for the file better_fasta_grep-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: better_fasta_grep-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for better_fasta_grep-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46e626714bb530c5626f887ce834e263d6103ca2d6fe3e6906c8aa216f6198eb
MD5 3e46248cbcdd3d548fbfb276438cfbef
BLAKE2b-256 3e21173b89c39536f1722b6952211c987a6f5308765dd305afd5a0cb7b4a0d73

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page