carsonpurnell / cryotomosim_CTS

cryo-EM tomogram simulator
Other
20 stars 3 forks source link

Tutorial/example file #9

Closed builab closed 7 months ago

builab commented 8 months ago

Hi, I am trying to create a simulated tomogram for segmentation training in DragonFly. Unfortunately, I found the guideline quite difficult to follow.

Is this possible that you provide examples in the github to better understanding of the program?

For example, examples to simulate a tomogram shown in your paper with the pdb file, script file (not using UI) to generate the tomogram?

Thanks,

carsonpurnell commented 8 months ago

The tutorial can definitely be improved. which parts are stumbling blocks?

hamid13r commented 8 months ago

I just followed the first tutorial. I believe providing a .m file to run with a pdb file attached (or suggesting a pdb to be downloaded) could help.

I downloaded the ATP synthase atomic model using: wget https://files.rcsb.org/download/5LQX.cif ./

and then ran:


addpath("/home/janlevinson/MATLAB/R2022a/toolbox/cryotomosim_CTS/")
addpath("/home/janlevinson/MATLAB/R2022a/toolbox/cryotomosim_CTS/WIP/")
addpath("/home/janlevinson/MATLAB/R2022a/toolbox/emtoolbox/EMIODist2/")

[parammodel] = param_model(6.65,'layers',1)

[cts] = cts_model(zeros(300,400,50),parammodel,'suffix','atp_1')
paramsim=param_simulate('gui')

cts_simulate('gui', paramsim, 'suffix', 'atp_1');

This will fist prompt to input the cif file, and then a second prompt to input the model which is located in ~/tomosim/model_2024-03-04t16.49_fix_5LQX_pixelsize_6.65/fix_5LQXatp_1.mrc

the location of the model was a little confusing, but after figuring that out I could keep playing with the parameters and get different tomograms simulated.

Hope this helps, I have not used matlab in ages and I think that contributed to my confusion.

builab commented 8 months ago

Thanks. I suggest the easiest tutorial to show how to create the training presented in the preprint from simple to more complicated ones such as bundled actins. Right now, every guide is separated and is not as easy to follow.

For more advanced tutorials, I would say a good explanation of how the param file is recorded. I want to construct a param model with a specific geometry.

carsonpurnell commented 8 months ago

I've created a very basic interactive tutorial script - cts_demo_script.m. Should make it easier to start running simulations.

@builab, what geometry are you trying to generate? currently only rectangular fields are possible, and superstructure like domed ice require manual work with MATLAB.

builab commented 8 months ago

I want to create a cilia geometry (basically a 9x bundle of doublet microtubules). I have the coordinates of subtomogram to put back in a tomogram. I have the PDB for the doublet microtubule as well. So I need to know how you can define coordinates so I can create the model files from my data to generate the training data.

carsonpurnell commented 8 months ago

CTS has no methods for using known coordinates to generate anything. You could get a cilial bundle with a long tubular model, and add constraint borders to the other long edge (X or Y). the doublet model you use might need to be manually lengthened - I've only seen relatively short ones. Though if you already have coordinates, what is the use case? Are you trying to denoise?

builab commented 8 months ago

I know that CTS does have any method for that. But if I can understand the file format properly how the coordinate is place for the final one. I can write a script to convert my coordinate as a "mock param file" for CTS to generate. I want to train this so then I can segment data from many mutants.

carsonpurnell commented 8 months ago

There's nothing about the files that could allow you to do that - model synthesis is not via using generated coordinates. You would need to develop your own MATLAB scripts to do that (and it would require coordinates and orientations for the particles).

With CTS, you do not need to do any of that. You can train a segmentation network with a standard simulation output and apply it to any number of cilia tomograms you may have. Your existing data can't contribute to that network training unless you have a hand-segmented tomogram to add as additional training data.

builab commented 7 months ago

So do you have script for generating the actin bundle in the paper as example here?

Also, for testing, I can generate some tomograms with layers contain some proteins. How do we import this information in DragonFly for training?

carsonpurnell commented 7 months ago

There is no special script for bundles. It all goes through the same functions. The only thing bundles need is a properly made structure file for the bundle in question, which is described in readme_structurefils.docx

The simulated data is all image stacks. It's used the same way as any other training data, in dragonfly or other DL method. The atlas is for segmentation, while regression needs multiple simulations. You'll want to check dragonfly's tutorials on details for using their software, it's a very busy UI.