FASTA-formatted file manipulation"

How to convert a FASTA file with sequences written on several lines into a FASTA file with each sequence written on one line?

The following awk one-liner converts the FASTA-formatted sequence file $infile into the reformatted FASTA file $outfile:

[170212ac]

How to convert a FASTA file with each sequence written on one line into a FASTA file with each sequence broken into several equal length lines?

The following one-liners allow each sequence inside the FASTA-formatted file $infile to be broken into several lines of lengths up to $cutoff characters that are written into the FASTA file $outfile.

awk

[170212ac]

Bash

[170212ac]

How to reverse-complement a FASTA-formatted nucleotide sequence?

Given a FASTA-formatted file $infile containing a nucleotide sequence, the following command lines will write its reverse-complement into the FASTA-formatted file $outfile.

[200208ac]

How to extract a specific region from a FASTA-formatted nucleotide sequence file?

Given a string $name and two nucleotide indexes (i.e. $start and $end), the following command lines will search for the first sequence containing the pattern $name inside the FASTA-formatted file $infile, and next write into $outfile its subsequence determined by $start and $end (both inclusive).

awk

[170328ac]

eFASTA

The program eFASTA is dedicated to the extraction of subsequence.

[170328ac]

How to translate a FASTA-formatted codon sequence?