mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Extend Implementation of Unwrap

Open NinadBhat opened this issue 5 years ago • 4 comments

The current implementation of Group.unwrap(PR #2189) works for bonded structures. This method should also work for molecules which are part of the same group, e.g., DNA molecules.

Proposed Solution

  • Add keyword reference_point
  • Unwrap molecules such that they are closest to the reference_point

Questions to answered before implementation

  • Is there a more efficient method for unwrapping?
  • Which test cases will be used?

[EDIT]

Current method I am writing method which shifts a molecule to its periodic image which is closest to the reference point. So the working will be as follows: For each molecule in a group

  • make_whole will unwrap the molecule
  • chose_periodic_image will translate the molecule to the periodic image which is closest to the reference point

NinadBhat avatar May 19 '19 14:05 NinadBhat

@NinadBhat To be able to aswer the question "Is there a more efficient method for unwrapping?" it would be good to write down here what is the method you are thinking about.

jbarnoud avatar May 23 '19 12:05 jbarnoud

@jbarnoud I have updated the issue with the current methods. Kindly, have a look.

NinadBhat avatar May 29 '19 08:05 NinadBhat

@NinadBhat make_whole is currently just doing a breadth first search of the molecule's bonds and correcting bond lengths that are wrong as it goes. There's probably some performance that you can squeeze out of it, but I don't think the method itself is wrong/inefficient. I'd focus on getting things implemented then look at performance if you have time later.

richardjgowers avatar May 29 '19 09:05 richardjgowers

I would be curious about the performance of an alternative algorithm: connecting all the fragments with pseudo bonds, then running make_whole as if it was just one fragment. I do not know what the approach is worth, but it was my first idea when I thought about the issue.

jbarnoud avatar May 31 '19 08:05 jbarnoud