Difference between revisions of "Getting a Structure from Multiple Tomograms of HIV Capsids (walkthrough)"

From Dynamo
Jump to navigation Jump to search
Line 80: Line 80:
 
dwrite(tv,'cellOfTables.mat');</nowiki>
 
dwrite(tv,'cellOfTables.mat');</nowiki>
  
2.) Execute the text file named ''commands.m'' in a system shell or in the ''Dynamo''console:
+
2.) Execute the text file named <code>commands.m</code> in a system shell or in the ''Dynamo''console:
 
   
 
   
 
  <tt>dynamo commands.m</tt>
 
  <tt>dynamo commands.m</tt>
Line 98: Line 98:
 
You should get something like:
 
You should get something like:
  
  [[File:result_table_vlp.jpg|thumb|center|400px| Crop points in table.]]
+
  [[File:Result_table_vlp.png|thumb|center|400px| Crop points in table.]]
  
  
 
=== Extract subvolumes ===
 
=== Extract subvolumes ===
 +
 +
Before extracting the subvolumes (cropping particles) using the previously generated table we have to define a so called [[Tomogram-table map file|tomogram table map file]] which links the tomogram ID in the table to an actual tomogram on the disk. Create a file named <code>VLPtomograms.doc</code> and copy the paths and IDs of all tomograms into it:
 +
<nowiki>1 vlp_1.mrc
 +
2 vlp_2.mrc
 +
3 vlp_3.mrc
 +
4 vlp_4.mrc
 +
5 vlp_5.mrc
 +
6 vlp_6.mrc</nowiki>
 +
 +
Define a destination for the cropped particles
 +
<tt>targetFolder = './particlesSize128';</tt>
 +
 +
Now we can crop the particles with sidelength 128 pixels from the tomograms using the table previously defined.
 +
