Skip to content

Commit

Permalink
added catch statement for leaflet_sorter_3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Sandberg committed Nov 14, 2024
1 parent 53b4085 commit 9ab5120
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion TCL/polarDensity_for_DTA.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,23 @@ proc leaflet_sorter_2 {atsel_in refsel_in frame_i} {
;# Compares lipid's COM z component to local midplane and sorts accordingly.
proc leaflet_sorter_3 {atsel_in frame_i} {
set lipidsel [atomselect top $atsel_in frame $frame_i]
puts [$lipidsel num]
set lipid_com [measure center $lipidsel weight mass]
set lipid_x [lindex $lipid_com 0]
set lipid_y [lindex $lipid_com 1]
set lipid_z [lindex $lipid_com 2]

set local_surfaces [atomselect top "name PO4 GL1 GL2 AM1 AM2 and (x-$lipid_x)*(x-$lipid_x)+(y-$lipid_y)*(y-$lipid_y)<200" frame $frame_i]
set local_midplane [lindex [measure center $local_surfaces weight mass] 2]

if { [catch {set local_midplane [lindex [measure center $local_surfaces weight mass] 2]} errid] } {
puts stderr "$errid"
$lipidsel set user2 3
$lipidsel delete
$local_surfaces delete
return 3
} else {
set local_midplane [lindex [measure center $local_surfaces weight mass] 2]
}
$local_surfaces delete

if {$lipid_z < $local_midplane} {
Expand Down

0 comments on commit 9ab5120

Please sign in to comment.