[ fxtools filter ]

Summary

This command will filter your input fastx into an output fastx and retrieve all the sequences or headers that match your input pattern.

This pattern is a regex compatible pattern, and can also be inverted with the -v flag (like grep -v).

Expected Input

This will reverse complement each of the sequences and potential quality scores.

>AP2S1_a
ACTG
>AP2S1_b
ACTT
>AP2S2_a
CCCT

Expected Output

Filter on Sequence

fxtools filter -i <fasta> -p "ACT"
>AP2S1_a
ACTG
>AP2S1_b
ACTT

Filter on Header

fxtools filter -i <fasta> -p "_a" -H
>AP2S1_a
ACTG
>AP2S2_a
CCCT

Inverse Filter

fxtools filter -i <fasta> -p "ACT" -v
>AP2S2_a
CCCT

Usage

# standard filtering (on sequence)
fxtools filter -i <fastx> -p <pattern>

# filtering on header
fxtools filter -i <fastx> -p <pattern> -H

# inverse filter (removing all records that match pattern)
fxtools filter -i <fastx> -p <pattern> -v

# inverse filter (removing all records that match pattern) on header
fxtools filter -i <fastx> -p <pattern> -v -H