<tt>dtcrop(‘VLPtomograms.doc',tAll,targetFolder,128);</tt>
 +
 +
You can look at the cropped particles with
 +
 +
<tt>dslices(targetFolder,'projy','*','t',finalTable,'align',1,'tag',1:10:588,'labels','on');</tt>
 +
 +
 +
We create a plain average of all cropped particles which will be used later in the alignment project and can help us to asses the quality of the cropped particles. First we read the table of the cropped particles:
 +
 +
<tt>finalTable = dread([targetFolder '/crop.tbl']);</tt>
 +
 +
Then we form the average
 +
<tt>oa = daverage(targetFolder,'t',finalTable,'fc',1);</tt>
 +
 +
We can inspect the average with
 +
<tt>dview(oa.average)</tt>
 +
 +
And save it with
 +
<tt>dwrite(oa.average,[targetFolder '/template.em']);</tt>
 +
 +
 +
=== First alignment project ===
 +
We create our first alignment project through the command line in a similar way as described in detail in the [[Walkthrough_for_lattices_on_vesicles | walkthrough for lattices on vesicles]]. First we define a project name
 +
<tt>pr = 'aliVLP';</tt>
 +
Then we create an [[alignment project | alignment project]] with the particles, template and table that we defined before. The masks are set to default.
 +
 +
<tt>dcp.new(pr,'d',df,'t',[targetFolder '/crop.tbl'],'template',[targetFolder '/template.em'],'masks','default','show',0);</tt>
 +
 +
Next we set up the numerical parameters for the project (type 'dvhelp' in the console for an overview of all parameters):
 +
 +
<nowiki>dvput(pr,'ite_r1',4);
 +
dvput(pr,'dim_r1',32);
 +
dvput(pr,'cr_r1',40);
 +
dvput(pr,'cs_r1',20);
 +
dvput(pr,'ir_r1',360);
 +
dvput(pr,'is_r1',40);
 +
dvput(pr,'rf_r1',4);
 +
dvput(pr,'rff_r1',2);
 +
dvput(pr,'lim_r1',[40,40,40]);
 +
dvput(pr,'limm_r1',1);
 +
dvput(pr,'dst','system_omp','cores',2,'mwa',2);</nowiki>
 +
 +
These can of course also be set up through the alignment project GUI and would correspond to:
 +
 +
[[File:Result_table_vlp.png|thumb|center|400px| Alignment parameters for first alignment project.]]
 +
 +
 +
=== Run project ===
 +
 +
As we would do the  GUI, we have to check, unfold and run the project:
 +
 +
<nowiki>dvcheck pcnt
 +
dvunfold pcnt
 +
dvrun pcnt</nowiki>
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 109: Line 185:
  
  
* Do not crop particles with a sidelength larger than 128px.
 
 
* Before using any C6 symmetries in the alignment projects, make sure to properly center the particles and template.
 
* Before using any C6 symmetries in the alignment projects, make sure to properly center the particles and template.
  

Revision as of 15:39, 3 September 2018

In this walkthrough you will get familiar with managing multiple tomograms through the Dynamo catalogue and developing strategies for alignment projects to reach a reasonable structure from a set of tomograms. You will make use of the knowledge that you acquired during the workshop and apply it to a more realistic case. It is recommended to get familiar with at the advanced starters guide and the walkthrough for lattices on vesicles before starting this walkthrough.

Data

We prepared a set of 6 tomograms, each containing one Immature HIV-1 virus like particle (VLP) with a layer formed by a lattice of capsid proteins. The capsid proteins have a C6 symmetry and have a diameter of roughly 15nm and a molecular weight of about 150kDa. The pixelsize of the tomograms is 2.7 angstrom. You can find the tomograms in:

~/data/tutorial_VLPs

The tomograms are part of the data that was used in the publication An atomic model of HIV-1 capsid-SP1 reveals structures regulating assembly and maturation by Schur FK, Obr M, Hagen WJ, Wan W, Jakobi AJ, Kirkpatrick JM, Sachse C, Kräusslich HG and Briggs JA. (2016). The full dataset can be found on the Electron Microscopy Public Image Archive (EMPIAR) under EMPIAR-10164. The 6 tomograms were extracted from the tilt series TS_03 and TS_43.

Goal

From the data given you should be able to get a final average in which you start seeing hints of alpha helices, i.e., it should be possible to reach a resolution close to roughly 10 angstroms.

Walkthrough

Set up a catalogue

Create a new catalogue

dcm -create catVLP

and open it in the catalogue manager

dcm catVLP

You can add each volume manually to the catalogue under Catalogue -> Browse for new volume or you can make use of a volume file and add all tomograms at once under Catalogue -> Input list of tomograms -> Browse for text file (.vll file). The volume file should be created beforehand by opening a blank text file named for example VLPtomograms.vll and copy the paths of all tomograms into it:

vlp_1.mrc
vlp_2.mrc
vlp_3.mrc
vlp_4.mrc
vlp_5.mrc
vlp_6.mrc

In case you imported the tomograms using a volume file you have to click the button list volumes to refresh the tomogram list in the catalogue manager. Now you should see the 6 tomograms in the catalogue manager. Prebin the tomograms once (1x) under Catalogue -> Create binned versions -> with factor 1. You can now look at single tomograms in tomoslice by selecting a tomogram of choice in the catalogue manager and then go under View volume -> Load full prebinned Volume [if available] -> open in tomoslice. If needed, adjust the lowpass level and contrast to improve the depiction.

Annotate tomograms

To know where we want to later extract the subvolumes we have to first annotate the surfaces of the VLPs inside the tomograms. We do this by opening a tomogram inside tomoslice where a so called dipole Set model is defined. How to do that is described in detail in the section DipoleSet models, Corrections during picking and Corrections after picking of the walkthrough for lattices on vesicles. A new dipole set model has to be made for each tomogram. Save each model before closing tomoslice and when opening a new tomogram in tomoslice select Delete from memory if asked. In case you see markers of the previously defined dipole set inside the newly opened tomogram make sure the model pool is empty and click on reset scene before defining the new dipole set. Once you went through all tomograms click on the button list volumes inside the catalogue manager to refresh the list of tomograms. In the column model files of the tomogram list of the catalogue manager you should now see that you have one defined model per tomogram.

Define crop points

To extract subvolumes (crop particles) we need to first define the crop points on the surface of the VLPs using the previously defined models. The crop points are then stored in a table. This is all done with the following script.

% read dipole from catalogue into workspace
dcmodels catVLP -tc dipoleSet -ws o -gm 1

c=1; % counter for table
for tomo = 1:6 % loop over tomograms
    ds = o.models{tomo};                  % read models
    NDipoles = length(ds.dipoles);
    for i=1:NDipoles                      % loop over models (in our case just one per tomogram)
        v = dmodels.vesicle();            % create empty vesicle model
        v.center = ds.dipoles{i}.center;  % add center from dipole to vesicle model
        v.radius = norm( ds.dipoles{i}.north - ds.dipoles{i}.center); % add radius
        v.separation = 60;                % separation of crop points (in px)
        v.crop_distance_from_surface =0;
        v.updateCrop();                   % update vesicle model

        tv{c} = v.grepTable(); % create crop table from using vesicle model
        tv{c}(:,22) = i;       % add model number to table
        tv{c}(:,20) = tomo;    % add tomogram number to table
        c=c+1;
    end
end


In the standalone version you need to proceed as follows:

1.) Open a text file named commands.m and copy the following into the file (avoid commenting with % or #):

o =dcmodels('catVLP','type','dipoleSet','gm',1);
c=1;
for tomo = 1:6 % loop over tomograms
    ds = o.models{tomo};
    NDipoles = length(ds.dipoles);
    for i=1:NDipoles
        v = dmodels.vesicle();
        v.center = ds.dipoles{i}.center;
        v.radius = norm( ds.dipoles{i}.north - ds.dipoles{i}.center);
        v.separation = 60;
        v.crop_distance_from_surface =0;
        v.updateCrop();
        tv{c} = v.grepTable();
        tv{c}(:,22) = i;
        tv{c}(:,20) = tomo;
        c=c+1;
        disp(sprintf('Dipole %d will provide %d crop points',i,size(v.crop_points,2)));
    end
end
dwrite(tv,'cellOfTables.mat');

2.) Execute the text file named commands.m in a system shell or in the Dynamoconsole:

dynamo commands.m

3.) When you are back in the Dynamoconsole, you can read the results from the script with

tv = dread('cellOfTables.mat'); 

Write table with crop points

Merge all tables into one with the command

tAll = dynamo_table_merge(tv,'linear_tags',1); 

and visualize the table to see the crop points and their orientations

dtplot(tAll,'pf','oriented_positions'); axis equal

You should get something like:

Crop points in table.


Extract subvolumes

Before extracting the subvolumes (cropping particles) using the previously generated table we have to define a so called tomogram table map file which links the tomogram ID in the table to an actual tomogram on the disk. Create a file named VLPtomograms.doc and copy the paths and IDs of all tomograms into it:

1 vlp_1.mrc
2 vlp_2.mrc
3 vlp_3.mrc
4 vlp_4.mrc
5 vlp_5.mrc
6 vlp_6.mrc

Define a destination for the cropped particles

targetFolder = './particlesSize128';

Now we can crop the particles with sidelength 128 pixels from the tomograms using the table previously defined.

dtcrop(‘VLPtomograms.doc',tAll,targetFolder,128);

You can look at the cropped particles with

dslices(targetFolder,'projy','*','t',finalTable,'align',1,'tag',1:10:588,'labels','on');


We create a plain average of all cropped particles which will be used later in the alignment project and can help us to asses the quality of the cropped particles. First we read the table of the cropped particles:

finalTable = dread([targetFolder '/crop.tbl']);

Then we form the average

oa = daverage(targetFolder,'t',finalTable,'fc',1);

We can inspect the average with

dview(oa.average)

And save it with

dwrite(oa.average,[targetFolder '/template.em']);


First alignment project

We create our first alignment project through the command line in a similar way as described in detail in the walkthrough for lattices on vesicles. First we define a project name

pr = 'aliVLP';

Then we create an alignment project with the particles, template and table that we defined before. The masks are set to default.

dcp.new(pr,'d',df,'t',[targetFolder '/crop.tbl'],'template',[targetFolder '/template.em'],'masks','default','show',0);

Next we set up the numerical parameters for the project (type 'dvhelp' in the console for an overview of all parameters):

dvput(pr,'ite_r1',4);
dvput(pr,'dim_r1',32);
dvput(pr,'cr_r1',40);
dvput(pr,'cs_r1',20);
dvput(pr,'ir_r1',360);
dvput(pr,'is_r1',40);
dvput(pr,'rf_r1',4);
dvput(pr,'rff_r1',2);
dvput(pr,'lim_r1',[40,40,40]);
dvput(pr,'limm_r1',1);
dvput(pr,'dst','system_omp','cores',2,'mwa',2);

These can of course also be set up through the alignment project GUI and would correspond to:

Alignment parameters for first alignment project.


Run project

As we would do the GUI, we have to check, unfold and run the project:

dvcheck pcnt
dvunfold pcnt
dvrun pcnt









  • Before using any C6 symmetries in the alignment projects, make sure to properly center the particles and template.
  • Without any postprocessing or elaborate refinement your final average may look similar to the one shown below:
Possible outcome of the exercise.