#filter #line #sam #fasta #fastq #command-line-tool #vcf

bin+lib filterx

A command line tool to filter data by using python-like syntax

17 releases

0.3.4 Jan 8, 2025
0.3.3 Dec 27, 2024
0.2.12 Nov 28, 2024
0.1.0 Oct 31, 2024

#363 in Biology

Download history 389/week @ 2024-10-30 310/week @ 2024-11-06 298/week @ 2024-11-13 263/week @ 2024-11-20 149/week @ 2024-11-27 104/week @ 2024-12-04 221/week @ 2024-12-11 1/week @ 2024-12-18 150/week @ 2024-12-25 132/week @ 2025-01-08

284 downloads per month

MIT and LGPL-3.0-only

230KB
6.5K SLoC

filterx

filterx logo

pypi Github Release PyPI Downloads

A fast command-line tool to filter lines by column-based expression.

Features

  • 🚀 Filter lines by column-based expression
  • 🎨 Support multiple input formats e.g. vcf/sam/fasta/fastq/gff/bed/csv/tsv
  • 🎉 Cross-platform support
  • 📦 Easy to install
  • 📚 Rich documentations

Installation

Using pip or cargo to install filterx:

pip install filterx
cargo install filterx

Download the latest release from releases.

Quick Start

example.csv
id,name,city,phone,gender
1,Alice,New York,123456,F
2,Bob,Los Angeles,234567,M
3,Charlie,Chicago,345678,M
4,David,Houston,456789,M
5,Eve,Phoenix,567890,F
6,Frank,Philadelphia,678901,M
7,Grace,San Antonio,789012,F
8,Heidi,San Diego,890123,F
9,Ivan,Dallas,901234,M
10,Judy,San Jose,012345,F
11,Kevin,New York,123456,M
12,Linda,Los Angeles,234567,F
13,Michael,Chicago,345678,M
14,Nancy,Houston,456789,F
15,Oliver,Phoenix,567890,M
filterx c example.csv -e "city in ('New York', 'Los Angeles')" -e "gender == 'F'" -e "select(name, id)"

Output:

name,id
Alice,1
Linda,12

Documentation

filterx has a built-in help system, you can use filterx info --list to list all available built-in functions, and use filterx info <command> to get help for a specific function.

Star History

Star History Chart

Dependencies

~51–84MB
~1.5M SLoC