fastas2fasta.py - concatenate sequences from multiple fasta files

Tags

Genomics Sequences MultipleAlignments FASTA Manipulation

Purpose

This script reads sequences from two or more fasta formatted files and outputs a new file with the sequences concatenated per entry.

All files must have the same number of sequences and the id of the first file is output.

Usage

Example:

python fastas2fasta.py a.fasta b.fasta > c.fasta

If a.fasta is:

>1
AAACC
>2
CCCAA

and b.fasta is:

>a
GGGGTTT
>b
TTTTGGG

then the output will be:

>1
AAACCGGGGTTT
>2
CCCAATTTTGGG

Type:

python fastas2fasta.py --help

for command line help.

Command line options

usage: fastas2fasta [-h] [--timeit TIMEIT_FILE] [--timeit-name TIMEIT_NAME]
                    [--timeit-header] [--random-seed RANDOM_SEED]
                    [-v LOGLEVEL] [--log-config-filename LOG_CONFIG_FILENAME]
                    [--tracing {function}] [-? ?] [-I STDIN] [-L STDLOG]
                    [-E STDERR] [-S STDOUT]
fastas2fasta: error: argument -?: expected one argument