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.1.tar.gz (148.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: better_fasta_grep-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 660cc591be5384043f6e3303f1370b79ac48e7b591548fe75c58259172bf0602
MD5 1d5cca9a6545498b93bf436f0ece7416
BLAKE2b-256 a98add060a4083df75257a4a4f130b78384f01e9f59c3091ac10d17e591c5a67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: better_fasta_grep-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de242db1b63f05bdf96a7005d2940a331ec76f23a67e86a6d66b72e023f095b6
MD5 085528c257288894fbf3dfa9a5edd360
BLAKE2b-256 16ada0e4008a290c0887ad16fa4f85306ece55d20d6ad410f2a0570320db3336

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