test.fa
1>seq1
2ACGGGGT
3>seq2
4ACGTAAAAAA
gc
computes the GC content of a sequence.
1filterx fasta test.fa -e 'gc(seq) >= 0.5'
1### Output
2>seq1
3ACGGGGT
rev & rev_
rev_
reverses a sequence in place, while rev
will return a new reversed sequence.
reverses a sequence.
1filterx fasta test.fa -e 'rev_(seq)'
2
3### Output
4>seq1
5TGGGGCA
6>seq2
7AAAAAAAGCA
revcomp & revcomp_
reverses and complements a sequence.
1filterx fasta test.fa -e 'revcomp_(seq)'
2
3### Output
4>seq1
5ACCCCGT
6>seq2
7TTTTTTACGT
to_fasta & to_fa
converts a sequence to a FASTA format. Only available for fasta and fastq files.
test.fa
1>seq1
2ACGGGGT
3>seq2
4ACGTAAAAAA
5aa
1filterx fasta test.fa -e 'to_fasta()'
2
3### Output
4>seq1
5ACGGGGT
6>seq2
7ACGTAAAAAAaa
test.fq
1@name
2ACGGGGT
3+
4~~~~~~~
5@name2
6ACGTAAAAAA
7+
8~~~~~~~~~~
1filterx fastq test.fq -e 'to_fa()'
2
3### Output
4>name
5ACGGGGT
6>name2
7ACGTAAAAAA
Not only to_fasta/to_fa
can convert to FASTA, while using filterx fq --no-qual test.fq
will remove the quality information, and auto-convert to FASTA.
1filterx fq --no-qual test.fq
2
3### Output
4>name
5ACGGGGT
6>name2
7ACGTAAAAAA
to_fastq & to_fq
same as to_fasta
but for fastq files. Only available for fasta and fastq files.
phred
get the phred type of a fastq file.
qual
Compute the mean quality of a sequence.
test.fq
1@seq1
2ATGC
3+
4IIII
5@seq2
6ATGCC
7+
8IIIII
example
1filterx fq test.fq -e "print('{name}: {qual(seq)}')"
output
1# output
2seq1: 4.245115
3seq2: 3.9658952