Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDB dimensionality reduction improvements #115

Merged
merged 4 commits into from
May 30, 2022
Merged

PDB dimensionality reduction improvements #115

merged 4 commits into from
May 30, 2022

Conversation

mms29
Copy link
Collaborator

@mms29 mms29 commented Apr 21, 2022

  • Add a trajectory viewer to the PDB dimensionality reduction protocol.
  • Add the possibility to input PDBs from scipion object SetOfPDBs and from DCD trajectory files
  • Reduction methods are limited to sklearn PCA (because xmipp methods were too slow)
  • Replace the private reading of PDB by a PDB handler (protocols/utilities/pdb_handler.py) called ContinuousFlexPDBHandler designed to read/write/align/compare PDBs.

@@ -64,7 +51,7 @@ def _defineParams(self, form):
form.addSection(label='Input')
form.addParam('pdbSource', EnumParam, default=0,
label='Source of PDBs',
choices=['Used for subtomogram synthesis', 'File pattern'],
choices=['Used for subtomogram synthesis', 'File pattern', 'Object', 'Trajectory Files'],
help='Use the file pattern as file location with /*.pdb')
form.addParam('pdbs', params.PointerParam, pointerClass='FlexProtSynthesizeSubtomo',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add another pointerClass and let this work for synthesized images not only subtomograms right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would be good, we can put that as an issue for later as I won't have time to do it right away

Copy link
Collaborator

@MohamadHarastani MohamadHarastani Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets first try to do that:
pointerClass='FlexProtSynthesizeSubtomo, FlexProtSynthesizeImages',

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I understand now what you said. Actually, wouldn't it be even better to output a set of pdbs from these synthesize protocols?
What I understood at the beginning was to allow synthesizing from the same input that pdb dimred (pdb object, dcd trajectory, etc.) That would be also helpful (e.g. generate a MD simulation, then synthesize images/subtomograms)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good idea to output the set of PDBs from the synthesize protocols. An exception can be made if the user does not have a lot of space, and we can finally delete them to save disk space.

label="Alignement Reference PDB",
help='Reference PDB to align the PDBs with')
form.addParam('matchingType', params.EnumParam, label="Match structures ?", default=0,
choices=['Both structures are the same', 'Match chain name/residue num/atom name',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Both" -> "All"
"same" -> ?
For same, we need to find a smart word. Maybe something like "have 1-1 correspondence between the atoms in the same order"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about "All structures are matching", and in the help I say "Method to find atomic coordinates correspondence between the trajectory coordinates and the reference PDB. The method will select the matching atoms and sort them in the corresponding order. If the structures in the files are already matching, choose "All structures are matching"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@MohamadHarastani
Copy link
Collaborator

Good job in the a pdb handler, I hope it is not buggy haha!
I tested PDB dimred on a set of PDBs coming from synthesized subtomograms (AK, linear relationship, 100 volumes). The conformational space is not as expected. I saw two lines instead of one.
The animations were not correct either.
We can get rid of the Error bar. I know it is annoying to use the viewers with having to set the weight etc, but I solved that before in TomoFlow viewers (they don't have a color bar on the right).
Is there a reason we are not showing the conformational space without trajectories toots? I think it is not needed since there is only trajectories, so good job on that.

@mms29
Copy link
Collaborator Author

mms29 commented Apr 22, 2022

Good job in the a pdb handler, I hope it is not buggy haha!

The way I read and write PDB line is copied from biopython. Also I used this reader/writer for a long time on many PDBs so It should be fine (It should ...)

I tested PDB dimred on a set of PDBs coming from synthesized subtomograms (AK, linear relationship, 100 volumes). The conformational space is not as expected. I saw two lines instead of one. The animations were not correct either.

You are right, I did the same and I have these two lines. It seems that one PC is good and not the other, I will investigate

We can get rid of the Error bar. I know it is annoying to use the viewers with having to set the weight etc, but I solved that before in TomoFlow viewers (they don't have a color bar on the right).

That is great, I wanted to do that but I faced that I need to change different files so I left that for later. If you have something that does it please share.

Is there a reason we are not showing the conformational space without trajectories toots? I think it is not needed since there is only trajectories, so good job on that.

I removed it since it seemed doing the same thing as the trajectory tool

@mms29
Copy link
Collaborator Author

mms29 commented Apr 22, 2022

I tested PDB dimred on a set of PDBs coming from synthesized subtomograms (AK, linear relationship, 100 volumes). The conformational space is not as expected. I saw two lines instead of one. The animations were not correct either.

Actually, I did several tests but everything looks fine, I observe these two lines only on C-alpha AK and actually the PC of these two lines is extremely small compare to the first PC. When looking the trajectory, everything looks fine. I noticed that I don't have these two lines when generating the PDBs myself, so it might come from the synthesize protocol

@MohamadHarastani
Copy link
Collaborator

Hmm.. interesting. What about the animation? it is flashing for me and is not showing the movement

@mms29
Copy link
Collaborator Author

mms29 commented Apr 22, 2022

Is it a visualization problem ? Or the trajectory does not correspond ?

@MohamadHarastani
Copy link
Collaborator

It looks like that (few sparse points and the structure is hidden)
image

@MohamadHarastani
Copy link
Collaborator

I have just tried to give it a file pattern and it does not allow me to execute. I think it's a problem of "allowsNull". Are you sure you don't have some unpushed commits? lol

@mms29
Copy link
Collaborator Author

mms29 commented Apr 25, 2022

Okay that is very strange. Can you share the PDBs you used for this plot ?

@MohamadHarastani
Copy link
Collaborator

Okay that is very strange. Can you share the PDBs you used for this plot ?

I generated them using the volume synthesis protocol, I can send them of course. I commented up that I could not give a file pattern as input, can you?

@MohamadHarastani MohamadHarastani linked an issue Apr 26, 2022 that may be closed by this pull request
@MohamadHarastani
Copy link
Collaborator

Hey Remi.. I tested again and didn't notice any problem. Let me know if you are working on something here or we can merge these changes.

@mms29 mms29 merged commit 8ae9e74 into devel May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding trajectory animations to PDB dimred protocol
2 participants