How to Use SWISS-MODEL for Homology Modeling: A Step-by-Step Tutorial

By Dr. Zubair Khalid, DVM, MS, PhD ·

How to Use SWISS-MODEL for Homology Modeling: A Step-by-Step Tutorial

By the end of this SWISS-MODEL tutorial you will be able to take a plain amino acid sequence, find a suitable structural template, build a full-atom three-dimensional model on the SWISS-MODEL web server, judge the quality of that model with the GMQE and QMEAN scores, and download it for inspection in PyMOL or for use in docking and comparative analysis.

You need very little to follow along. A modern web browser is enough for everything that runs on the server. For the local validation steps you will want PyMOL (free from Schrödinger for most academic users, or the open-source build), Python 3 with Biopython installed, and a terminal. The entire worked example below runs against human hemoglobin subunit alpha, a deliberately easy target, so you can confirm that your setup produces sensible numbers before you point the same workflow at a harder protein.

What Homology Modeling Actually Does

Homology modeling predicts the three-dimensional structure of a protein (the target) by copying structural information from one or more experimentally solved structures of evolutionarily related proteins (the templates). The logic rests on a well-established observation from structural biology: protein folds change far more slowly than sequences, so two proteins with clearly similar sequences almost always share the same fold, even when their sequences have diverged to the point where only careful alignment software can detect the relationship.

Four terms appear throughout this SWISS-MODEL tutorial, and each has a precise meaning:

  1. Target. Your sequence of interest, the protein whose structure you want.
  2. Template. A PDB structure used as the scaffold. PDB is the Protein Data Bank, the public archive of experimentally determined structures.
  3. Target-template alignment. The residue-by-residue correspondence between your sequence and the template sequence. Every residue you align is built on the coordinates of its template partner. Every residue you leave unaligned (an insertion) must be modeled de novo, which is where most model errors concentrate.
  4. Model. The finished coordinate file, typically in PDB format, containing atoms for your target built on the template scaffold.

SWISS-MODEL, hosted by the Swiss Institute of Bioinformatics on the ExPASy platform at swissmodel.expasy.org, automates this pipeline with its ProMod3 engine. It searches the SWISS-MODEL Template Library (structures derived from the PDB), builds a target-template alignment, constructs the model, and estimates its quality. The whole service is free, and a registered account lets you save projects and return to them later.

SWISS-MODEL or AlphaFold? Choosing the Right Tool

You should know when homology modeling is the right choice, because the field changed fundamentally in 2020. At CASP14, the Critical Assessment of Structure Prediction, DeepMind's AlphaFold2 achieved a median Global Distance Test (GDT) score of 92.4 across 87 of 92 evaluation domains, a performance level that John Moult described as solving the protein structure prediction problem for single protein chains [1]. The AlphaFold Protein Structure Database at EMBL-EBI now hosts approximately 214 million predicted structures covering near-complete proteomes of many organisms [1]. If your target already has a high-confidence entry in that database, you often do not need to build a model at all. The short AlphaFold tutorial near the end of this article shows how to check.

SWISS-MODEL still earns its place in a structural workflow for specific situations:

  • You want a chosen experimental template. Homology modeling lets you pick the exact PDB entry, which matters when you need a particular conformational state, a ligand-bound structure, or a specific organism's sequence as the scaffold.
  • You need the quaternary structure. SWISS-MODEL copies the oligomeric assembly of the template, so a homo-dimeric or tetrameric template produces an oligomeric model. AlphaFold Database entries are usually single chains unless the entry explicitly covers a complex.
  • You want template-derived ligands and pockets. Conserved binding-site ligands from the template can be carried into the model, which is useful when preparing structures for docking.
  • You want a transparent, template-anchored result. Every atom in a SWISS-MODEL model traces back to a real experimental structure, which simplifies review and publication.

Conversely, AlphaFold-type methods win when no good template exists, when the protein is large and multi-domain, or when you want an ensemble-free whole-chain prediction quickly. The two approaches also fail differently. A recent evaluation found that AlphaFold2, ESMFold, and AlphaFold3 all assign unexpectedly high pLDDT confidence scores to short spurious protein sequences, meaning a high confidence number alone cannot tell you whether a short predicted structure is real biology or a gene-prediction artifact [2]. Template-based modeling is less exposed to that particular failure mode because it refuses to build when no credible template exists.

