FASTA Sequence Analyzer
Operator: Abdulla Al Fahad. How tools are built and checked
Most routine questions about a sequence file are small ones: how long is each record, how GC-rich, is there a long open reading frame on either strand, does this motif occur, and will this primer melt where I think it will. Each is a few lines of code or a different web form. This page answers them together for a FASTA or multi-FASTA file, with tables and plots you can export.
Key features
- Length, GC percentage and N count for every record, with a CSV of the table
- GC skew (G minus C over G plus C) in a sliding window, plus the cumulative skew, as plots you can save as SVG or PNG
- Reverse complement with IUPAC ambiguity codes, and translation in all six frames
- Nine NCBI genetic codes: standard, vertebrate and yeast mitochondrial, mold and protozoan, invertebrate mitochondrial, ciliate, echinoderm, bacterial and plastid, and alternative yeast nuclear
- ORF finder on both strands, ATG-to-stop or stop-to-stop, with a minimum length, and FASTA of the proteins
- k-mer counts for k from 1 to 8, and motif search by IUPAC code or a restricted pattern, on one or both strands
- Nearest-neighbour melting temperature for oligonucleotides from 8 to 120 bases, with salt, strand concentration and optional magnesium and dNTP
Genetic codes, ORF rules, k-mer counting and the primer Tm model
Input is plain text: records start with a > line, the first word of which becomes the ID and the rest the description. Whitespace, digits and asterisks inside the sequence are dropped. Text with no > line is read as one unnamed sequence. The alphabet is guessed from the first 20,000 residues: mostly A, C, G, T, N is DNA, mostly A, C, G, U, N is RNA, and anything else is protein, for which only length is reported.
Files may be up to 40 MB, 20,000 records and 60 million residues in total. The detailed analyses (skew, translation, ORFs, k-mers, motifs) run on the one record you select, and are switched off for a record longer than 5,000,000 bases so the page stays responsive. Binary files are refused.
The motif box accepts two kinds of pattern. An IUPAC motif such as GAWTC or RGATCY is turned into character classes. The restricted pattern allows letters, a dot, [AG] and [^AG] classes, each followed by at most one {n}, {n,m} (up to 50) or ?. Groups, alternation, * and + are refused, and so are patterns whose repeats multiply to more than 64 ways of matching at one position (".{0,20}" counts 21 and "?" counts 2) or that could match more than 300 bases, so three or more wide gaps in a row, such as ".{0,20}.{0,20}.{0,20}GATTACA", are not accepted. Within those limits a search costs a bounded number of steps per base, and it runs in a background worker that is stopped after 20 seconds.
How it works
ORFs are found by scanning each of the three frames of both strands. In ATG mode an ORF starts at the first ATG after the previous stop and ends at the next stop codon of the selected genetic code, and is kept if its length in amino acids reaches the minimum. In stop-to-stop mode every stretch between two stops is a candidate. Coordinates are reported on the forward strand and include the stop codon. Skew, translation, ORFs, k-mers and motifs each run in a background worker, so a record of several megabases does not freeze the page, and a change in one setting only repeats that one analysis. Strands are written as the words forward and reverse in the tables and the CSV.
When this helps
- A sequencing core returns 18 assembled contigs; the overview shows which are under 500 bases and which have GC outside the genome's expected range.
- A student translates a 2.4 kb mitochondrial fragment with code 2 and finds TGA read as a stop in the standard code but as tryptophan in table 2, and ATA read as isoleucine instead of methionine.
- A technician checks the melting temperatures of a forward and reverse primer pair so that they sit within 2 °C of each other.
- A researcher searches 40 promoter sequences for RGATCY on both strands and exports the hit coordinates.
Opening a file
- Drop a FASTA file, paste sequences, or load the simulated contigs.
- Read the overview table, then choose the record to analyse in detail.
- Set the genetic code and minimum ORF length, a k for k-mers, and a motif if you have one.
- Download the CSV or FASTA for any panel.
Example
The simulated contigs the Load button creates: two contigs and two primers
>contig_1 simulated forward-strand ORF (846 bases)
>contig_2 simulated reverse-strand ORF (1,086 bases)
>M13_fwd_-20 GTAAAACGACGGCCAGT
>T7_promoter TAATACGACTCACTATAGGGOverview, ORFs, k-mers and primer Tm
GC content: contig_1 53.19%, contig_2 45.21%
ORFs of at least 50 amino acids, ATG start, standard code: contig_1 has 121 aa on the forward strand in frame 1 (301..666) and 66 aa on the reverse strand in frame 1 (307..507); contig_2 has 121 aa on the reverse strand in frame 2 (501..866) and 66 aa on the forward strand in frame 3 (660..860)
Top 3-mer in contig_1: CGG, 22 of 844 windows
Primers at 250 nM and 50 mM Na+: M13_fwd_-20 melts at 51.7 °C (dG37 -16.26 kcal/mol), T7_promoter at 46.8 °C (40% GC)Tips for best results
- A longer minimum ORF length removes most chance ORFs: in random sequence about 1 codon in 21 is a stop, so ORFs of 30 codons turn up by chance often and ORFs of 100 codons rarely do.
- Make the sliding window a few percent of the sequence length: wider windows smooth the curve but blur the position where the skew changes sign.
- Compare primers at the same salt and concentration. A Tm without those two numbers is not comparable between tools.
- In stop-to-stop mode, treat the longest frame between stops as a candidate region, not as a gene.
Limits
An ATG-to-stop ORF is not a gene call. Overlapping frames, antisense ORFs and short upstream ATGs all produce ORFs, which is why the simulated example shows 66-amino-acid ORFs beside the planted 121-amino-acid one.
The melting model assumes two perfectly matched strands in two-state melting. Hairpins, mismatches, dangling ends, DMSO and betaine are not included, and above about 60 bases the estimate is only indicative.
k-mer counting skips any window containing N or another ambiguity code, so counts from a sequence with many Ns are lower than the length suggests.
Common errors and how to fix them
- That file looks binary (it has NUL bytes). Choose a plain-text FASTA or GenBank file.
- A gzip or an Excel file was selected. Unzip it, or export the sequences as text.
- More than 20,000 sequences; split the file first.
- Split the multi-FASTA by record count with any text tool, or analyse the records you need.
- "X" is not A, C, G or T. Ambiguity codes cannot be given a melting temperature.
- Replace the ambiguity code with a specific base, or compute the Tm for each of the variants separately.
- Only letters, ".", [AC] classes, [^AC] negated classes, and one {n}, {n,m} or "?" after a letter or class are allowed.
- Rewrite the pattern without groups, alternation, * or +; use [AG] for either base and {2,5} for a repeat count.
- The pattern can match each position in too many ways (more than 64).
- Multiply the range of every repeat: ".{0,20}" counts 21 and "?" counts 2. Keep the product at 64 or less, for example one wide gap and a few optional bases.
Best practices
- Name records with an ID that does not contain spaces; the first word is what appears in the tables and in file names.
- Export the ORF proteins as FASTA and keep the coordinates CSV with them, so a protein can be traced back to the strand and frame it came from.
- Record the genetic code you used next to any translation you report.
Hand-checking the nearest-neighbour terms
The enthalpy and entropy values reproduce the free energy at 37 °C of Table 1 in SantaLucia (1998) for all ten nearest-neighbour stacks to within 0.02 kcal/mol: AA/TT gives -1.015 against the published -1.00, CG/GC -2.164 against -2.17 and GC/CG -2.232 against -2.24. The initiation and symmetry terms come out at 0.97, 1.03 and 0.43 against 0.98, 1.03 and 0.43.
How the melting temperature is computed
Each overlapping pair of bases adds an enthalpy and an entropy from the unified nearest-neighbour parameters of SantaLucia (1998), and initiation terms are added for the two ends, depending on whether each end is G or C or A or T. A self-complementary oligonucleotide gets a symmetry correction of -1.4 cal per mole per kelvin. The entropy is then adjusted for salt with 0.368 times the number of phosphates times the natural log of the sodium concentration.
Tm in kelvin is 1000 times the enthalpy divided by the entropy plus R times the natural log of the strand concentration over 4, with R = 1.987 cal per mole per kelvin, and for a self-complementary strand the 4 becomes 1. The magnesium option converts Mg2+ minus dNTP into a sodium equivalent with the relation of von Ahsen and colleagues (2001), 120 times the square root of the free Mg2+ in millimolar. For the 17-base M13 primer, 250 nM at 50 mM sodium gives 51.7 °C, 100 mM sodium gives 54.9 °C, and 500 nM with 1.5 mM Mg2+ and 0.2 mM dNTP gives 59.1 °C.
Frequently asked questions
Why does the strand column say forward and reverse instead of + and -?
A cell that starts with + is treated by spreadsheet programs as a formula, so a CSV with a plain + in the strand column has to be protected with a leading apostrophe, and Excel then shows "'+". The words forward and reverse need no protection, and the on-screen tables use the same words so the file matches what you saw.
Which genetic code should I use for a mitochondrial sequence?
Vertebrate mitochondrial is table 2, in which AGA and AGG are stops (arginine in the standard code), ATA is methionine (isoleucine in the standard code) and TGA is tryptophan (a stop in the standard code). Yeast, invertebrate and echinoderm mitochondria have their own tables (3, 5 and 9). Pick the table that matches the organism, not the file.
Why does the same ORF appear with a different length in stop-to-stop mode?
Stop-to-stop mode starts the count right after the previous stop, so the region includes everything before the first ATG. ATG mode starts the count at the methionine.
Can it align sequences or build trees?
No. It reads one record at a time for composition, translation, ORFs, k-mers, motifs and primer Tm. Alignment and phylogeny are separate jobs.
What does GC skew show?
A positive skew means more G than C in the window. In many bacteria the skew changes sign at the origin and terminus of replication, so the cumulative skew has a minimum and a maximum near them. Short or low-complexity sequences give noisy skew.
How do I search for a protein motif?
The motif box searches nucleotides only. For protein records the page reports length, and you would need a protein-specific pattern tool for motifs.