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

Add position and scaling matrix for nup84 2D EM #30

Closed
tomgoddard opened this issue Mar 30, 2017 · 11 comments
Closed

Add position and scaling matrix for nup84 2D EM #30

tomgoddard opened this issue Mar 30, 2017 · 11 comments
Assignees

Comments

@tomgoddard
Copy link
Collaborator

nup84.cif has a reference to a 2D EM map (*.pgm) file which does not contain pixel size information or alignment to the sphere models.

@tomgoddard
Copy link
Collaborator Author

The scale is already provided in pixel_size_width and pixel_size_height of the ihm_2dem_class_average_restraint table. So only rotation and translation need to be provided using the current ihm_2dem_class_average_fitting table.

@benmwebb
Copy link
Contributor

benmwebb commented May 9, 2017

@tomgoddard, any preferred convention for this transformation? Since we don't currently have it in IMP, I may as well be consistent with whatever convention Chimera uses when I add it. (By "convention" I mean where do you place 2D images relative to 3D objects? On the xz or yz plane? Centered at the origin or origin at bottom left of the image?) @brindakv, we should state this convention in the dictionary too so there's no confusion.

@tomgoddard
Copy link
Collaborator Author

tomgoddard commented May 9, 2017 via email

benmwebb added a commit to salilab/pmi that referenced this issue May 17, 2017
Extract 2DEM fitting information (transformation that places
the model onto the image, and the cross correlation coefficient)
from the PMI stat file, and write it out into mmCIF files.
Relates ihmwg/IHMCIF#30.
@tomgoddard
Copy link
Collaborator Author

tomgoddard commented May 17, 2017 via email

@benmwebb
Copy link
Contributor

The nup84 example 2DEM fitting matrix is not aligning the map with the cluster 1 sphere model

Is the code for this in ChimeraX already? Seems to me like it would be easier for me to fiddle with it at my end rather than going back and forth. And I'll double-check the transformation here. There is a test in the IMP test suite with a toy system, but possibly something weird is happening for Nup84.

The conventions are not clear in the ihm-extension.dic file

If I understand you correctly, your thoughts on what they should be match what I implemented in IMP, except that the rotation and translation are applied to the 3D model, not the image. That's presumably why you had to invert the rotation matrix. @brindakv needs to clearly state the convention in the dictionary, but of course it's easy for whoever ends up being "wrong" to invert the transformation. (My feeling is that the transformation should apply to the model rather than the image because the image is pristine input data while the model is noisy output data. Of course for viewing you can choose to transform either.)

In the nup84 example the rotation matrix elements have only 3 digits to the right of the decimal place.

No problem - I can output them with more precision. My CIF writer outputs all floats with 3 places, but I can hack it to add more precision just for these fields.

@benmwebb benmwebb reopened this May 18, 2017
@tomgoddard
Copy link
Collaborator Author

tomgoddard commented May 18, 2017 via email

@benmwebb
Copy link
Contributor

FYI, looks like GitHub strips attachments if you reply to an issue by email, so nobody can see the image.

@tomgoddard
Copy link
Collaborator Author

tomgoddard commented May 18, 2017 via email

benmwebb added a commit to salilab/pmi that referenced this issue May 18, 2017
In order for viewers to be able to reconstruct a rotation matrix
that's reasonably close to orthogonal, we need to output the elements
with more than 3 digits or precision. Increase to 6 digits.
Relates ihmwg/IHMCIF#30.
@benmwebb
Copy link
Contributor

Ah, I see the problem. The transformation is correct but it's for the model as stored in the RMF file. For some reason we center the models on the origin before writing out the mmCIF file. So we could either adjust the transformation to account for that, or deposit the IMP model coordinates without centering them first. I'm inclined to do the latter since the fewer differences between what we have in our 'raw' files (e.g. trajectories) and the mmCIF, the better.

@tomgoddard
Copy link
Collaborator Author

tomgoddard commented May 18, 2017 via email

benmwebb added a commit to salilab/pmi that referenced this issue May 18, 2017
For the sake of reproducing what was done in the modeling
as well as possible, it's better to use the same model
coordinates in the RMF and the mmCIF output (previously mmCIF
output was centered). This also ensures that trajectories
or ensembles are in the same reference frame as mmCIF and so work
correctly. Provide a Transformation3D for each model
so that this behavior can be overridden. (We do this for Nup84 since
the trajectories there are multimodel PDB files, which have already
been centered, so in this case it makes sense to center the mmCIF
output to match. Relates ihmwg/IHMCIF#30.)
@benmwebb
Copy link
Contributor

Turns out that the Nup84 trajectories are also centered, so it makes sense to leave the mmCIF output as it is. Pretty easy to invert this centering before applying the image transformation though.

benmwebb added a commit to integrativemodeling/nup84 that referenced this issue May 18, 2017
The trajectories here are multimodel PDB files, which have already
been centered, so it makes sense to center the mmCIF output to match.
This used to happen automatically, but this behavior changed in PMI
as of salilab/pmi@f87844. Relates ihmwg/IHMCIF#30.
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

No branches or pull requests

2 participants