dimchris / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

Can't access "far" residues #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
In : import MDAnalysis
In : from MDAnalysis import Universe
In : MDAnalysis.core.flags['convert_gromacs_lengths'] = False
In : universe = Universe(opts.myGro)
In : notW = universe.selectAtoms("not (name W)")
In : notW.numberOfResidues()
Out: 128
In : notW.selectAtoms("resid 65")
Out: Traceback...

What is the expected output? What do you see instead?
All of the 128 residues should be available.

What version of the product are you using? On what operating system?
version: 0.7.5-devel
commit b92ba10be51d9aa7d440aaa51f98f691bef07566
Author: Oliver Beckstein <orbeckst@gmail.com>
Date:   Sat Feb 11 03:41:14 2012 -0700

Please provide any additional information below.
My gro file is fractured: it has 64 bafx molecules, than some 2000 waters, then 
again - 64 bafxs and 2000 waters. MDanalysis can't access "far" bafxs. Though 
it does see them - it says that the total number of residues is 128.

Original issue reported on code.google.com by kheyfbo...@gmail.com on 23 Feb 2012 at 3:07

Attachments:

GoogleCodeExporter commented 9 years ago
Oh, oh, oh - I made a mistake: one should load the attached file:
    In : universe = Universe("bafx_membrane.gro")
instead of
    In : universe = Universe(opts.myGro)

Original comment by kheyfbo...@gmail.com on 23 Feb 2012 at 3:14

GoogleCodeExporter commented 9 years ago
This is not MDAnalysis's fault: In your GRO file, the second set of residues 
has the resid numbers 2065 to 2127:

  print notW.residues[63:65]
  [<Residue 'BAFX', 64>, <Residue 'BAFX', 2065>] 

You can access your residue "65" as 

  notW.selectAtoms("resid 2065")

At the moment we don't have functionality to rearrange the topology. You can 
file and enhancement request if you like.

I am closing this issue report as it's not a bug as invalid. (Btw "invalid" 
does not mean that this wasn't a legitimate question, it only has the meaning 
"not a bug".) 

Original comment by orbeckst on 23 Feb 2012 at 11:53

GoogleCodeExporter commented 9 years ago
Thanks for the quick response. Yesterday I made a simple work-around, but now 
I'll try to re-write it using notW.residues[i] in a loop.

Appreciate Your work. Being able to bring MD data into numpy easily is 
absolutely amazing.

Original comment by kheyfbo...@gmail.com on 24 Feb 2012 at 2:45