Home Software Services About Contact     

fastx_truncate command

Truncates and / or pads sequences in a FASTA or FASTQ.

If the -trunclen n option is specified, sequences are truncated at length n. Shorter sequences are discarded. If the -padlen option is specified, padding occurs before truncating.

Output is written to -fastaout (FASTA) and/or -fastqout (FASTQ).

The -stripleft n option removes n letters at the start of a sequence.

The -stripright n option removes n letters at the end of a sequence.

The -padlen n option appends Ns at the end of the sequence as needed to increase the length to n. If the length is already >= n, then the sequence is unchanged. (Requires v8.0.1611 or later).

The -padq c option specifies the ASCII character to use for padding the quality scores in a FASTQ file if -padlen is specified. Default is I (upper-case letter i), which means Phred score Q=40 with most current FASTQ files (see FASTQ file parameters for discussion).

The -relabel xxx option specifies that new sequence labels should be generated. The new labels are xxx followed by 1, 2, 3...

The -label_suffix option specifies a string that is appended to the sequence labels.


usearch -fastx_truncate reads.fastq -trunclen 200 -label_suffix _200 -fastaout reads_200.fa