A practical rule: check the AlphaFold Database first for your accession. If a well-covered, high-confidence model exists, use it. If you need a specific template, a ligand, an oligomer, or your protein has no database entry, run SWISS-MODEL. Many experienced analysts do both and cross-check.

SWISS-MODEL Tutorial Step by Step: Building a Hemoglobin Alpha Chain Model

The worked example throughout this section is human hemoglobin subunit alpha (UniProt accession P69905, 142 residues including the initiator methionine, 141 residues in the mature protein). Hemoglobin is a small, well-characterized, overwhelmingly conserved protein, so this swiss-model tutorial step by step walkthrough produces a near-perfect model. Treat it as a calibration exercise. Your real targets will usually show lower identity to their best templates and more modeling decisions.

Step 1: Prepare and Check Your Target Sequence

Get the sequence in FASTA format. If the protein is in UniProt, download it directly from the command line:

curl -s "https://rest.uniprot.org/uniprotkb/P69905.fasta" -o hba.fasta
head -c 120 hba.fasta

Expected output:

>sp|P69905|HBA_HUMAN Hemoglobin subunit alpha
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHF...

Before submitting anything to a modeling server, verify that the file contains a clean amino acid sequence with no stop codons, no stray digits, and no nucleotide letters. A one-line Python check does the job:

seq = open("hba.fasta").read().split("\n", 1)[1].replace("\n", "")
print(len(seq), sorted(set(seq)))

Expected output for this file:

142 ['A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y']

Two decisions matter here and beginners routinely skip them:

  • Trim what should not be modeled. Signal peptides, pro-peptides, low-complexity tails, and transmembrane regions are frequently absent from soluble domains in PDB structures. UniProt feature annotations tell you where these are. Submitting only the folded domain usually yields a better template and a cleaner alignment.
  • Confirm the sequence is what you think it is. Frameshifted or mistranslated sequences from draft annotations produce bizarre models. If the sequence came from your own assembly rather than a curated database, run it through UniProt BLAST or NCBI BLASTP first and confirm the top hits are the protein you intended.

Step 2: Create an Account and Start a Modeling Project

Go to swissmodel.expasy.org and register a free account. Registration is required to save projects, re-run jobs, and access your modeling history, so do this first rather than losing results in an anonymous session.

From the Start a New Modeling Project page, give the project a descriptive name (for example, HBA_human_v1). Descriptive names matter more than people expect. By model version four you will want to remember which run used which template.

Step 3: Run Automated Mode

Automated Mode is the default entry point. Paste your FASTA sequence into the target field, or enter the UniProt accession P69905 directly, and click Build Model. The server then searches the SWISS-MODEL Template Library, selects templates, builds alignments, constructs up to ten candidate models, and ranks them.

A typical small single-domain job finishes in a few minutes. During queue periods it can take longer, and the project page shows the job status rather than leaving you guessing.

Expected output: a table of models, each row showing the template PDB identifier and chain, the target-template sequence identity as a percentage, the aligned coverage of your target, and a GMQE score. For a hemoglobin alpha chain you will see human hemoglobin structures with identity well above 90 percent and coverage near 100 percent. On a genuinely novel protein you may see identity in the 20 to 40 percent range, which is the regime where every downstream judgment in this tutorial starts to matter.

Step 4: Read the Model Summary Correctly

Click the top-ranked model. The summary page reports the scores you will use for every quality judgment in this workflow. Know exactly what each one measures.

  • GMQE (Global Model Quality Estimation). A number between 0 and 1 that combines properties of the target-template alignment with the expected accuracy of the template itself. Higher is better. GMQE drops when identity is low, coverage is partial, or the alignment contains many insertions. It is an expectation formed before and during model building, not a direct measurement of the finished structure.
  • QMEANDisCo global score. A composite estimate based on structural features of the finished model and the agreement between predicted and observed inter-residue distances. As a rule of thumb from the SWISS-MODEL documentation, global QMEAN scores below about -4.0 indicate low model quality, while values closer to 0 indicate better models.
  • QMEANDisCo per-residue plot. The most useful panel on the page. It shows which regions of your model are trustworthy and which are not, rendered as a line chart along the sequence and mirrored in the 3D viewer as blue (high confidence), orange (low), and red (very low) coloring.
  • Oligomer state. The server reports the biological assembly it inherited from the template. Hemoglobin templates are tetrameric, so your alpha chain model will appear in its dimeric or tetrameric context. Always compare this predicted state against what you know about the protein's biology.

