How to do MDFF

From Computational Biophysics and Materials Science Group
Revision as of 12:58, 13 September 2014 by Kevin (Talk | contribs) (Created page with "==Analysis== ===Check contacts of atoms=== mol new solvent_CA_last.pdb set name1 "P3 P4" set name2 "P7 P8" set sel1 [atomselect top "segname $name1"] set sel2 [atomsele...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Analysis

Check contacts of atoms

mol new solvent_CA_last.pdb
set name1 "P3 P4"
set name2 "P7 P8"

set sel1 [atomselect top "segname $name1"]
set sel2 [atomselect top "segname $name2"]

set res [measure contacts 10 $sel1 $sel2]

set col1 [lindex $res 0]
set col2 [lindex $res 1]

set outf [open $name1-$name2.txt "w"]
set outf2 [open check-$name1-$name2.txt "w"]
for {set i 0} {$i < [llength $col1]} {incr i} {

set num1 [lindex $col1 $i]
set num2 [lindex $col2 $i]

set sel3 [atomselect top "index $num1"]
set out1 [$sel3 get resid]
set out3 [$sel3 get segname]
set sel4 [atomselect top "index $num2"]
set out2 [$sel4 get resid]
set out4 [$sel4 get segname]
puts "$out1 $out2"

puts $outf "$out1 $out2"
puts $outf2 "$out3 $out4" 
}
quit

Basically it is using "measure contacts" function of VMD and list indexes of CA from the two selections and within 10 A. It is thus recommended to read only CA coordinates as your input. As we are interested in the residue ID of CA, the rest of the code then converts indexes into their corresponding resid. The resulting file will be two columns of integers listing pairs of CA which is within 10 A.

In bash you may have a quick look at your result by

cat result.dat | cut -d ' ' -f1 | sort | uniq -c

in which you may change f1 to f2 as to view only column 2 of the file instead of only column 1.

A check-XXX.dat is also written with segname of the pairs of CA as to check whether they come from the same segname or not. Also use

 cat result.dat | cut -d ' ' -f1 | sort | uniq -c

to check their repetition.