Skip to content

… karena “Lupa – script perhitungan EF – itu manusiawi …”

November 12, 2012

“To be able to forget means sanity.” (Jack London, The Star Rover)

DosGil akan mendokumentasikan (kembali) script-script yang fungsional dalam riset DosGil, supaya suatu saat jika diperlukan bisa digali kembali di sini. Berikut adalah script yang masih dalam perkembangan untuk secara kasar dan cepat menghitung enrichment factors dalam retrospective virtual screeningUgly? Perhaps, but it works.  Catatan: Script ini modifikasi dari script yang dibuat M. Radifar (@Radif: Thanks!):

mod_EF_calc.sh:
#!/bin/sh
if [ $# -eq 2 ]; then
actives=`echo “scale = 2 ; $1/100” | bc`
decoys=`echo “scale = 0 ; ($2/100) + 1” | bc`
decoys2=`echo “scale = 0 ; (2*($2/100)) + 1” | bc`
decoys5=`echo “scale = 0 ; (5*($2/100)) + 1” | bc`
decoys10=`echo “scale = 0 ; (10*($2/100)) + 1” | bc`
decoys20=`echo “scale = 0 ; (20*($2/100)) + 1” | bc`
active_count=0
decoy_count=0
awk ‘{print $1}’ tc_all_sorted.csv > tc_all_sorted_1stcol.lst
for ligand in $(cat tc_all_sorted_1stcol.lst)
do
active=`echo $ligand | grep ‘ER-ANT’`
decoy=`echo $ligand | grep ‘/ZINC’`
if [ -z “$active” ]; then
decoy_count=`expr $decoy_count + 1`
else
active_count=`expr $active_count + 1`
fi
if [ “$decoy_count” -eq  “$decoys” ]; then
ef1=`echo “scale = 2 ; $active_count / $actives” | bc`
echo “EF 1% : $ef1; decoy = $decoy” >> EF1.tmp
fi
if [ “$decoy_count” -eq  “$decoys2” ]; then
ef2=`echo “scale = 2 ; ($active_count / $actives)/2” | bc`
echo “EF 2% : $ef2; decoy = $decoy” >> EF2.tmp
fi
if [ “$decoy_count” -eq  “$decoys5” ]; then
ef5=`echo “scale = 2 ; ($active_count / $actives)/5” | bc`
echo “EF 5% : $ef5; actives = $active_count; decoy = $decoy” >> EF5.tmp
fi
if [ “$decoy_count” -eq  “$decoys10” ]; then
ef10=`echo “scale = 2 ; ($active_count / $actives)/10” | bc`
echo “EF 10% : $ef10; actives = $active_count; decoy = $decoy” >> EF10.tmp
fi
if [ “$decoy_count” -eq  “$decoys20” ]; then
ef20=`echo “scale = 2 ; ($active_count / $actives)/20” | bc`
echo “EF 20% : $ef20; actives = $active_count; decoy = $decoy” >> EF20.tmp
fi
#    echo “$decoy, $active”
#    echo “decoy count = $decoy_count, active count = $active_count”
done
head -1 EF1.tmp
head -1 EF2.tmp
head -1 EF5.tmp
head -1 EF10.tmp
head -1 EF20.tmp
rm EF*.tmp

else
echo “Penggunaan: ./[filename].sh jumlah_actives jumlah_decoys”;
fi

*Pogung, 12 November 2012,  WIB

Iklan

From → Script

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: