############################ # This tcl script uses sasa command to estimate surface area of whole oil droplet, and the contact areas of oil-water and oil-surface. # command [measure sasa] # 'measure sasa 1.4 $A -restrict $B' means sasa only calculates the restrict region $B of selected entity $A # with a probing radius of 1.4 angstrom (water) # # polar oil: OTT # surface: KER # water: SOL # created by Zelong Zhang in 2020 # https://er1czz.github.io/vmd/ ############################ set output [open "sasa_out.txt" w] set frames [molinfo top get numframes] # loop for {set i 0} {$i < $frames} {incr i} { set oil [atomselect top "resname OTT" frame $i] set ok [atomselect top "resname OTT KER" frame $i] set ow [atomselect top "resname OTT SOL" frame $i] set sasa_total [measure sasa 1.4 $oil] set sasa_dome [measure sasa 1.4 $ok -restrict $oil ] set sasa_bottom [measure sasa 1.4 $ow -restrict $oil ] puts $output "$i $sasa_total $sasa_dome $sasa_bottom" puts "Frame: $i $sasa_total $sasa_dome $sasa_bottom" } puts "Bingo!" puts "Your data have been saved to the output file: sasa_out.txt" puts "data format as:" puts "Frame id, oil total, oil-water, oil-surface (unit: angstrom^2)" close $output