Random DNA regions

Build a sequence from regions with the composition you set, one region per line.

Regions

FASTA

Options

What does this generator do?

It builds one sequence out of several regions, each with a composition you choose, and writes it as FASTA. A GC-rich island inside an AT-rich background, an isochore boundary, a hydrophobic stretch between two polar ones: anything that can be written as a list of blocks. Real sequences are not uniform, so test data that is uniform hides exactly the behaviour most tools are judged on, which is what they do at a boundary.

Write one region per line, longest first or in whatever order they should appear:

400 35 AT-rich background
300 70 GC island
400 35 AT-rich background

The first number is the length. For DNA the second number is that region's GC content in percent; for protein the second word is a residue group. The rest of the line is a name, used only in the table under Details.

How the composition is hit exactly

Each region is built from counts, not from coin flips, and then shuffled:

G + C = round(L × GC% ÷ 100), split evenly between G and C
A + T = L − (G + C), split evenly between A and T
the region is then shuffled into random order

So a 400 base region at 35% GC always contains 140 G or C, never 132 or 147. Drawing each base independently, the way a plain random sequence generator does, would scatter the result around the target by a few percent, which is enough to blur a short island.

Worked example

"Try an example" loads the three lines above: 400 bases at 35% GC, 300 at 70%, then 400 at 35% again. The result is one record of 1,100 nt, made of exactly A 305, C 245, G 245 and T 305, so the whole sequence is 44.5% GC while the island in the middle, positions401–700, is 70.0% GC. Every region's span and target sit in the table under Details. Press New sequence and the letters change but those counts do not.

Reproducibility

The generator is seeded, so the sequence is a function of the regions and the seed alone. The same seed gives the same sequence, today and next month, and editing How many or switching tabs does not silently redraw what you already copied. Note the seed next to the result if the sequence needs to be rebuilt later, or press New sequence for a fresh draw.

For a single uniform sequence use the random DNA generator. To destroy composition structure in a real sequence instead of inventing it, useshuffle DNA, and to check the composition of what came out, thesequence statistics tool or theGC content plot.

Frequently asked questions

How do I write the regions?

One region per line, length first. For DNA the second number is the GC content of that region, so "400 35" means 400 bases at 35% GC. For protein the second word is a residue group, so "25 hydrophobic" means 25 residues drawn from A, V, I, L, M, F, W and P. Anything after that is the region name and is only used in the table. A line with just a length gives 50% GC, or any of the 20 amino acids.

Does the GC content come out exactly as I asked?

Yes, to the nearest base. The region is built from the exact counts first, round(L × GC ÷ 100) bases of G or C and the rest A or T, and only then shuffled into a random order. A generator that flips a weighted coin per base would land near the target instead of on it, which matters for the short regions people usually want.

Will the same seed always give the same sequence?

Yes. The seed drives a small deterministic generator, so the same regions and the same seed give the same sequence in any browser, and changing an unrelated setting does not redraw it. Press New sequence for a different draw, or type a seed of your own to come back to a sequence later.

What are the protein residue groups?

random (all 20), hydrophobic (AVILMFWP), polar (STNQYC), positive (KRH), negative (DE), aromatic (FWY) and small (AGST). Basic and acidic are accepted as names for positive and negative. Residues inside a group are drawn with equal probability.

What is this useful for?

Test data with a known answer: an isochore or a CpG island inside a background of another composition, a GC-rich block to see where a primer picker or a window plot puts its boundary, or a hydrophobic stretch to check that a transmembrane predictor finds it. Because the layout is written down and the seed is fixed, the same test case can be rebuilt exactly.