ymatsunaga / mdtoolbox_doc

Documentation for MDToolbox
0 stars 1 forks source link

function to get the index of dihedral atoms #1

Open xibeisiber opened 10 years ago

xibeisiber commented 10 years ago

Thanks for your toolbox, useful for me. Besides I wonder whether we can build a function to get the indexes of dihedral atoms from pdb files, being the input of function 'calcdihedral'.

xibeisiber commented 10 years ago

em,this seems easy to do,just find the index of "N","CA","C", and rearrange them

ymatsunaga commented 10 years ago

Yes, you right. Something like this:

[pdb, crd] = readpdb('file.pdb');

index_c = find(selectname(pdb.name, 'C')); index_n = find(selectname(pdb.name, 'N')); index_ca = find(selectname(pdb.name, 'CA'));

index_phi = [index_c(1:end-1) index_n(2:end) index_ca(2:end) index_c(2:end)]; index_psi = [index_n(1:end-1) index_ca(1:end-1) index_c(1:end-1) index_n(2:end)];

phi = calcdihedral(crd, index_phi)._180./pi; psi = calcdihedral(crd, index_phi)._180./pi;

On Thu, Jul 24, 2014 at 1:02 PM, xibeisiber notifications@github.com wrote:

em,this seems easy to do,just find the index of "N","CA","C", and rearrange them

— Reply to this email directly or view it on GitHub https://github.com/ymatsunaga/mdtoolbox-doc/issues/1#issuecomment-49965288 .