Write these numbers down per model. When you compare candidate models later, you will want the GMQE and QMEAN values side by side rather than reconstructing them from memory.

Step 5: Inspect the Model in 3D

Use the built-in 3D viewer first. Rotate the model, toggle the per-residue confidence coloring, and check that secondary structure elements look continuous. Then download the model as a PDB file and open it locally for a proper look:

# after downloading model_01.pdb from the results page
pymol model_01.pdb

In PyMOL:

load model_01.pdb, model
fetch 1HHO, template
align model and name CA, template and name CA
show cartoon
color marine, model
color salmon, template
select heme, resn HEM
show sticks, heme

Here 1HHO is the oxygenated human hemoglobin structure from the PDB, fetched directly by PyMOL. The align command superposes the model on the template and prints the number of aligned atom pairs and the root-mean-square deviation (RMSD) in the log. For a model built on a template with more than 90 percent identity, an all-atom RMSD well under 1.0 Å after outlier elimination is the expected result. On the heme selection you can verify that the conserved proximal histidine (His87 in the mature alpha chain, the residue that coordinates the heme iron) sits in a geometrically sensible position next to the ligand inherited from the template.

Checks worth running on any model, not just this one:

  • Superpose on the template and confirm the structured core aligns tightly.
  • Confirm catalytic or binding-site residues adopt positions consistent with the template.
  • Look at every long insertion in your alignment. These loops are modeled without template guidance and are the least reliable parts of the structure.
  • Compare against the AlphaFold Database entry for the same protein as an independent second opinion.

Step 6: Improve the Model with Alignment Mode

Three ordered rules for manual alignment edits in Alignment Mode: keep secondary structure, respect conserved motifs, and place insertions in loops.

Automated Mode is convenient but takes the alignment choices out of your hands. Alignment Mode returns that control. From the project page, switch to Alignment Mode, search the template library or enter a specific PDB identifier, and select your template. You can then edit the target-template alignment directly: shift residues, open or close gaps, and rebuild.

This is where homology modeling becomes a craft. Three principles guide good manual alignment edits:

  1. Never break secondary structure. If the template residue is in the middle of a helix or strand, do not place a gap opposite it. Shift the gap to the adjacent loop.
  2. Respect conserved motifs. Catalytic residues, cysteines that form disulfide bonds, glycines in tight turns, and prolines should align with their counterparts. If your target's motif is offset by one or two residues from the template's, that offset is more often an alignment error than real biology.
  3. Keep insertions in loops. An insertion of five residues goes where the template has a loop, not where the template has a helix core.

After editing, rebuild the model. The per-residue QMEANDisCo plot should show improvement in the regions you fixed, and that is the concrete evidence your edit helped rather than just felt right.

Step 7: Build a Custom Model with Your Own Template

Custom Mode handles the cases the template library cannot. Use it when your template is a PDB entry the server ranked low, a homolog from another organism you want to force as the scaffold, or your own refined structure. The inputs are a template structure file (PDB or mmCIF), a designation of which chain is the modeling scaffold, and an explicit target-template alignment in FASTA or Clustal format.

A minimal alignment file for a single-domain case looks like this:

>target
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKKVADALTNAVAHVDD
>1HHO_A
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKKVADALTNAVAHVDD

The two blocks must contain the same number of residues, with gaps shown as hyphens where residues are unaligned. The server validates the alignment against both sequences, so a miscounted block produces an immediate rejection rather than a silent bad model.

Step 8: Download, Validate, and Version Your Model

