Request: More tools for handling UIDs

Hi All,

It would be great to have more options integrated in cryosparc for removing or preventing the addition of UIDs.

I currently have a scenario where imported particles are accumulating a second UID in the micrograph path. In this case, csparc2star.py --strip-uid removes both UIDs preventing --copy-micrograph-coordinates from working.

Example:

Original star file path = Extract/job147/J902/motioncorrected/000009858663425993277_FoilHole_16063338_Data_1606516
0_16065161_20210616_1641-91434_patch_aligned_doseweighted.mrcs

from_csparc.star path = Extract/job147/J902/motioncorrected/010111053032402395369_000009858663425993277_FoilHole_16063338_Data_16065160_16065161_20210616_1641-91434_patch_aligned_doseweighted.mrcs

I noticed after the fact that particle import has the option to remove_leading_uid but it’s unclear if this will remove the first UID or prevent the second one from being added.

Sorry to bring this up again but the UID’s are a source of continual frustration.

Best,

Ryan

I was actually one step ahead this time*! If you pass a positive number to --strip-uid it removes that number of UIDs starting from the left side (i.e. it deletes the newer ones first). The argument has a default of -1 indicating removal of all UIDs.

*I admit it was never documented.

2 Likes

Nice, thank you! :sunglasses:

I begrudgingly figured it out with sed but this will be helpful in the future!

I’ll add a note about the feature to the help text. If you don’t mind could you double check that it would have worked for you?

I can confirm csparc2star.py particles_selected.cs from_csparc.star --strip-uid 1 produces this path:

000001@J69/imported/000009858663425993277_FoilHole_16063338_Data_16065160_16065161_20210616_1641-91434_patch_aligned_doseweighted.mrcs

instead of:

000001@J69/imported/010111053032402395369_000009858663425993277_FoilHole_16063338_Data_16065160_16065161_20210616_1641-91434_patch_aligned_doseweighted.mrcs

Thank you again for the fix!

Until next time :upside_down_face:

-Ryan

This option would remove the first UID.