Window extractor
Cuts a sequence into fixed-length windows at the step you choose, each named by its coordinates.
Cuts a sequence into fixed-length windows at the step you choose, each named by its coordinates.
A sliding window walks along a sequence in fixed-length pieces. The first window starts at position 1, the next one starts a step further along, and so on to the end. When the step is smaller than the window, neighbouring windows overlap, which is how GC content, coverage, conservation and codon bias are plotted along a chromosome, and how overlapping peptide libraries are designed. This page writes the windows themselves as FASTA records, ready for BLAST, an aligner, a prediction server or a synthesis order.
Every window is named by the coordinates it came from, counted from 1 with both ends included: >contig_7_51-150 is the record contig_7, positions 51 to 150, 100 residues. A file with several records is windowed record by record.
One more window follows when the last full window does not reach the end of the sequence. That final window is shorter than the rest, and "Last window" decides whether it is kept, which is the default, or dropped. Dropping it leaves the residues after the last full window out of the output, and the tool says how many they are.
"Try an example" on the DNA tab loads a 280 nt assembly fragment. With the default size 100 and step 50 the result is 5 windows, 480 nt in all: 1-100, 51-150, 101-200, 151-250 and 201-280. The first four are 100 nt, the last is80 nt because the sequence ends there. Set "Last window" to "Drop it" and 4 windows of 100 nt remain, 400 nt, with the last 30 nt of the sequence left out.
On the Protein tab the example is the 110 aa human insulin precursor with size15 and step 5. That gives 20 peptides of 15 aa, from 1-15 to 96-110, each overlapping its neighbour by 10 residues, and none of them partial because 110 = 15 + 19 × 5.
| Purpose | Size | Step |
|---|---|---|
| GC or coverage profile | 100–1000 nt | half the size |
| Tiling for synthesis or capture | 120–200 nt | size, or size − overlap |
| Overlapping peptide library | 15 aa | 5 aa |
| MHC class I 9-mers | 9 aa | 1 aa |
| Non-overlapping chunks | any | equal to the size |
A step equal to the size gives chunks that cover the sequence exactly once. A step larger than the size skips the residues between neighbouring windows, which is sampling rather than scanning.
Use this page when the pieces are regular: one size, one step, right across the sequence. When you know which positions you want, for example 1-100 and 250-300, therange extractor cuts exactly those and can also trim a fixed number of residues off each end. To plot GC along a sequence instead of writing the windows out, use the GC content calculator, and to translate the windows you extract here, the translation tool.
Size is how long each window is, step is how far the next window starts after the previous one. A step smaller than the size makes the windows overlap, which is what a sliding window means: size 100 with step 50 gives windows that share half their length. A step equal to the size gives tiles that touch but do not overlap, and a step larger than the size leaves gaps between them.
Yes. The first residue is position 1 and both ends belong to the window, so 1-100 is the first 100 residues and 51-150 is the next 100. These are the coordinates GenBank, EMBL, GFF and most papers use. BED files and Python slices count from 0 and leave the end out, so the window written 1-100 here is 0-100 in a BED file.
A sequence rarely divides evenly, so the final window is usually shorter than the others. It is kept by default and its header gives its real coordinates, so nothing is lost. Set "Last window" to "Drop it" when every record has to be exactly the same length, for example as input to a model or a microarray design; the residues after the last full window are then left out and the tool says how many.
Yes. Switch to Protein and use a size of 15 with a step of 5 for peptides that overlap by 10 residues, the usual layout for an overlapping peptide library or an epitope scan. Size 9 with step 1 gives every possible 9-mer for MHC class I binding prediction.
Up to 20,000. A small step over a long sequence reaches that quickly: step 1 on a 100 kb sequence would be 100,000 windows. Raise the step, or split the sequence first. Files are read in your browser and nothing is uploaded.