Download the final coordinates in PDB format. Beyond the visual checks in Step 5, run a geometry validation pass. The MolProbity web service reports Ramachandran outlier percentages and steric clashes for any uploaded coordinate file, and those two numbers are the standard quick health screen for a model. A homology model built on a high-identity template should show very few Ramachandran outliers because it inherited mostly regular geometry from an experimentally refined structure. A spike in outliers or clashes usually traces back to an alignment error or a forced insertion in a structured region, and the fix is a return to Step 6.

Keep a simple versioning discipline: one directory per target, one subdirectory per model version, and a short text file in each recording the template PDB identifier, the GMQE and QMEAN values, and what you changed. Six months later, when a reviewer asks which template produced the structure in your figure, that file answers the question.

Key Parameters at a Glance

A comparison of high, moderate and low target-template identity showing what backbone accuracy and claims each level supports.

ItemWhere you see itHow to read it
Automated, Alignment, Custom modesProject start pageAutomated for a first look, Alignment for template choice and manual alignment edits, Custom for your own PDB template
Target-template identityTemplate list and model summaryPercentage of aligned residues identical. Above roughly 50 percent usually gives an accurate backbone, 30 to 50 percent approximately correct, below 30 percent treat with caution
CoverageTemplate listFraction of your target spanned by the alignment. High identity with low coverage means a partial model
GMQEModel summary0 to 1, higher is better. An expectation based on the alignment and template
QMEANDisCo global scoreModel summaryComposite score of the finished model. Values below about -4.0 indicate low quality
QMEANDisCo per-residuePlot and 3D coloringBlue trustworthy, orange weak, red unreliable. The map of where your model can be believed
Oligomer stateModel cardAssembly inherited from the template. Check it against known biology
Ligands and pocketsModel viewCopied from the template only where the binding site is conserved

SWISS-MODEL Tutorial Tips From Daily Practice

Model by domain, not by gene. Large multidomain proteins rarely have a single template covering every domain with good coverage. Split the sequence at domain boundaries identified from UniProt annotations, Pfam, or the AlphaFold Database entry itself, and model each domain separately. This single habit fixes more bad SWISS-MODEL results than any other.

Sort templates by coverage, not by identity alone. A 60 percent identity template covering 40 percent of your target builds less than a 45 percent identity template covering 95 percent. The interactive template selection view in SWISS-MODEL shows both numbers, and the alignment preview shows where the aligned region falls relative to your catalytic residues.

Let the per-residue plot drive your writing. When you report the model, quote the global QMEAN score and describe which regions carry low per-residue confidence. A model with a strong core and a weak 15-residue loop is a perfectly usable result if you describe it that way, and a misleading one if you do not.

Cross-check with the AlphaFold Database. Download the AlphaFold entry for your accession and superpose it on your SWISS-MODEL model. Agreement between a template-based and a template-free method on the same core is one of the strongest informal quality signals available. Disagreement localized to one region tells you exactly where to look harder.

Write down why you chose the template. One sentence in your lab notebook per model. Homology modeling is reproducible only if the choices you made are recorded.

Common Mistakes and Limitations

Submitting a raw multi-domain sequence and expecting one template to cover it. Domains connected by long linkers, and artificial fusion proteins especially, are genuinely hard cases. A study of artificial fusion proteins built from two unrelated domains found that predicting the relative spatial arrangement of the domains is not straightforward and must be handled with care even with modern deep-learning methods such as AlphaFold2, because the degree of freedom between domains exceeds what current tools reliably capture [3]. The same caveat applies in reverse to template-based modeling, where each domain pulls toward its own template. Split the protein, model the domains, and be explicit that the inter-domain orientation is a hypothesis.

Trusting high confidence numbers on short sequences. The pLDDT score in AlphaFold outputs and the quality scores in homology modeling both measure internal consistency, not biological reality. Evaluations of AlphaFold2, ESMFold, and AlphaFold3 showed that all three assign high pLDDT scores to short spurious protein sequences produced by gene-prediction errors, and discrimination only improves beyond roughly 100 amino acids [2]. If your target is short and of uncertain annotation, a beautiful model with excellent scores may be modeling nothing.

Feeding the model straight into docking or virtual screening without preparation. Predicted structures carry no experimental validation of side-chain conformations, protonation states, or bound waters, and protein-drug complex structures remain scarce even in an era of abundant predicted structures [4]. Before docking, relax or minimize the model, add hydrogens, assign protonation at physiological pH, and check that the binding pocket you intend to target is genuinely conserved relative to the template.

