Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Simple RDKitConverter #2775
Simple RDKitConverter #2775
Changes from 8 commits
90fccce
ba0f89e
b54ec60
ac38ceb
de5560b
b00dee3
495217d
eb5d365
1774963
81eea81
6d6a65b
cf0706c
d41fa5b
fe27f0b
3590113
2d79014
df660b7
68dc7ca
f57e9e6
99da261
18a05ab
1c14478
5493fd1
f5c798a
558f7cd
984f507
e582e63
931a81b
c432ea9
b0c39eb
7b002f1
dc0c276
6b8cd9d
0fd38b0
25ee227
cfce278
3717f57
499010a
9604b6a
30871ab
9c0a42e
66d644d
1bbfb09
4a79cfd
bd88908
d9e088e
f6aa736
b943af1
0105419
7168e2d
de324fd
d1f06f3
5a661f8
6e9c221
b02fef6
67dc9c2
c8acda0
9defa40
39ae42b
ff45d3b
7d7f3f2
9d895bc
f3f6f01
5d342db
eff29a2
5a37d84
ca07796
28d04ed
ae73aff
8eaebbd
425369e
d6cd44d
1398f8c
e71a686
925bd7f
5a24ff6
e5282f3
b7ac69e
aba4b1b
49f3bff
70cce99
e82cf0a
3427c3c
5218daa
3313b56
a72a51b
76102fb
b9a25b2
cec1f68
75f6262
6c4c123
cdb60b2
ebd0416
a1aab5b
dcb8f33
47b2755
89efcd3
a595e69
f394e72
e525e41
9e22681
eaf6887
ded60c0
c18c7cd
4ed0483
d288e87
4e49616
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could simplify this with a call to
ag.bonds.values()
that should raise an IndexError if you have no bonds in your system.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up not using bonds.values() as it needs coordinates to work, but people might just want to convert their topology to rdkit without needing the trajectory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's reasonable.
I'm trying to work out if this does the intended behaviour though. My understanding is that calling
AtomGroup.bonds
should raise a NoDataError if no bond information is present. If bond information is present but the number of bonds is 0, that should be a valid input, at least according to whatever the user provided right?Is there a particular case where the bonds attribute get populated but we still require guessing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only case I could find where the bonds attribute was present but empty is a PDB file without a CONECT record, I don't know if that's intended or not (the PDB_helix test file for example).
The corresponding AtomGroup probably still requires guessing bonds though, as I don't really see a scenario where people need to convert their simulation of monoatomic ions or noble gases to RDKit.
For now I can just try if ag.bonds is present if you prefer, PDB files are a mess anyway !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably not normal, we should have a consistent API, if bonds aren't present then the bonds attribute doesn't get assigned :/ Can you raise this as an issue too? It might be that there's a rationale for it, but I can't seem to understand what it could be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raised #2832