As a follow-up to the EMAN2 box files to Particle Position Assets text file conversion post, is there an easy way to take the cisTEM particle positions and write out a text file? I really want to convert the cisTEM co-ordinates to co-ordinate files for other software packages, but a simple text file would be more universally useful if I didn't know whether I wanted to convert to EMAN2, Relion, Xmipp, bsoft or some other package. I realize that I can cut and past from the asset display of the positions, but it would be nice if there were an automatic way to dump that information to text (and cutting and pasting 100,000 entries would be painful!).
There may be data files that do contain this information, but I have looked through everything in the Assets area and did not see anything useful. The ParticlePosition directory after running the tutorial is empty, which was a bit of a surprise.
Finally, I don't care whether the co-ords are in pixels or A (as long as I can tell which is in the output) and while it would be nice to include the micrograph name/ID, I should also be able to deal with making that connection later.
Thanks.
Hi David,
There is no way to do this directly from the GUI currently, however you can easily get this information from the database.
The following command will give you a list of all particle positions, with the format filename, x_position, y_position :-
sqlite3 database_name.db "select filename, x_position, y_position from image_assets, particle_position_assets where image_assets.image_asset_id = particle_position_assets.parent_image_asset_id;"
You will need to replace database_name.db with your database. The output co-ordinates will be in angstroms. You can pipe this to a file. By default the separator will be a '|' but you can set this to whatever you want by adding the -separator option after sqlite3, for example to separate by spaces you would run :-
sqlite3 -separator ' ' database_name.db "select filename, x_position, y_position from image_assets, particle_position_assets where image_assets.image_asset_id = particle_position_assets.parent_image_asset_id;"
Hope this does what you want!
Cheers,
Tim
Tim,
Thanks very much. That should do exactly what I want.
Tim,
I am back to this issue again - getting particle positions from cisTEM. Your suggestion from above works nicely, but I have a question about the output. The output appears to be in Angstroms. If I divide the postion in A by the pixel size in A, I should get the positions in pixels. I was expecting this to be integer (or at least near integer from various storage and rounding errors), but that's not at all what I see. Why aren't these positions integer? The implication is that the particle boxes are being extracted using centers based on fractional co-ordinates, which seems odd...
Hi David,
The positions are found on micrographs that have been resampled to a smaller size. The search does find integer results - but they may not be integer on the full size micrograph.
When the particles are cut out, they are cut rounded to the closest integer pixel.
Cheers,
Tim
Hi Tim,
Following the introduciton, we are able to extract out all particle positions (unselected) from the "database_name.db" and the pickJob ID is lost in the output file. Is there a convenient way to extract the particle positions based on the "pick Job I.D." or with the "pick Job I.D." informaiton incldued in the output?
Thank you!
Haixin
Hi,
The particle picking assets contains only the currently selected results. These may be from different pick jobs. If you simply want to see the pick job id for each particle position asset, you can use the command :-
select filename, x_position, y_position,pick_job_id from image_assets, particle_position_assets where image_assets.image_asset_id = particle_position_assets.parent_image_asset_id;
This will only show the currently active picks though - is this what you want? If you want to see all particles from all pick jobs, this is also possible - let me know if that is what you want.
Cheers,
Tim
Hi Tim. Yes. This is what I need. It works well:-) Thank you!