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

How to sort Class2D result by # of particles contributing to a class to filter bad classes? #406

Closed
davidh99720 opened this issue Oct 19, 2018 · 4 comments

Comments

@davidh99720
Copy link

I write a bash code to add the parameter rlnNrOfPtclsContributes ( # of particles contributing to a class ) to the last column of the ***model.star file. But I cannot display it either in the gui or in the command line.

***In the gui, I cannot find the sorting parameter in the Display window. I even copy this ***model.star file to all the corresponding .Nodes folders of this job, but it still does not work.
The initial part of my ***model.star file is attached in the appendix.

***In the command line, the sorting option just does not work at all.
relion_display --i Class2D/job037/run_ct1_it035_model_cls_cnt.star --display rlnReferenceImage --sort rlnClassDistribution
ERROR:
Cannot find metadata label in input STAR file
File: /home/jf/relions/relion/src/displayer.cpp line: 2359

If really appreciate it if anyone could please tell me how to figure it out in either way?

While the commandline way will give me a good idea of what is going on, the gui way will be even better so that one could select particles according to the rlnNrOfPtclsContributes parameter.


Appendix:
The initial part of my ***model.star file looks like this:
data_model_general

_rlnReferenceDimensionality 2
_rlnDataDimensionality 2
_rlnOriginalImageSize 256
_rlnCurrentResolution 21.428565
_rlnCurrentImageSize 62
_rlnPaddingFactor 2.000000
_rlnIsHelix 0
_rlnFourierSpaceInterpolator 1
_rlnMinRadiusNnInterpolation 10
_rlnPixelSize 1.757812
_rlnNrClasses 175
_rlnNrBodies 1
_rlnNrGroups 44
_rlnTau2FudgeFactor 2.000000
_rlnNormCorrectionAverage 0.601083
_rlnSigmaOffsets 4.895352
_rlnOrientationalPriorMode 0
_rlnSigmaPriorRotAngle 0.000000
_rlnSigmaPriorTiltAngle 0.000000
_rlnSigmaPriorPsiAngle 0.000000
_rlnLogLikelihood 2.774501e+07
_rlnAveragePmax 0.419203

data_model_classes

loop_
_rlnReferenceImage #1
_rlnClassDistribution #2
_rlnAccuracyRotations #3
_rlnAccuracyTranslations #4
_rlnEstimatedResolution #5
_rlnOverallFourierCompleteness #6
_rlnClassPriorOffsetX #7
_rlnClassPriorOffsetY #8
_rlnNrOfPtclsContributes #9
000001@Class2D/job037/run_ct1_it035_classes.mrcs 4.472482e-04 999.000000 999.000000 40.909079 0.841897 0.001685 0.002579 1
000002@Class2D/job037/run_ct1_it035_classes.mrcs 0.000000 999.000000 999.000000 inf 0.000000 0.000000 0.000000 0
000003@Class2D/job037/run_ct1_it035_classes.mrcs 4.472852e-04 999.000000 999.000000 inf 0.000000 -0.003232 0.003452 1
000004@Class2D/job037/run_ct1_it035_classes.mrcs 0.004025 999.000000 999.000000 inf 0.000000 -0.005860 -0.003068 9
000005@Class2D/job037/run_ct1_it035_classes.mrcs 0.000000 999.000000 999.000000 37.499989 0.895118 0.000000 0.000000 0
000006@Class2D/job037/run_ct1_it035_classes.mrcs 0.002237 999.000000 999.000000 37.499989 0.994555 7.882948e-05 0.002085 5
000007@Class2D/job037/run_ct1_it035_classes.mrcs 0.005814 999.000000 999.000000 37.499989 0.995965 8.008551e-05 -0.015174 13
000008@Class2D/job037/run_ct1_it035_classes.mrcs 0.000000 999.000000 999.000000 34.615375 0.724535 0.000000 0.000000 0
000009@Class2D/job037/run_ct1_it035_classes.mrcs 0.023238 3.000000 2.120000 26.470581 0.984149 -0.005825 -0.022563 52
000010@Class2D/job037/run_ct1_it035_classes.mrcs 0.002236 999.000000 999.000000 inf 0.000000 -0.001713 -0.008052 5
000011@Class2D/job037/run_ct1_it035_classes.mrcs 0.005367 999.000000 999.000000 37.499989 0.997322 -0.013150 -0.012371 12
000012@Class2D/job037/run_ct1_it035_classes.mrcs 0.000000 999.000000 999.000000 inf 0.000000 0.000000 0.000000 0
000013@Class2D/job037/run_ct1_it035_classes.mrcs 0.004919 999.000000 999.000000 inf 0.000000 -0.015074 -0.014410 11
000014@Class2D/job037/run_ct1_it035_classes.mrcs 8.945915e-04 999.000000 999.000000 44.999987 0.886530 -0.004107 -2.189877e-04 2
000015@Class2D/job037/run_ct1_it035_classes.mrcs 0.006261 999.000000 999.000000 inf 0.000000 -0.015175 -0.005678 14
000016@Class2D/job037/run_ct1_it035_classes.mrcs 0.007155 999.000000 999.000000 inf 1.000000 -0.009667 0.001176 16
000017@Class2D/job037/run_ct1_it035_classes.mrcs 0.005370 999.000000 999.000000 40.909079 0.992716 -0.011465 0.001953 12
000018@Class2D/job037/run_ct1_it035_classes.mrcs 0.007603 999.000000 999.000000 34.615375 0.997217 -0.004151 -0.002601 17
000019@Class2D/job037/run_ct1_it035_classes.mrcs 0.012969 2.600000 1.960000 37.499989 0.993605 -0.008779 -0.010416 29
000020@Class2D/job037/run_ct1_it035_classes.mrcs 0.008051 999.000000 999.000000 37.499989 0.997878 0.002715 -0.006824 18
000021@Class2D/job037/run_ct1_it035_classes.mrcs 0.002237 999.000000 999.000000 40.909079 0.981540 -0.003955 0.007113 5
000022@Class2D/job037/run_ct1_it035_classes.mrcs 0.000000 999.000000 999.000000 inf 0.000000 0.000000 0.000000 0
000023@Class2D/job037/run_ct1_it035_classes.mrcs 0.001790 999.000000 999.000000 inf 0.000000 0.001523 4.031128e-04 4
000024@Class2D/job037/run_ct1_it035_classes.mrcs 0.006709 999.000000 999.000000 37.499989 0.997891 -0.005781 -0.013679 15
000025@Class2D/job037/run_ct1_it035_classes.mrcs 0.007619 999.000000 999.000000 37.499989 0.999687 0.016890 -0.002950 17
000026@Class2D/job037/run_ct1_it035_classes.mrcs 0.005367 999.000000 999.000000 37.499989 0.994940 0.008876 -0.003741 12
000027@Class2D/job037/run_ct1_it035_classes.mrcs 0.001789 999.000000 999.000000 40.909079 0.978643 0.004148 -2.009615e-04 4
000028@Class2D/job037/run_ct1_it035_classes.mrcs 8.947553e-04 999.000000 999.000000 inf 0.000000 0.003757 8.244485e-05 2
000029@Class2D/job037/run_ct1_it035_classes.mrcs 0.008500 999.000000 999.000000 34.615375 0.999776 0.029146 -0.008430 19

@biochem-fan
Copy link
Member

Why do you need such a column? What is the difference from sorting by rlnClassDistribution?

You cannot add an arbitrary column to the STAR file. Allowed column names are defined in metadata_label.h.

@davidh99720
Copy link
Author

davidh99720 commented Oct 19, 2018

@biochem-fan Thank you for your answer, that's part of the things I want to know. I really appreciate it.

Yes, since rlnClassDistribution is the distribution ratio of the particles in a specific class according to your answer (that's what you mean, right?), sorting with it should be enough for filtering bad classes. Thank you!

Besides, if the column rlnNrOfPtclsContributes (maybe you can give it a better name) could be added to class2D result, it will give user a straightforward impression of how many particles are in the class (like EMAN did). This will be useful when people is dealing with noisy and heterogeneous (especially flexible proteins or complexes) data.

Another thing I asked is the relion_display itself. While it works in GUI, in command I cannot make it work. I wonder if you could have a print command button for the display window?
I quote it here for your convenience:
"""
relion_display --i Class2D/job037/run_ct1_it035_model_cls_cnt.star --display rlnReferenceImage --sort rlnClassDistribution
ERROR:
Cannot find metadata label in input STAR file
File: /home/jf/relions/relion/src/displayer.cpp line: 2359
"""
Maybe I should ask this in another issue?

@xeniorn
Copy link

xeniorn commented Oct 20, 2018

I encountered the same error with relion_display. Relion_display will not recognize rlnReferenceImage, but will recognize it if you rename it to (or add) a rlnImageName. This is indeed inconsistent with the behavior of the display UI when ran through the relion GUI.

@biochem-fan
Copy link
Member

You can select multiple classes in the relion_display, right click it and select Show metadata this class. This will tell how many particles in the selected classes.

For the command line, add --class:

relion_display --i Class2D/job037/run_ct1_it035_model_cls_cnt.star --display rlnReferenceImage --sort rlnClassDistribution

(You can ps aux|grep relion_display to see exactly what command GUI started)

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

3 participants