Skip to content

Commit

Permalink
Merge pull request #11 from lunamorrow/clean_slate
Browse files Browse the repository at this point in the history
Reset to clean slate, to enable work on Parser
  • Loading branch information
lunamorrow authored Jun 17, 2024
2 parents b5985ae + ff97287 commit 802e09f
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions mda_openbabel_converter/OpenBabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import MDAnalysis as mda
from MDAnalysis.converters.base import ConverterBase
from MDAnalysis.coordinates.base import SingleFrameReaderBase
from MDAnalysis.coordinates.memory import MemoryReader
from MDAnalysis.core.groups import AtomGroup

try:
Expand All @@ -13,7 +13,7 @@
except ImportError:
print("Cannot find openbabel, install with 'pip install openbabel==2.4.0'")

class OpenBabelReader(SingleFrameReaderBase):
class OpenBabelReader(MemoryReader):
"""
Convert an OpenBabel OBMol (from the file) to a MDAnalysis AtomGroup
"""
Expand All @@ -34,39 +34,6 @@ def __init__(self, filename: OBMol, **kwargs):
"""
Converts file to OBMol to AtomGroup
"""
self.atoms = []
self.n_atoms = 0
self.residues = []
self.n_residues = 0
self.segments = []
self.n_segments = 0

obmol = filename

# Atoms
names = []
chiralities = []
resnums = []
resnames = []
elements = []
masses = []
charges = []
aromatics = []
ids = []
atomtypes = []
segids = []
altlocs = []
chainids = []
icodes = []
occupancies = []
tempfactors = []

for i in range(1, obmol):
atom = obmol.GetAtomById(i-1)
# need to add handling incase attributes are invalid or null in OBMol
names.append(atom.GetType()) #char


pass

class OpenBabelConverter(ConverterBase):
Expand Down

0 comments on commit 802e09f

Please sign in to comment.