Project

General

Profile

Setup Ptolemy CLI shell script » History » Revision 3

Revision 2 (Anchi Cheng, 03/15/2022 12:53 PM) → Revision 3/5 (Anchi Cheng, 09/27/2022 04:14 PM)

h1. Setup Ptolemy CLI shell script for Square Finding 

 The script needs to take three variables two options 

 # the output json file name without the extension 
 # input mrc file path 
 # the directory that contains the grid tile mrc file.    This is redundant information, but is kept to give consistent 3 option input as the Hole Finding script 

 * Within Leginon MosaicExternalScoreFinder instance defines, for each incoming gr image, a unique name from mosaic label and image id to form the value of variable 1. image: 

 Here is an example of this shell script we call sq_finding.sh 

 <pre> 
 #!/bin/sh -f 
 #python3 /emg/sw/bin/runPtolemyLmm.py $1 $2 $3 

 # This Local runs ptolemy locally using conda environment. 
 source /usr/local/anaconda3/etc/profile.d/conda.sh 
 conda activate /opt/condaenvs/ptolemy_env 
 # variable 1 is the outputname without json extension extension. 
 # variable 2 is the input mrc path 
 # variable 3 is the directory that contains the grid tile mrc file 
 echo $1 
 echo $2 
 mrc_path=$2 
 python /h/acheng/site-packages/ptolemy/lowmag_cli.py /home/your_name/packages/ptolemy/lowmag_cli.py -f json $2 > $1 
 conda deactivate 
 # mv the result to leginon session rawdata directory 
 mv $1 ${mrc_path%%rawdata/*}rawdata/$1.json 
 echo ${mrc_path%%rawdata/*}rawdata/$1.json 
 </pre> 

 Test example, assuming you have /data/leginon/22feb28a/rawdata/22feb28a_00001gr.mrc, you can test ptolemy with 
 <pre> 
 ./sq_finding.sh test_1 /data/leginon/22feb28a/rawdata/22feb28a_00001gr.mrc dummy 
 </pre> 
 Output test_1.json should end up in /data/leginon/22feb28a/rawdata/