Setup Ptolemy CLI shell script » History » Version 2
  Anchi Cheng, 03/15/2022 12:53 PM 
  
| 1 | 2 | Anchi Cheng | h1. Setup Ptolemy CLI shell script for Square Finding  | 
|---|---|---|---|
| 2 | 1 | Anchi Cheng | |
| 3 | The script needs to take two options  | 
||
| 4 | |||
| 5 | # the output json file name without the extension  | 
||
| 6 | # input mrc file path  | 
||
| 7 | |||
| 8 | * Within Leginon MosaicExternalScoreFinder instance defines, for each incoming gr image:  | 
||
| 9 | |||
| 10 | Here is an example of this shell script we call sq_finding.sh  | 
||
| 11 | |||
| 12 | <pre>  | 
||
| 13 | #!/bin/sh -f  | 
||
| 14 | # Local runs  | 
||
| 15 | source /usr/local/anaconda3/etc/profile.d/conda.sh  | 
||
| 16 | conda activate /opt/condaenvs/ptolemy_env  | 
||
| 17 | # variable 1 is the outputname without json extension.  | 
||
| 18 | # variable 2 is the input mrc path  | 
||
| 19 | echo $1  | 
||
| 20 | echo $2  | 
||
| 21 | mrc_path=$2  | 
||
| 22 | python /home/your_name/packages/ptolemy/lowmag_cli.py -f json $2 > $1  | 
||
| 23 | conda deactivate  | 
||
| 24 | # mv the result to leginon session rawdata directory  | 
||
| 25 | mv $1 ${mrc_path%%rawdata/*}rawdata/$1.json | 
||
| 26 | echo ${mrc_path%%rawdata/*}rawdata/$1.json | 
||
| 27 | </pre>  | 
||
| 28 | |||
| 29 | Test example, assuming you have /data/leginon/22feb28a/rawdata/22feb28a_00001gr.mrc, you can test ptolemy with  | 
||
| 30 | <pre>  | 
||
| 31 | ./sq_finding.sh test_1 /data/leginon/22feb28a/rawdata/22feb28a_00001gr.mrc  | 
||
| 32 | </pre>  | 
||
| 33 | Output test_1.json should end up in /data/leginon/22feb28a/rawdata/  |