Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guess fragments based on xyz files #90

Closed
YHordijk opened this issue Jan 25, 2024 · 1 comment · Fixed by #89
Closed

Guess fragments based on xyz files #90

YHordijk opened this issue Jan 25, 2024 · 1 comment · Fixed by #89
Assignees

Comments

@YHordijk
Copy link
Contributor

Currently it is quite a lot of effort to get the correct fragments atom from an xyz file. I propose we accept two types of notation:

As molecule flags

8

N       0.00000000       0.00000000      -0.81474153 
B      -0.00000000      -0.00000000       0.83567034 
H       0.47608351      -0.82460084      -1.14410295 
H       0.47608351       0.82460084      -1.14410295 
H      -0.95216703       0.00000000      -1.14410295 
H      -0.58149793       1.00718395       1.13712667 
H      -0.58149793      -1.00718395       1.13712667 
H       1.16299585      -0.00000000       1.13712667 

frag_Donor = 1, 3:5
frag_Acceptor = 2, 6:8

Fragments should then be separated by their indices (starting at 1). Indices can be given as integers or as ranges with the - notation. The flag that defines the indices should start with frag_ so that we can easily get the name of the fragment.

As atom flags

8

N       0.00000000       0.00000000      -0.81474153 frag=Donor
B      -0.00000000      -0.00000000       0.83567034 frag=Acceptor
H       0.47608351      -0.82460084      -1.14410295 frag=Donor
H       0.47608351       0.82460084      -1.14410295 frag=Donor
H      -0.95216703       0.00000000      -1.14410295 frag=Donor
H      -0.58149793       1.00718395       1.13712667 frag=Acceptor
H      -0.58149793      -1.00718395       1.13712667 frag=Acceptor
H       1.16299585      -0.00000000       1.13712667 frag=Acceptor

The second method is to give the atoms themselves flags. In this case I propose we let the user specify the fragment with the frag flag. In this way you do not have to mess with the indices.

With the notation like this we should add the tcutility.molecule.guess_fragments function. This should take a molecule loaded with tcutility.molecule.load and return a dictionary with fragment names as keys and molecule objects as values.

@YHordijk YHordijk self-assigned this Jan 25, 2024
@YHordijk
Copy link
Contributor Author

See commit 0c0ecd0 for the implementation

@YHordijk YHordijk linked a pull request Jan 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant