AtomGroup not found

23 views
Skip to first unread message

Pallavi Banerjee

unread,
Nov 24, 2022, 3:21:32 PM11/24/22
to MDnalysis discussion
Hi everyone,

I need to use an old version of MDAnalysis, that is, v-1.1.1. However, I get the following error: 
AttributeError: 'module' object has no attribute 'AtomGroup'

Could someone tell me which was the earliest version of MDAnalysis to include 'AtomGroup' ?

Thanks!

Best,
Pallavi


Irfan Alibay

unread,
Nov 24, 2022, 6:23:35 PM11/24/22
to MDnalysis discussion
Hi,

v1.1.1 definitely uses AtomGroup objects. It's hard to tell what is happening here, could you paste the code you are trying to use?

Many thanks,

Irfan

Pallavi Banerjee

unread,
Nov 25, 2022, 4:54:26 AM11/25/22
to MDnalysis discussion
Hi Irfan, 

Thanks for the clarification! Here is a snippet of the code that the error points to :

def ReadInTrajectory(nucleotides, universe, PARMS):
    TimeTable = {}
    for nuc in nucleotides:
        segid = nuc.get_segid().strip()
        resname = nuc.get_resname().strip()
        rnum = str(nuc.get_id()[1])
        for at in nuc:
            atname = at.get_id()
            full_id = at.get_full_id()
            desc = exact_description(at, rnum, segid, resname, atname)
            atoms = universe.select_atoms(desc)
            if len(atoms) == 0:
                desc = "resid "+rnum
                tmp = [n for n in universe.select_atoms(desc)
                       if (n.name == atname) and (n.resname == resname)]
                atoms = MDAnalysis.core.AtomGroup.AtomGroup(tmp)

Thanks in advance!

Best,
Pallavi

Irfan Alibay

unread,
Nov 28, 2022, 6:56:33 PM11/28/22
to mdnalysis-...@googlegroups.com
Hi Pallavi,

It looks like the import orders changed a bit for 2.0.0, can you try "MDAnalysis.core.groups.AtomGroup(tmp)" instead of "MDAnalysis.core.AtomGroup.AtomGroup(tmp)"?

Best,

Irfan

--
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/c63b668f-afbf-457d-b9a0-d7d825086f33n%40googlegroups.com.

Pallavi Banerjee

unread,
Nov 29, 2022, 6:05:39 AM11/29/22
to MDnalysis discussion
Hi Irfan, 

That worked perfectly.. Thanks a lot!

Best,
Pallavi

Reply all
Reply to author
Forward
0 new messages