Combine FASTA

Concatenate a multi-FASTA file into a single sequence, with coordinates for every part.

Combined sequence

What does combining FASTA records do?

Every record of the pasted file is read, the sequences are laid end to end in the order they appear, and the result is written as one record under a single header. Nothing is sorted and nothing is removed, so the combined sequence is as long as the sum of its parts, plus any linker you insert between them. This is how a pseudo-genome is made from contigs, how scaffolds are built from ordered fragments, and how a fusion construct or a synthetic cassette is written out before ordering it.

Because the individual headers disappear, the tool prints a coordinate table: the first and last position of every source record inside the combined sequence. Keep it, since it is the only way back to the parts once they are joined.

Worked example

The example holds three fragments of 43, 36 and 35 bases. Joined with nothing between them the combined sequence is 114 bases long and the table reads

RecordLengthStartEnd
BRCA1 exon 1 fragment43143
p53 fragment364479
lacZ promoter fragment3580114

Choose the 10 × N spacer instead and the same three fragments sit at 1 to 43, 54 to 89 and 100 to 134 in a sequence of 134 bases: two spacers of ten N add twenty bases and shift everything after the first junction.

start of record k = end of record k−1 + linker length + 1

When a linker is worth it

A junction between two unrelated sequences is an artefact. Without a spacer, a read, a primer pair or an open reading frame can appear to cross it and be reported as real. A run of N cannot match anything, so most tools stop there, and scaffolding formats use exactly that convention (a hundred N marks a gap of unknown length). For a protein fusion the point is different: the linker is part of the construct, so type the real one, for example GGGGSGGGGS.

Frequently asked questions

How do I merge several FASTA sequences into one?

Paste the multi-record file and the tool concatenates the records in the order they appear, under a single header you choose. The coordinate table shows where each original record starts and ends in the combined sequence, so you can find any of them again.

Why put a run of N between the records?

A join creates a junction that exists in no real molecule. A spacer of unknown bases keeps the sequences apart so that aligners, gene finders and primer tools do not read across the boundary and report a match, an open reading frame or a primer pair that spans two different sequences. Ten N is enough for short-read aligners, and a hundred is the scaffolding convention.

Do the coordinates include the spacer?

Yes. The start and end of every record are positions in the finished combined sequence, counted from 1, so the spacer bases push the later records along. With no spacer, each record starts one base after the previous one ends.

Can I combine protein sequences?

Yes, any letters are accepted, so protein and aligned sequences work too. For protein a custom linker such as GGGGSGGGGS is the usual choice, because a flexible glycine and serine linker is what a fusion construct actually contains. Runs of N are meant for nucleotides.

Is this the same as concatenating files?

No. Putting two FASTA files together end to end gives one file with two records. This tool gives one record: a single sequence with one header, which is what a pseudo-genome, a scaffold or a fusion construct needs.