barnaba icon indicating copy to clipboard operation
barnaba copied to clipboard

for RNA Analysis

Open Ompal12 opened this issue 5 years ago • 2 comments

Here i am using below code for calculation of ermsd of RNA system by using gromacs trajectry file. And i got an error like Error... Can anyone help me regarding this?

Thank you

`import barnaba as bb import mdtraj as md

define trajectory and topology files

native="md.pdb" traj = "md.xtc" top = "md.pdb"

calculate eRMSD between native and all frames in trajectory

ermsd = bb.ermsd(native,traj,topology=top)

import matplotlib.pyplot as plt plt.xlabel("Frame") plt.ylabel("eRMSD from native") plt.plot(ermsd[::50]) plt.show()

plt.hist(ermsd,density=True,bins=50) plt.xlabel("eRMSD from native") plt.show()`

Error- MemoryError Traceback (most recent call last) in () 7 8 # calculate eRMSD between native and all frames in trajectory ----> 9 ermsd = bb.ermsd(native,traj,topology=top) 10 11 import matplotlib.pyplot as plt

/home/workstation/anaconda3/lib/python3.5/site-packages/barnaba/functions.py in ermsd(reference, target, cutoff, topology, residues_ref, residues_target) 56 traj = md.load(target) 57 else: ---> 58 traj = md.load(target,top=topology) 59 60 warn += "# Loaded target %s \n" % target

/home/workstation/anaconda3/lib/python3.5/site-packages/mdtraj/core/trajectory.py in load(filename_or_filenames, discard_overlapping_frames, **kwargs) 428 _assert_files_or_dirs_exist(filename_or_filenames) 429 --> 430 value = loader(filename, **kwargs) 431 return value 432

mdtraj/formats/xtc/xtc.pyx in xtc.load_xtc (mdtraj/formats/xtc/xtc.c:2766)()

mdtraj/formats/xtc/xtc.pyx in xtc.load_xtc (mdtraj/formats/xtc/xtc.c:2720)()

mdtraj/formats/xtc/xtc.pyx in xtc.XTCTrajectoryFile.read_as_traj (mdtraj/formats/xtc/xtc.c:4579)()

mdtraj/formats/xtc/xtc.pyx in xtc.XTCTrajectoryFile.read (mdtraj/formats/xtc/xtc.c:6037)()

MemoryError:

Ompal12 avatar Jan 06 '21 07:01 Ompal12

Hi, It looks like the error comes from mdtraj when loading the xtc trajectory. (you should get the same error if you load the xtc directly with mdtraj.load_xtc(traj,topology=top). you can double check that) Maybe your trajectory is just very big and you run out of memory? If this is the case, I'd say you can either try to downsample your traj or split it into smaller chuncks, compute the ermsd for each and then concatenate them back together.

giopina avatar Jan 06 '21 09:01 giopina

Thanks a lot, it was very big file. Now the problem is solved.

On Wed, Jan 6, 2021, 15:27 Giovanni Pinamonti [email protected] wrote:

Hi, It looks like the error comes from mdtraj when loading the xtc trajectory. (you should get the same error if you load the xtc directly with mdtraj.load_xtc(traj,topology=top). you can double check that) Maybe your trajectory is just very big and you run out of memory? If this is the case, I'd say you can either try to downsample your traj or split it into smaller chuncks, compute the ermsd for each and then concatenate them back together.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/srnas/barnaba/issues/44#issuecomment-755202622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUJJO4EMEVXUD4T5M77BQTSYQXZ3ANCNFSM4VXECPOA .

Ompal12 avatar Jan 08 '21 00:01 Ompal12