Closed vas2201 closed 1 year ago
I can add two dihedrals to ad.projection, but not able to add more than two. ad.projection = (MetricDihedral(dih_zeta_6, dih_zeta_7, protsel='nucleic')) could you please advise me that how can I add more than two dihedrlas to ad.projection ? Regards Vas
Hi, in the examples section at the end of this document you can see how to pass multiple dihedrals https://software.acellera.com/moleculekit/moleculekit.projections.metricdihedral.html You just need to add them all to one list (not multiple lists)
As for default dihedrals for nucleics, sorry currently there is no such function. But if you pass me some code which does it I can look at integrating it into HTMD as a default.
Thank you for your input. I see the end of the document as the following. but I did not find a way to export the manually defined dihedrals in the given example.
please download the python file in which I am defining all 6 angles. https://drive.google.com/file/d/1obvAYJD2fR1eqfk8-kKjsHR9yJgDNG0K/view?usp=share_link
mol = Molecule('3PTB')
mol.filter('not insertion A')
met = MetricDihedral()
met.project(mol)
# More complicated example
dih = []
dih.append(Dihedral.chi1(mol, 45))
dih.append(Dihedral.psi(mol, 29, 30))
met = MetricDihedral(dih, protsel='protein and segid 0')
met.project(mol)
met.getMapping(mol)
I tried to troubleshoot the following way (test-1 & test-2)
test-1
mol = Molecule('structure.pdb')
met = MetricDihedral()
met.project(mol)
dih =[]
dih.append (dih_alpha_6)
dih.append (dih_alpha_7)
met = MetricDihedral(dih, protsel='nucleic and segid RNAA')
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[20], line 7
5 dih.append (dih_alpha_6)
6 dih.append (dih_alpha_7)
----> 7 met = MetricDihedral(dih, protsel='nucleic and segid RNAA')
8 #ad.projection = (MetricDihedral(dih, protsel='nucleic and segid RNAA'))
File ~/anaconda3/envs/100htmd/lib/python3.9/site-packages/moleculekit/projections/metricdihedral.py:761, in MetricDihedral.__init__(self, dih, sincos, protsel)
758 super().__init__()
760 if dih is not None and not isinstance(dih[0], Dihedral):
--> 761 raise RuntimeError(
762 "Manually passing dihedrals to MetricDihedral requires use of the Dihedral class. Check the example in the documentation"
763 )
765 self._protsel = protsel
766 self._sincos = sincos
RuntimeError: Manually passing dihedrals to MetricDihedral requires use of the Dihedral class. Check the example in the documentation
test-2
mol = Molecule('structure.pdb')
met = MetricDihedral()
met.project(mol)
dih =[]
dih.append (dih_alpha_6(mol))
dih.append (dih_alpha_7(mol))
met = MetricDihedral(dih, protsel='nucleic and segid RNAA')
#ad.projection = (MetricDihedral(dih, protsel='nucleic and segid RNAA'))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[21], line 5
3 met.project(mol)
4 dih =[]
----> 5 dih.append (dih_alpha_6(mol))
6 dih.append (dih_alpha_7(mol))
7 met = MetricDihedral(dih, protsel='nucleic and segid RNAA')
TypeError: 'list' object is not callable
please advise on this matter. I guess that I am missing something here while exporting the manually defined dihedrals.
Regards Vas
Hi this is the reference for all 6 angles and other angles (see the table) to include RNA md trajectory. https://pubs.acs.org/doi/10.1021/acs.jctc.6b00870 Thanks for your consdiraion. -Vas
to extend a list in python you can just sum another list to it. If you use append you are creating a list of lists (nested list) which is not what MetricDihedral expects as input. It expects a simple list
met = MetricDihedral(dih_alpha_6+dih_alpha_7, protsel='nucleic and segid RNAA')
Thank you.
Hello,
I defined dihedrals for RNA for residue-2 as per the documentation. I do have 20 or more residues to include and total 6 angles for each residue that I suppose to define.
d = Dihedral(atom1, atom2, atom3, atom4) ad.projection = MetricDihedral()
Regards Vas