Difference between revisions of "Walkthrough on command line based tilt series alignment"
Line 10: | Line 10: | ||
= Entering the data = | = Entering the data = | ||
− | The <tt>u</tt> object contains several areas to interact with the workflow. They can be found by autocompletion using the <tt>tab</tt> key. | + | The <tt>u</tt> object contains several areas to interact with the workflow. They can be found by autocompletion using the <tt>tab</tt> key. Here, we will proceed step by step; remember that you can write all the command lines in a single <tt>.m</tt> script. |
== Basic data== | == Basic data== | ||
− | < | + | <code>u.enter.tiltSeries(fileWorkshop); |
− | u.enter.tiltAngles(-57:3:60); | + | u.enter.tiltAngles(-57:3:60);</code> |
− | u.enter.discardedTiltIndices([1 | + | |
+ | If you want to reject some of the hight tilts (or any other view that appears to have been damages,) | ||
+ | <code>u.enter.discardedTiltIndices([1,40]); </code> | ||
== Acquisition settings== | == Acquisition settings== | ||
<tt>u.enter.settingAcquisition.apix(2.7);</tt> | <tt>u.enter.settingAcquisition.apix(2.7);</tt> | ||
+ | |||
+ | == Computation settings== | ||
+ | <tt>u.enter.settingComputing.parallelCPUUse(1); </tt> | ||
== Detection settings== | == Detection settings== | ||
These here are the actual design decisions when running an alignment workflow: | These here are the actual design decisions when running an alignment workflow: | ||
− | <code>u.enter.settingDetection.beadRadius(16); | + | <code>u.enter.settingDetection.beadRadius(16);</code> |
− | u.enter.settingDetection.maskRadius(28);</code> | + | <code>u.enter.settingDetection.maskRadius(28);</code> |
− | |||
<tt>u.enter.templateSidelength(64);</tt> | <tt>u.enter.templateSidelength(64);</tt> | ||
Line 31: | Line 35: | ||
The bin level is mainly used to accelerate the detection procedure. Needs to be chosen in a way that a binned gold bead still can be recognisable as such, with a radius of at least 4 pixels. | The bin level is mainly used to accelerate the detection procedure. Needs to be chosen in a way that a binned gold bead still can be recognisable as such, with a radius of at least 4 pixels. | ||
<tt>u.enter.settingDetection.detectionBinningFactor(1);</tt> | <tt>u.enter.settingDetection.detectionBinningFactor(1);</tt> | ||
− | |||
− | |||
− | |||
− | |||
== Changing generic parameters == | == Changing generic parameters == | ||
Yo can find handles to the parameters of the individuals steps through auto ompletion on the <tt>area</tt>, then <tt>step</tt> items. | Yo can find handles to the parameters of the individuals steps through auto ompletion on the <tt>area</tt>, then <tt>step</tt> items. | ||
<tt>u.area.indexing.step.tiltGapFiller.parameterSet.residualsThreshold(8);</tt> | <tt>u.area.indexing.step.tiltGapFiller.parameterSet.residualsThreshold(8);</tt> | ||
− | |||
− | |||
= Running the workflow = | = Running the workflow = | ||
<tt>u.run.all('noctf',1);</tt> | <tt>u.run.all('noctf',1);</tt> | ||
+ | |||
+ | = On the fly reconstruction of particles= | ||
+ | |||
+ | |||
+ | |||
+ | == Grep coordinates in the binned tomogram== | ||
+ | |||
+ | <tt>dtmslice 'workflows/new.AWF/reconstruction/binnedReconstructionWBP.mrc';</tt> | ||
+ | |||
+ | == Reconstruct particles on the fly == | ||
+ | |||
+ | The command that reconstructs full sized particles from an aligned stack is <tt>dynama_table_trec</tt>. This is an independent function, not part of the workflow, implying that we will need to perform some format conversion. | ||
+ | |||
+ | <tt>tbl = dread('binnedGoldbeads.tbl');</tt> | ||
+ | |||
+ | We scale the table | ||
+ | <code>alignmentBinLevel = 2; | ||
+ | tblFull = dynamo_table_rescale(tbl,'factor',2^alignmentBinLevel); </code> | ||
+ | |||
+ | |||
+ | <tt>source = 'workflows/new.AWF/align/alignedFullStack.mrc';</tt> | ||
+ | |||
+ | |||
+ | We create a data folder to contain the particles reconstructed on the fly. | ||
+ | <tt>targetDirectory = 'tempCrop.Data'</tt>; | ||
+ | if exist(targetDirectory,'dir')==7 | ||
+ | o.e('Deleting directory'); | ||
+ | rmdir(targetDirectory,'s'); | ||
+ | end | ||
+ | |||
+ | Angles are contained in the | ||
+ | <tt>angles = 'workflows/new.AWF/align/reconstructionTiltAngles.tlt';</tt> | ||
+ | sidelength = 160; | ||
+ | |||
+ | % | ||
+ | % shift tomogram center | ||
+ | % | ||
+ | % if the binned visualization tomogram would contain a shift | ||
+ | % we would have to scale it | ||
+ | visualizationTomogram = 'workflows/ hivCommandLine.AWF/reconstruction/binnedReconstructionWBP.mrc'; | ||
+ | sizeTomogram = dynamo_read_size(visualizationTomogram); | ||
+ | sizeTomogramFull = sizeTomogram*2^alignmentBinLevel; | ||
+ | |||
+ | |||
+ | % | ||
+ | % shift tomogram center | ||
+ | % | ||
+ | % if the binned visualization tomogram would contain a shift | ||
+ | % we would have to scale it | ||
+ | shiftTomogramCenter = [0,0,0]; | ||
+ | |||
+ | % | ||
+ | % command executions | ||
+ | % | ||
+ | dynamo_table_rec(tblFull,source,angles,targetDirectory,sidelength,.... | ||
+ | 'applyRampFilter',1,.... | ||
+ | 'sizeTomogram',sizeTomogramFull,.... | ||
+ | 'shiftTomogramCenter',shiftTomogramCenter); | ||
+ | |||
+ | figure;dslices(targetDirectory,'proj','c');shg; | ||
+ | disp('done'); |
Revision as of 14:23, 27 August 2019
This is the command line based version of the GUI based alignment walkthrough
Contents
Create the workflow
name = 'hivCommandLine'; folder = 'workflows'; u = dtsa(name,'--nogui','-path',folder,'fp',1);
Here, we instruct Dynamo to skip opening the GUI. We also create the workflow in a different folder.
Entering the data
The u object contains several areas to interact with the workflow. They can be found by autocompletion using the tab key. Here, we will proceed step by step; remember that you can write all the command lines in a single .m script.
Basic data
u.enter.tiltSeries(fileWorkshop);
u.enter.tiltAngles(-57:3:60);
If you want to reject some of the hight tilts (or any other view that appears to have been damages,)
u.enter.discardedTiltIndices([1,40]);
Acquisition settings
u.enter.settingAcquisition.apix(2.7);
Computation settings
u.enter.settingComputing.parallelCPUUse(1);
Detection settings
These here are the actual design decisions when running an alignment workflow:
u.enter.settingDetection.beadRadius(16);
u.enter.settingDetection.maskRadius(28);
u.enter.templateSidelength(64);
The bin level is mainly used to accelerate the detection procedure. Needs to be chosen in a way that a binned gold bead still can be recognisable as such, with a radius of at least 4 pixels.
u.enter.settingDetection.detectionBinningFactor(1);
Changing generic parameters
Yo can find handles to the parameters of the individuals steps through auto ompletion on the area, then step items.
u.area.indexing.step.tiltGapFiller.parameterSet.residualsThreshold(8);
Running the workflow
u.run.all('noctf',1);
On the fly reconstruction of particles
Grep coordinates in the binned tomogram
dtmslice 'workflows/new.AWF/reconstruction/binnedReconstructionWBP.mrc';
Reconstruct particles on the fly
The command that reconstructs full sized particles from an aligned stack is dynama_table_trec. This is an independent function, not part of the workflow, implying that we will need to perform some format conversion.
tbl = dread('binnedGoldbeads.tbl');
We scale the table
alignmentBinLevel = 2;
tblFull = dynamo_table_rescale(tbl,'factor',2^alignmentBinLevel);
source = 'workflows/new.AWF/align/alignedFullStack.mrc';
We create a data folder to contain the particles reconstructed on the fly.
targetDirectory = 'tempCrop.Data';
if exist(targetDirectory,'dir')==7
o.e('Deleting directory'); rmdir(targetDirectory,'s');
end
Angles are contained in the
angles = 'workflows/new.AWF/align/reconstructionTiltAngles.tlt';
sidelength = 160;
% % shift tomogram center % % if the binned visualization tomogram would contain a shift % we would have to scale it visualizationTomogram = 'workflows/ hivCommandLine.AWF/reconstruction/binnedReconstructionWBP.mrc'; sizeTomogram = dynamo_read_size(visualizationTomogram); sizeTomogramFull = sizeTomogram*2^alignmentBinLevel;
%
% shift tomogram center
%
% if the binned visualization tomogram would contain a shift
% we would have to scale it
shiftTomogramCenter = [0,0,0];
% % command executions % dynamo_table_rec(tblFull,source,angles,targetDirectory,sidelength,....
'applyRampFilter',1,.... 'sizeTomogram',sizeTomogramFull,.... 'shiftTomogramCenter',shiftTomogramCenter);
figure;dslices(targetDirectory,'proj','c');shg; disp('done');