Sequence formatter
Lay a sequence out in numbered blocks, the way GenBank and journals print it.
Lay a sequence out in numbered blocks, the way GenBank and journals print it.
Sequence files are stored as one long string, which is right for a computer and hard for a person. Printed sequences are broken into lines of a fixed width, split into small blocks with a space between them, and labelled with the position of the first character on each line. This page applies that layout to anything you paste: plain sequence or a multi-record FASTA file, DNA, RNA or protein. FASTA header lines are kept and the records stay in order.
Everything that is not a letter, a gap or a stop is dropped before formatting, so a sequence that already carries numbering and spaces can be pasted straight from a paper or a GenBank entry and laid out again with different settings.
The example is a 93 base fragment of human beta-globin. With the default 60 characters per line, blocks of 10, position numbers on and uppercase, it comes out as
>beta-globin fragment 1 ATGGTGCACC TGACTCCTGA GGAGAAGTCT GCCGTTACTG CCCTGTGGGG CAAGGTGAAC 61 GTGGATGAAG TTGGTGGTGA GGCCCTGGGC AGG
The first line holds 60 bases in six blocks of ten and starts at position 1; the second starts at position 61 and ends after the 93rd base. The number width is taken from the largest number that will appear, so all lines stay aligned.
The formatted text is for reading. To go back to a plain, analysable sequence, strip the spaces and numbers with the gap cleaner.
Blocks of ten let you count a position by eye: the third block starts at base 21, so the fourth character of it is base 24. GenBank, EMBL and most journals use ten, with six blocks to a line of sixty. The spaces are for reading only and are not part of the sequence.
Yes, formatted output is for reading, printing and figures, not for analysis. Most programs ignore digits and spaces inside a sequence, but not all do. To turn a formatted sequence back into plain sequence, paste it into the gap cleaner, which strips spaces, digits and line breaks.
The number is the position of the first character on that line, counted from 1. With a line width of 60 the numbers are 1, 61, 121 and so on. This is the GenBank ORIGIN style. The numbers are right-aligned so that the sequence columns stay lined up on every line.
It only changes the case if you ask it to. Letters, gap characters and stops are kept in the order they were pasted; digits, spaces and line breaks in the input are removed first, so a sequence that was already numbered can be reformatted safely. The character count in the result bar is the count after that cleanup.
Yes. Set the block size to 3 to see codons, to 0 to switch grouping off, or to any value up to the line width. If the block size does not divide the line width the last block on each line is simply shorter.