Ignoring the oligomer state. SWISS-MODEL inherits the assembly of the template. If the template crystallized as a monomer artifact but your protein functions as a dimer, your model's interfaces will be wrong. Conversely, crystal-packing contacts sometimes masquerade as biological assemblies in the PDB. Compare the predicted state against databases of known quaternary structures and your own biological knowledge.

Treating the alignment as untouchable. The alignment is the single highest-leverage input in the entire pipeline. Every residue pairing in it determines which template atom your residue is built on. If the model looks wrong, the alignment is the first place to look, before any other parameter.

Expecting ligands to transfer automatically. SWISS-MODEL copies template ligands into pockets it judges conserved. If the pocket changed between template and target, the copied ligand sits in a pocket that may no longer bind it. Inspect every transferred ligand residue by residue.

Interpreting the model as a measurement. A homology model is a hypothesis grounded in an experimentally solved relative. Backbone positions in the conserved core are usually reliable at moderate to high identity. Side-chain conformations, loop geometries, surface charges, and inter-domain orientations are progressively less so. Report it with its scores and its caveats, and individual experimental questions about a specific protein need experimental or specialized computational follow-up rather than a default model.

Common server and tool errors, and what they actually mean:

What you seeUsual causeFix
No models returned in Automated ModeSequence too divergent from any library template, or the sequence is not a folded globular proteinSearch templates manually in Alignment Mode, try homologs from other species as custom templates, or check whether the protein is intrinsically disordered
Submission rejected for invalid charactersStray digits, asterisks from stop codons, or whitespace inside the sequenceStrip non-amino-acid characters with the Python check from Step 1 and resubmit
Model covers only part of your sequenceBest template does not span the full target, or you left a signal peptide attachedTrim to the folded domain, or accept and report a partial model
Model looks broken or fragmentedAlignment gaps placed inside helices or strandsReopen Alignment Mode and shift gaps into loops, then rebuild
Oligomer looks biologically wrongTemplate assembly does not match the protein's functional stateForce a different template in Alignment or Custom Mode
PyMOL reports a selector error on resn HEMThe ligand was not transferred into your modelConfirm in the SWISS-MODEL viewer whether the pocket was modeled at all before scripting around it

Using Your Model After You Build It

A model is a starting point, and the productive directions depend on your question.

Structure-based drug discovery. With a validated pocket, you can run virtual screening. The fragment-based perspective offers a practical route when direct complex structures are unavailable: fragmenting over 100,000 PDB compounds characterized the binding modes of 153,000 fragments against their crystallized targets, and that fragment data allowed reconstruction of binding modes for over 7,800 complexes between ChEMBL compounds and their known targets [4]. The transferable lesson for a model-based project is that small, well-validated local binding motifs are more robust to model error than whole-compound poses, so anchor your screening hypotheses on fragment-level interactions rather than on the full geometry of a predicted pocket.

Function inference from fold. A model can suggest function through its fold even when the sequence is unannotated. Fold-based comparison of the beta-trefoil fold, a shape tolerant of extensive sequence divergence, identified proteins belonging to thirty-two distinct functional classes across the PDB and AlphaFold databases on the basis of domain architecture and structural similarity [5]. If your model reveals a recognizable fold with a plausible active-site geometry, that observation justifies targeted experiments, though fold similarity alone never establishes function.

Protein engineering and chimeras. If you are designing a fusion of two domains, model each domain separately and treat the linker length and the relative domain orientation as design variables to test experimentally, consistent with the findings on fusion-protein structure prediction discussed above [3].

Mutation interpretation. Map residues of interest onto the model and inspect their packing and any copied template ligands. A model with good per-residue scores in the mutated region supports a structural hypothesis, one with low local confidence does not.

A Short AlphaFold Tutorial for the Same Target

