Tutorial::Mutating Residues

From MSL-Libraries
Jump to navigationJump to search

This is an example on how to make mutations and add conformations (rotamers) in MSL. There are multiple ways to do this in MSL, here we describe the simplest way (only needing a rotamer library). This tutorial explains functions in the PDBTopology and others.

Complete source of example_mutation_rotamers.cpp

Error creating thumbnail: File missing
Mutation and rotamers built by this example

To compile

% make bin/example_mutation_rotamers

To run the program

Go to the main directory and run the command (note, the location of the exampleFiles subdirectory needs to be provided as an argument)

% bin/example_mutation_rotamers exampleFiles library/rotlib/balanced/rotlib-balanced-200.txt

Program description

	// Read pdb file into a System object
	System sys;

	// Get one of the residues : chain B position 1
	Residue &res = sys.getIdentity("B,1");

	// Create a PDBTopology object
	PDBTopology pdbTop;

	// Set a rotamer library and use atoms defined in the rotamer library to build

	// Get backbone atoms  
	AtomPointerVector backboneAtoms = pdbTop.getBackboneAtoms(res);
	// *********  MUTATE *************** //
	//    B,1,ASP to B,1,ASN and get 3 ASN rotamers
	AtomContainer newAtoms = pdbTop.getResidue("B,1,ASN",backboneAtoms,3);

	// Add atoms to the system

	// Write out new pdb with an Asn at position 1, chain B.  instead of Asp.
	cout << "Wrote file /tmp/example00005_withAsn.pdb , has Asn instead of Asp\n";

	// Change conformation , First conformation is 2.  Write out conformation 0 and 1.
	cout << "Wrote file /tmp/example00005_withAsn_rotamer0.pdb , has Asn (alternate rotamer) instead of Asp\n";

	cout << "Wrote file /tmp/example00005_withAsn_rotamer1.pdb , has Asn (alternate rotamer) instead of Asp\n";

Back to the tutorial page