First-time autoscreening setup » History » Version 1
Anchi Cheng, 02/28/2022 08:24 PM
| 1 | 1 | Anchi Cheng | h1. Smart-leginon multi-grid autoscreening |
|---|---|---|---|
| 2 | |||
| 3 | Automated square and hole finders are added to leginon to use Ptolemy (https://arxiv.org/abs/2112.01534) to determine optimal targets using computer vision algorithm and Convolutional Neural Network trained on user target selections accumulated at Simons Electron Microscopy Center at New York Biology Center (SEMC@NYSBC. |
||
| 4 | |||
| 5 | This implementation requires Ptolemy which has a separate license. For this release, the communication is through command line interface and rely on shared file system. |
||
| 6 | |||
| 7 | * At SEMC@NYSBC, Ptolemy, which was tested on python 3.9, runs in anaconda environment on the same CentOS7 computer where the main leginon process is. |
||
| 8 | |||
| 9 | h2. Square finding (localization and classification) |
||
| 10 | |||
| 11 | * Within Leginon MosaicExternalScoreFinder instance defines, for each incoming gr image: |
||
| 12 | ** the shell script to run Ptolemy (user set it in settings) |
||
| 13 | ** the mrc file path of the gr image leginon is currently processing as ptolemy input (leginon decides this for you) |
||
| 14 | ** the output json file path leginon will later look for the result. (leginon decision) |
||
| 15 | |||
| 16 | Here is an example how we write this shell script sq_finding.sh |
||
| 17 | |||
| 18 | <pre> |
||
| 19 | #!/bin/sh -f |
||
| 20 | # Local runs |
||
| 21 | source /usr/local/anaconda3/etc/profile.d/conda.sh |
||
| 22 | conda activate /opt/condaenvs/ptolemy_env |
||
| 23 | # variable 1 is the outputname without json extension. |
||
| 24 | # variable 2 is the input mrc path |
||
| 25 | echo $1 |
||
| 26 | echo $2 |
||
| 27 | mrc_path=$2 |
||
| 28 | python /home/your_name/site-packages/ptolemy/lowmag_cli.py -f json $2 > $1 |
||
| 29 | conda deactivate |
||
| 30 | # mv the result to leginon session rawdata directory |
||
| 31 | mv $1 ${mrc_path%%rawdata/*}rawdata/$1.json |
||
| 32 | echo ${mrc_path%%rawdata/*}rawdata/$1.json |
||
| 33 | </pre> |