For many proteins, the fastest path to a structure is not building one at all. The AlphaFold Protein Structure Database, hosted by EMBL-EBI at alphafold.ebi.ac.uk, provides predicted structures for close to complete proteomes, roughly 214 million entries [1]. Here is the three-minute check every SWISS-MODEL project should start with.

  1. Search the database by UniProt accession, for example P69905. If an entry exists, open it and switch to the confidence view.
  2. Read the per-residue pLDDT track. pLDDT is AlphaFold's per-residue confidence score, running from 0 to 100. As a widely used convention, values above 90 indicate very high accuracy, 70 to 90 confident backbone, 50 to 70 low confidence, and below 50 strongly disordered. Remember the caveat from the spurious-sequence analysis: for short sequences, high pLDDT alone is weak evidence of a real folded protein [2].
  3. Check the Predicted Aligned Error (PAE) plot for domain relationships. Low PAE within a block and high PAE between blocks means the domains are individually confident but their relative orientation is not.
  4. Download the entry and inspect it locally. The pLDDT values are stored in the B-factor column, so recent PyMOL versions can fetch and color them directly:
fetch AF-P69905-F1
show cartoon
spectrum b, blue_white_red

If this check returns a well-covered, high-confidence model, you may need no modeling run at all. If it returns low confidence over the region you care about, or your protein has no entry, proceed with the SWISS-MODEL workflow above.

For targets beyond the database, such as multi-chain complexes or newly designed proteins, Google DeepMind operates the AlphaFold Server (alphafoldserver.com), a free web service for AlphaFold 3 predictions of complexes including proteins, nucleic acids, and small molecules, subject to its terms of use. A full walkthrough of that tool is its own topic, but for complex prediction it is currently the standard first stop.

Frequently Asked Questions

Is SWISS-MODEL free to use?

Yes, SWISS-MODEL is free on the web at swissmodel.expasy.org. You need to create a free account to save projects, access your history, and use some interactive features, but building and downloading models costs nothing.

Can SWISS-MODEL model a protein with no known template?

No. Homology modeling requires a template, so a protein with no detectable structural relative cannot be modeled this way. For those targets, use a template-free deep-learning method such as AlphaFold, or check whether an entry already exists in the AlphaFold Database.

What GMQE score means my model is good enough?

GMQE runs from 0 to 1 and higher is better, but there is no universal passing grade. Read GMQE together with the global QMEAN score and the per-residue confidence plot, and judge against your intended use. A docking study tolerates different errors than a mechanistic argument about a catalytic residue.

How long does a SWISS-MODEL job take?

A typical single-domain model finishes within minutes. Large or complex submissions and busy queue periods can take longer, and the project page reports job status while you wait.

Should I use SWISS-MODEL or the AlphaFold server?

Check the AlphaFold Database first, and use SWISS-MODEL when you need a specific template, template-derived ligands, a particular oligomeric assembly, or a transparent template-anchored model. Use the AlphaFold server when you need to predict a complex or a protein the databases do not yet cover. Many analysts run both and compare.

Can SWISS-MODEL handle multi-chain proteins and fusion proteins?

It can model oligomeric assemblies inherited from templates, but the relative orientation of fused or loosely linked domains remains a genuinely hard prediction problem even for modern deep-learning methods, so split fusion proteins by domain and treat inter-domain geometry as a hypothesis to be tested.

How do I cite SWISS-MODEL in a paper?

Cite the SWISS-MODEL server publications listed on the site's Help and documentation pages, which the interface displays alongside your results. Include the server URL, the template PDB identifiers you used, and the GMQE and QMEAN scores of the final model.

Can I use an AlphaFold Database model instead of building one?

Yes, for most well-annotated proteins in model organisms and humans a database entry already exists and may be your best starting structure. Check the per-residue pLDDT and the PAE plot, and remember that a model in the database is a prediction, not an experimental structure.

Sources

  1. From CASP13 to the Nobel Prize: DeepMind's AlphaFold Journey in Revolutionizing Protein Structure Prediction and Beyond.
  2. Folding the unfoldable 2: using AlphaFold and ESMFold to explore spurious proteins.
  3. Fusion of two unrelated protein domains in a chimera protein and its 3D prediction: Justification of the x-ray reference structures as a prediction benchmark.
  4. Decomposing compounds enables reconstruction of interaction fingerprints for structure-based drug screening.
  5. Tracing the function expansion for a primordial protein fold in the era of fold-based function prediction: β-trefoil.