Contact maps are a quick way to identify residues of a protein (or monomer) that interact with residue from another protein, ligand or monomer. The script below helps obtain a distance list:
set seg1 [atomselect top "segname SG03 and name CA"]
set seg2 [atomselect top "segname SG04 and name CA"]
set file [open "Contact_map.dat" w]
set list1 [$seg1 get index]
set list2 [$seg2 get index]
foreach atom1 $list1 {
foreach atom2 $list2 {
set index1 [atomselect top "index $atom1"]
set index2 [atomselect top "index $atom2"]
set resid1 [[atomselect top "index $atom1"] get resid]
set resid2 [[atomselect top "index $atom2"] get resid]
set resnm1 [[atomselect top "index $atom1"] get resname]
set resnm2 [[atomselect top "index $atom2"] get resname]
puts $file "$resnm1 $resid1 $resnm2 $resid2 [veclength [vecsub [measure center $index1] [measure center $index2]]]"
$index1 delete
$index2 delete
}
puts $file " " # I include this line to make it easier to make contour plots using gnuplot.
}
close $file
Hey Pavan, I am trying to use this code to get a distance list, but the file that it outputs contains no data? I have already modified it to the correct segname, but it is still not giving me any data output. Any help would be appreciated.
ReplyDelete