proc .. {a {b ""} {step 1}} { if {$b eq ""} {set b $a; set a 0} ;# argument shift if {![string is int $a] || ![string is int $b]} { scan $a %c a; scan $b %c b incr b $step ;# let character ranges include the last set mode %c } else {set mode %d} set ss [sgn $step] if {[sgn [expr {$b - $a}]] == $ss} { set res [format $mode $a] while {[sgn [expr {$b-$step-$a}]] == $ss} { lappend res [format $mode [incr a $step]] } set res } ;# one-armed if: else return empty list } proc sgn x {expr {($x>0) - ($x<0)}} # set q [.. 431 450] # set p [.. 414 433] # Model residue numbers set A2 [.. 665 905] set B1 [.. 424 596] set B2 [.. 658 903] set C2 [.. 661 902] set D1 [.. 424 595] set D2 [.. 664 909] # Correct residue numbers set A2c [.. 601 841] set B1c [.. 406 578] set B2c [.. 598 843] set C2c [.. 601 842] set D1c [.. 407 578] set D2c [.. 598 843] # foreach a $q b $p { # set j [atomselect 0 "chain D and resid $a"] # $j set resid $b # } # Modify the integer in the atomselect command to match the molecule you want to apply this to foreach a $A2 b $A2c { set j [atomselect 5 "chain A and resid $a"] $j set resid $b } foreach a $B1 b $B1c { set j [atomselect 5 "chain B and resid $a"] $j set resid $b } foreach a $B2 b $B2c { set j [atomselect 5 "chain B and resid $a"] $j set resid $b } foreach a $C2 b $C2c { set j [atomselect 5 "chain C and resid $a"] $j set resid $b } foreach a $D1 b $D1c { set j [atomselect 5 "chain D and resid $a"] $j set resid $b } foreach a $D2 b $D2c { set j [atomselect 5 "chain D and resid $a"] $j set resid $b }