|
本帖最后由 pika02 于 2022-10-4 00:12 编辑
- #!/bin/bash
- # define a function to get value, usage: 'string' number (defaut 1)
- getvalue(){
- grep -m 1 "${1}" $raw |\
- grep -Eo ' -?[0-9]+\.*[0-9]+' |\
- sed -n "${2:-1}p" |\
- sed 's/ //g'
- }
- echo "Script for generating ESP relative descriptors from multiple gbw files."
- tmp=$(mktemp)
- list=$(mktemp)
- cat << EOF > $tmp
- 12
- 0
- -1
- -1
- q
- EOF
- # for gbws in *.gbw
- # do
- # echo "Convert from ${gbws} to wfn..."
- # $HOME/apps/orca4/orca_2aim ${gbws%.gbw}
- # rm -f *.wfx
- # echo "done"
- # done
- echo "\
- file,\
- Volume (Angstrom^3),\
- density (g/cm^3),\
- Minimal value (kcal/mol),\
- Maximal value (kcal/mol),\
- Overall surface area (Angstrom^2),\
- Positive surface area (Angstrom^2),\
- Negative surface area (Angstrom^2),\
- Overall average value (kcal/mol),\
- Positive average value (kcal/mol),\
- Negative average value (kcal/mol),\
- Overall variance (sigma^2_tot) (kcal^2/mol^2),\
- Positive variance (kcal^2/mol^2),\
- Negative variance (kcal^2/mol^2),\
- Balance of charges (nu),\
- Product of sigma^2_tot and nu (kcal/mol),\
- Internal charge separation (Pi) (kcal/mol),\
- Molecular polarity index (MPI) (kcal/mol),\
- Nonpolar surface area (|ESP| <= 10 kcal/mol) (Angstrom^2),\
- Nonpolar surface area (%),\
- Polar surface area (|ESP| > 10 kcal/mol) (Angstrom^2),\
- Polar surface area (%)\
- " > "$list"
- for file in *.wfn
- do
- echo "Calculating descriptors from $file ..."
- raw=$(mktemp)
- Multiwfn $file < $tmp > $raw
- volume=$(getvalue 'Volume:' 2)
- density=$(getvalue 'Estimated density')
- minimal=$(getvalue 'Minimal' 1)
- maximal=$(getvalue 'Maximal' 2)
- osa=$(getvalue 'Overall surface area' 2)
- psa=$(getvalue 'Positive surface area' 2)
- nsa=$(getvalue 'Negative surface area' 2)
- oav=$(getvalue 'Overall average value' 2)
- pav=$(getvalue 'Positive average value' 2)
- nav=$(getvalue 'Negative average value' 2)
- ov=$(getvalue 'Overall variance' 2)
- pv=$(getvalue 'Positive variance' 2)
- nv=$(getvalue 'Negative variance' 2)
- bc=$(getvalue 'Balance of charges')
- psn=$(getvalue 'Product of sigma^2_tot and nu' 2)
- ics=$(getvalue 'Internal charge separation' 2)
- mpi=$(getvalue 'Molecular polarity index' 2)
- ns=$(getvalue 'Nonpolar surface area' 2)
- nsp=$(getvalue 'Nonpolar surface area' 3)
- ps=$(getvalue 'Polar surface area' 2)
- psp=$(getvalue 'Polar surface area' 3)
- echo "\
- $file,\
- $volume,\
- $density,\
- $minimal,\
- $maximal,\
- $osa,\
- $psa,\
- $nsa,\
- $oav,\
- $pav,\
- $nav,\
- $ov,\
- $pv,\
- $nv,\
- $bc,\
- $psn,\
- $ics,\
- $mpi,\
- $ns,\
- $nsp,\
- $ps,\
- $psp\
- " >> $list
- done
- rm $tmp
- mv $list descriptors.csv
- echo "Finished"
复制代码
改自http://bbs.keinsci.com/thread-12066-1-1.html,注释掉了批量转换gbw的功能
参见http://sobereva.com/601
|
评分 Rate
-
查看全部评分 View all ratings
|