You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw someone using PyLipID at the Biophysical Society Conference 2023 and wanted to give it a try but unfortunately I'm getting the following error at the first stage of li.collect_residue_contacts() (see below). I've tried depreciating numpy to no avail, as that seems to have been the fix for other packages lately. I'm using the sample trajectories.
Many thanks!
ValueError Traceback (most recent call last)
Cell In[1], line 69
58 # i.e. None, the functions will use up all the cpus available. This can use up all the memory in
59 # some cases.
60
(...)
64
65 #### calculate lipid interactions
66 li = LipidInteraction(trajfile_list, topfile_list=topfile_list, cutoffs=cutoffs, lipid=lipid,
67 lipid_atoms=lipid_atoms, nprot=1, resi_offset=resi_offset,
68 timeunit=timeunit, save_dir=save_dir, stride=stride, dt_traj=dt_traj)
---> 69 li.collect_residue_contacts()
70 li.compute_residue_duration(residue_id=None)
71 li.compute_residue_occupancy(residue_id=None)
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/pylipid/api/api.py:333, in LipidInteraction.collect_residue_contacts(self)
330 # calculate interactions from trajectories
331 for traj_idx in trange(len(self._trajfile_list), desc="COLLECT INTERACTIONS FROM TRAJECTORIES",
332 total=len(self._trajfile_list)):
--> 333 traj = md.load(self._trajfile_list[traj_idx], top=self._topfile_list[traj_idx], stride=self._stride)
334 traj_info, self._protein_ref, self._lipid_ref = get_traj_info(traj, lipid=self._lipid,
335 lipid_atoms=self._lipid_atoms,
336 resi_offset=self._resi_offset,
337 nprot=self._nprot,
338 protein_ref=self._protein_ref,
339 lipid_ref=self._lipid_ref)
340 if self._dt_traj is None:
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/core/trajectory.py:396, in load(filename_or_filenames, discard_overlapping_frames, **kwargs)
394 topkwargs.pop("stride", None)
395 topkwargs.pop("start", None)
--> 396 kwargs["top"] = _parse_topology(kwargs.get("top", filename_or_filenames[0]), **topkwargs)
398 #get the right loader
399 try:
400 #loader = _LoaderRegistry[extension][0]
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/core/trajectory.py:183, in _parse_topology(top, **kwargs)
181 topology = load_mol2(top, **kwargs).topology
182 elif isinstance(top, (string_types, os.PathLike)) and (ext in ['.gro']):
--> 183 topology = load_gro(top, **kwargs).topology
184 elif isinstance(top, (string_types, os.PathLike)) and (ext in ['.arc']):
185 topology = load_arc(top, **kwargs).topology
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/formats/gro.py:94, in load_gro(filename, stride, atom_indices, frame, top)
73 """Load a GROMACS GRO file.
74
75 Parameters
(...)
90 it saves time if you have to parse a big number of files
91 """
92 from mdtraj.core.trajectory import _parse_topology, Trajectory
---> 94 with GroTrajectoryFile(filename, 'r', top=top) as f:
95 topology = f.topology
96 if frame is not None:
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/formats/gro.py:148, in GroTrajectoryFile.init(self, filename, mode, force_overwrite, top)
146 try:
147 if self.topology is None:
--> 148 self.n_atoms, self.topology = self._read_topology()
149 else:
150 self.n_atoms = self.topology.n_atoms
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/formats/gro.py:315, in GroTrajectoryFile._read_topology(self)
313 for ln, line in enumerate(self._file):
314 if ln == 1:
--> 315 n_atoms = int(line.strip())
316 elif ln > 1 and ln < n_atoms + 2:
317 (thisresnum, thisresname, thisatomname, thisatomnum) =
318 [line[i5:i5+5].strip() for i in range(4)]
ValueError: invalid literal for int() with base 10: ''
The text was updated successfully, but these errors were encountered:
Hi there,
I saw someone using PyLipID at the Biophysical Society Conference 2023 and wanted to give it a try but unfortunately I'm getting the following error at the first stage of li.collect_residue_contacts() (see below). I've tried depreciating numpy to no avail, as that seems to have been the fix for other packages lately. I'm using the sample trajectories.
Many thanks!
ValueError Traceback (most recent call last)
Cell In[1], line 69
58 # i.e. None, the functions will use up all the cpus available. This can use up all the memory in
59 # some cases.
60
(...)
64
65 #### calculate lipid interactions
66 li = LipidInteraction(trajfile_list, topfile_list=topfile_list, cutoffs=cutoffs, lipid=lipid,
67 lipid_atoms=lipid_atoms, nprot=1, resi_offset=resi_offset,
68 timeunit=timeunit, save_dir=save_dir, stride=stride, dt_traj=dt_traj)
---> 69 li.collect_residue_contacts()
70 li.compute_residue_duration(residue_id=None)
71 li.compute_residue_occupancy(residue_id=None)
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/pylipid/api/api.py:333, in LipidInteraction.collect_residue_contacts(self)
330 # calculate interactions from trajectories
331 for traj_idx in trange(len(self._trajfile_list), desc="COLLECT INTERACTIONS FROM TRAJECTORIES",
332 total=len(self._trajfile_list)):
--> 333 traj = md.load(self._trajfile_list[traj_idx], top=self._topfile_list[traj_idx], stride=self._stride)
334 traj_info, self._protein_ref, self._lipid_ref = get_traj_info(traj, lipid=self._lipid,
335 lipid_atoms=self._lipid_atoms,
336 resi_offset=self._resi_offset,
337 nprot=self._nprot,
338 protein_ref=self._protein_ref,
339 lipid_ref=self._lipid_ref)
340 if self._dt_traj is None:
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/core/trajectory.py:396, in load(filename_or_filenames, discard_overlapping_frames, **kwargs)
394 topkwargs.pop("stride", None)
395 topkwargs.pop("start", None)
--> 396 kwargs["top"] = _parse_topology(kwargs.get("top", filename_or_filenames[0]), **topkwargs)
398 #get the right loader
399 try:
400 #loader = _LoaderRegistry[extension][0]
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/core/trajectory.py:183, in _parse_topology(top, **kwargs)
181 topology = load_mol2(top, **kwargs).topology
182 elif isinstance(top, (string_types, os.PathLike)) and (ext in ['.gro']):
--> 183 topology = load_gro(top, **kwargs).topology
184 elif isinstance(top, (string_types, os.PathLike)) and (ext in ['.arc']):
185 topology = load_arc(top, **kwargs).topology
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/formats/gro.py:94, in load_gro(filename, stride, atom_indices, frame, top)
73 """Load a GROMACS GRO file.
74
75 Parameters
(...)
90 it saves time if you have to parse a big number of files
91 """
92 from mdtraj.core.trajectory import _parse_topology, Trajectory
---> 94 with GroTrajectoryFile(filename, 'r', top=top) as f:
95 topology = f.topology
96 if frame is not None:
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/formats/gro.py:148, in GroTrajectoryFile.init(self, filename, mode, force_overwrite, top)
146 try:
147 if self.topology is None:
--> 148 self.n_atoms, self.topology = self._read_topology()
149 else:
150 self.n_atoms = self.topology.n_atoms
File ~/anaconda3/envs/membrane/lib/python3.11/site-packages/mdtraj/formats/gro.py:315, in GroTrajectoryFile._read_topology(self)
313 for ln, line in enumerate(self._file):
314 if ln == 1:
--> 315 n_atoms = int(line.strip())
316 elif ln > 1 and ln < n_atoms + 2:
317 (thisresnum, thisresname, thisatomname, thisatomnum) =
318 [line[i5:i5+5].strip() for i in range(4)]
ValueError: invalid literal for int() with base 10: ''
The text was updated successfully, but these errors were encountered: