Sequence cleaner

Strips gaps, spaces, numbers and line breaks. FASTA headers stay. Nothing leaves the browser.

Cleaned

What does a sequence cleaner remove, and why?

Sequences copied from papers, databases and alignment viewers rarely arrive as a clean run of letters. They carry spaces and tabs between blocks, position numbers at the start of lines, gap characters from an alignment, and line breaks every 60 or 70 characters. Most analysis tools either reject those characters or, worse, count them as part of the sequence. Cleaning strips everything that is not a residue so the length, composition and downstream results are right.

How to clean a sequence

  1. Paste the text above. DNA, RNA and protein all work, as does a whole multi-record FASTA file.
  2. Tick what to remove. Spaces, gaps and numbers are on by default; Line breaks joins each sequence onto one line, and Uppercase normalises case.
  3. The cleaned sequence appears as you type, with a count of what was removed. PressCopy to take it, wrapped at 60 characters per line like a standard FASTA file.

Removing GenBank and EMBL numbering

GenBank ORIGIN blocks and EMBL SQ blocks list the sequence in groups of ten bases with a position number on every line, for example1 atggtgagca agggcgagga. With Numbers and Spaces selected the digits and gaps between blocks vanish and only the bases remain. Case is preserved unlessUppercase is on, so lowercase soft-masked regions stay marked.

Removing alignment gaps

Alignment programs insert - or . to line residues up across sequences. To get a single ungapped sequence back, for example to design primers or re-run a search, those characters must go. The Gaps option removes both symbols. Leave it off when you want to clean spacing but keep the alignment columns intact.

How FASTA files are handled

Any line beginning with > is a header and is passed through untouched, so record names, accessions and descriptions survive. Cleaning applies to the sequence lines under each header. With Line breaks on, each record becomes a header line followed by one line of sequence, which some tools require. Blank lines are dropped.

What is not removed

Letters are never touched, including IUPAC ambiguity codes such as N, R or Y, protein one-letter codes, and the stop symbol *. Other punctuation is also left in place so nothing meaningful disappears silently. If a sequence still contains unexpected characters after cleaning, they were letters or symbols the cleaner deliberately keeps.

Frequently asked questions

What does the sequence cleaner remove?

Spaces and tabs, alignment gaps written as - or ., digits such as GenBank position numbers, and optionally line breaks. FASTA header lines starting with > are kept unchanged. Each of these can be switched off.

How do I remove numbers from a DNA sequence copied from GenBank?

Paste the numbered text as it is. GenBank and EMBL records interleave position numbers and blocks of ten bases; the cleaner drops every digit and space and leaves only the sequence letters.

Does it work for protein and RNA sequences?

Yes. The cleaner does not interpret the letters, so DNA, RNA and protein sequences, including IUPAC ambiguity codes, all pass through untouched. Only the chosen characters are removed.

Will it break a multi-record FASTA file?

No. Every line beginning with > is treated as a header and kept as its own line. With "Line breaks" selected, the sequence lines of each record are joined into one line under its header.

How do I remove gaps from an aligned sequence?

Paste the aligned sequence or the whole aligned FASTA. Every - and . is removed and each record is left as its ungapped sequence under its original header. Positions no longer correspond to alignment columns afterwards, so keep the aligned file if you still need the column numbering.