DCD file not loading to MDAnalysis

37 views
Skip to first unread message

Devanshi Pandya

unread,
Oct 21, 2021, 1:28:51 PM10/21/21
to MDnalysis discussion

Hello!

When I run the following:

u = MDAnalysis.Universe(psf, dcd)

where psf and dcd are my own topology and trajectory files loaded and from my computer and opened, I get the error:

'_io.TextIOWrapper' object has no attribute 'encode'

Here is a OneDrive link to the dcd file.

https://prodduke-my.sharepoint.com/:u:/g/personal/dp243_duke_edu/EXlgbdCiTqVOhARDjcWz4Y8ByE6RV720OyoqIcXWIJHaxg

This error doesn't arise when I make a universe with just the psf file, is there anything I need to do in order to make the dcd file compatible?

Thanks,

Devanshi


Oliver Beckstein

unread,
Oct 21, 2021, 1:31:28 PM10/21/21
to mdnalysis-discussion
Hi Devanshi,

Welcome to the MDAnalysis mailing list!

Can you please tell us

- your operating system
- version of Python
- version of MDAnalysis
- how you installed MDAnalysis

That might help us to get a better idea.

Please copy and paste the *whole* output of the error in the email.

Thanks,
Oliver

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/b40e620b-030e-4b06-ac51-6008b95f98f2n%40googlegroups.com.

--
Oliver Beckstein (he/his/him)







Devanshi Pandya

unread,
Nov 2, 2021, 2:06:18 PM11/2/21
to mdnalysis-...@googlegroups.com
Linux OS, Python 3.6, used conda to install the latest version of MDAnalysis.
Here is the entire error message:
image.png
Thanks so much!

You received this message because you are subscribed to a topic in the Google Groups "MDnalysis discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mdnalysis-discussion/lRX8_XTKv90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/7ADBF995-68F4-4BC5-B548-983175D85CCF%40gmail.com.


--
Devanshi Pandya
Duke Rhydhun Executive Captain
Duke-UNICEF Student Advisory Counselor

Oliver Beckstein

unread,
Nov 2, 2021, 8:09:23 PM11/2/21
to mdnalysis-discussion
Hi Devanshi,

What exactly is “dcd”? Please provide the code that defines this variable.

Oliver

On Nov 2, 2021, at 11:05 AM, Devanshi Pandya <devan...@gmail.com> wrote:

Linux OS, Python 3.6, used conda to install the latest version of MDAnalysis.
Here is the entire error message:
<image.png>
Thanks so much!

Devanshi Pandya

unread,
Nov 5, 2021, 10:55:13 AM11/5/21
to mdnalysis-...@googlegroups.com
This is the line:
dcd = open("5ibo22T370.dcd")
Where the file being opened is the dcd file I sent the OneDrive link to earlier. The psf file was opened similarly:
psf = open("5ibo22k.psf") and gave no errors if I make a universe of just psf, which is why I believe the error has something to do with the dcd file.

Thanks,
Devanshi

Irfan Alibay

unread,
Nov 5, 2021, 11:00:53 AM11/5/21
to MDnalysis discussion
Hi Devanshi,

MDAnalysis expects the path of the file for inputs, not a file object.

Please try just doing:

u = mda.Universe("5bio22k.psf", "5bio22T370.dcd")


Best regards,

Irfan
Reply all
Reply to author
Forward
0 new messages