Skip to content

Filtration String Usage and Examples

Matthew Mosior edited this page Sep 15, 2020 · 39 revisions

Introduction

This wiki page serves to help users of bvf better understand filtration strings and ways to compose useful unix pipelines using bvf.

More About Filtration Strings

Filtration strings are the language that bvf uses to filter .tsv files.
A single filtration string is made up of four discrete components:

;COLUMNOFFILTRATION:STRUCTURE~OPERATION~COMPARISON;

  • Column of Filtration: The column that bvf filters on.
  • Structure: The structure of the data within the column that bvf filters on.
  • Operation: The operation to perform on the data within the column that bvf filters on.
  • Comparison: The comparison to perform on the operation-transformed data within the column that bvf filters on.

Supported Structures within Filtration Strings

The following structures are supported by bvf:

  • x,y: This structure should be used for two-piece data (i.e. 32,54)
  • x: This structure should be used for one-piece data (2.241)

Supported Operations within Filtration Strings

The following operators are supported by bvf:

  • + : Addition
  • - : Subtraction
  • | : Null (do nothing)

Supported Comparisons within Filtration Strings

The following operators are supported by bvf:

  • >= : Greater than or equal to
  • <= : Less than or equal to
  • == : Equality

Filtration String Examples

The following examples will help guide users through more complex filtration situations.

Example 1: Simple cat -> This example shows the default behavior of the program.

File Input Output
alt text $ ./bvf inputfile.tsv alt text

Example 2: Filter on Two-Piece Field -> This example shows how to filter on a Two-Piece Field.